diff options
Diffstat (limited to 'plugins/SMS/src')
-rw-r--r-- | plugins/SMS/src/SMS_svc.cpp | 2 | ||||
-rw-r--r-- | plugins/SMS/src/common.h | 60 | ||||
-rw-r--r-- | plugins/SMS/src/functions.cpp | 29 | ||||
-rw-r--r-- | plugins/SMS/src/recvdlg.cpp | 4 | ||||
-rw-r--r-- | plugins/SMS/src/senddlg.cpp | 8 |
5 files changed, 43 insertions, 60 deletions
diff --git a/plugins/SMS/src/SMS_svc.cpp b/plugins/SMS/src/SMS_svc.cpp index 4a60c271fd..cff9a72946 100644 --- a/plugins/SMS/src/SMS_svc.cpp +++ b/plugins/SMS/src/SMS_svc.cpp @@ -98,7 +98,7 @@ void UnloadServices() int SmsRebuildContactMenu(WPARAM wParam,LPARAM lParam)
{
- CListShowMenuItem(ssSMSSettings.hContactMenuItems[0],(BOOL)GetContactPhonesCount((HANDLE)wParam));
+ Menu_ShowItem(ssSMSSettings.hContactMenuItems[0], GetContactPhonesCount((HANDLE)wParam));
return 0;
}
diff --git a/plugins/SMS/src/common.h b/plugins/SMS/src/common.h index 14e04c614d..b0c3366480 100644 --- a/plugins/SMS/src/common.h +++ b/plugins/SMS/src/common.h @@ -40,10 +40,10 @@ extern HINSTANCE hInst; // структура содержащая информацию по построению меню или расширеных иконок
struct GUI_DISPLAY_ITEM
{
- LPSTR lpszName; // имя сервиса, оно же имя в иколибе
- LPWSTR lpwszDescr; // текстовое описание отображаемое юзеру
- LONG defIcon; // иконка из ресурсов
- LPVOID lpFunc; // функция вызываемая меню
+ LPSTR lpszName; // имя сервиса, оно же имя в иколибе
+ LPWSTR lpwszDescr; // текстовое описание отображаемое юзеру
+ LONG defIcon; // иконка из ресурсов
+ LPVOID lpFunc; // функция вызываемая меню
};
@@ -53,28 +53,25 @@ struct GUI_DISPLAY_ITEM typedef struct
{
- HANDLE hHeap;
- HINSTANCE hInstance;
+ HANDLE hHeap;
+ HINSTANCE hInstance;
- //HANDLE hMainMenuIcons[MAIN_MENU_ITEMS_COUNT+1];
- HANDLE hMainMenuItems[MAIN_MENU_ITEMS_COUNT+1];
+ HGENMENU hMainMenuItems[MAIN_MENU_ITEMS_COUNT+1];
+ HGENMENU hContactMenuItems[CONTACT_MENU_ITEMS_COUNT+1];
- //HANDLE hContactMenuIcons[CONTACT_MENU_ITEMS_COUNT+1];
- HANDLE hContactMenuItems[CONTACT_MENU_ITEMS_COUNT+1];
+ HANDLE hHookModulesLoaded;
+ HANDLE hHookPreShutdown;
+ HANDLE hHookOptInitialize;
+ HANDLE hHookRebuildCMenu;
+ HANDLE hHookDbAdd;
+ HANDLE hHookProtoAck;
+ HANDLE hHookAccListChanged;
- HANDLE hHookModulesLoaded;
- HANDLE hHookPreShutdown;
- HANDLE hHookOptInitialize;
- HANDLE hHookRebuildCMenu;
- HANDLE hHookDbAdd;
- HANDLE hHookProtoAck;
- HANDLE hHookAccListChanged;
+ LIST_MT lmtSendSMSWindowsListMT;
+ LIST_MT lmtRecvSMSWindowsListMT;
- LIST_MT lmtSendSMSWindowsListMT;
- LIST_MT lmtRecvSMSWindowsListMT;
-
- PROTOACCOUNT **ppaSMSAccounts;
- SIZE_T dwSMSAccountsCount;
+ PROTOACCOUNT **ppaSMSAccounts;
+ SIZE_T dwSMSAccountsCount;
} SMS_SETTINGS;
@@ -115,25 +112,24 @@ extern SMS_SETTINGS ssSMSSettings; #define GetContactNameA(Contact) (LPSTR)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)Contact,0)
#define GetContactNameW(Contact) (LPWSTR)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)Contact,GCDNF_UNICODE)
-#define DB_SMS_DeleteValue(Contact,valueName) DBDeleteContactSetting(Contact,PROTOCOL_NAMEA,valueName)
-#define DB_SMS_GetDword(Contact,valueName,parDefltValue) DBGetContactSettingDword(Contact,PROTOCOL_NAMEA,valueName,parDefltValue)
-#define DB_SMS_SetDword(Contact,valueName,parValue) DBWriteContactSettingDword(Contact,PROTOCOL_NAMEA,valueName,parValue)
-#define DB_SMS_GetWord(Contact,valueName,parDefltValue) DBGetContactSettingWord(Contact,PROTOCOL_NAMEA,valueName,parDefltValue)
-#define DB_SMS_SetWord(Contact,valueName,parValue) DBWriteContactSettingWord(Contact,PROTOCOL_NAMEA,valueName,parValue)
-#define DB_SMS_GetByte(Contact,valueName,parDefltValue) DBGetContactSettingByte(Contact,PROTOCOL_NAMEA,valueName,parDefltValue)
-#define DB_SMS_SetByte(Contact,valueName,parValue) DBWriteContactSettingByte(Contact,PROTOCOL_NAMEA,valueName,parValue)
+#define DB_SMS_DeleteValue(Contact,valueName) db_unset(Contact,PROTOCOL_NAMEA,valueName)
+#define DB_SMS_GetDword(Contact,valueName,parDefltValue) db_get_dw(Contact,PROTOCOL_NAMEA,valueName,parDefltValue)
+#define DB_SMS_SetDword(Contact,valueName,parValue) db_set_dw(Contact,PROTOCOL_NAMEA,valueName,parValue)
+#define DB_SMS_GetWord(Contact,valueName,parDefltValue) db_get_w(Contact,PROTOCOL_NAMEA,valueName,parDefltValue)
+#define DB_SMS_SetWord(Contact,valueName,parValue) db_set_w(Contact,PROTOCOL_NAMEA,valueName,parValue)
+#define DB_SMS_GetByte(Contact,valueName,parDefltValue) db_get_b(Contact,PROTOCOL_NAMEA,valueName,parDefltValue)
+#define DB_SMS_SetByte(Contact,valueName,parValue) db_set_b(Contact,PROTOCOL_NAMEA,valueName,parValue)
BOOL DB_GetStaticStringW(HANDLE hContact,LPSTR lpszModule,LPSTR lpszValueName,LPWSTR lpszRetBuff,SIZE_T dwRetBuffSize,SIZE_T *pdwRetBuffSize);
#define DB_SMS_GetStaticStringW(Contact,ValueName,Ret,RetBuffSize,pRetBuffSize) DB_GetStaticStringW(Contact,PROTOCOL_NAMEA,ValueName,Ret,RetBuffSize,pRetBuffSize)
BOOL DB_SetStringExW(HANDLE hContact,LPSTR lpszModule,LPSTR lpszValueName,LPWSTR lpwszValue,SIZE_T dwValueSize);
-#define DB_SetStringW(Contact,Module,valueName,parValue) DBWriteContactSettingWString(Contact,Module,valueName,parValue)
-#define DB_SMS_SetStringW(Contact,valueName,parValue) DBWriteContactSettingWString(Contact,PROTOCOL_NAMEA,valueName,parValue)
+#define DB_SetStringW(Contact,Module,valueName,parValue) db_set_ws(Contact,Module,valueName,parValue)
+#define DB_SMS_SetStringW(Contact,valueName,parValue) db_set_ws(Contact,PROTOCOL_NAMEA,valueName,parValue)
#define DB_SMS_SetStringExW(Contact,valueName,parValue,parValueSize) DB_SetStringExW(Contact,PROTOCOL_NAMEA,valueName,parValue,parValueSize)
LRESULT CALLBACK MessageSubclassProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
LPSTR GetModuleName(HANDLE hContact);
void EnableControlsArray(HWND hWndDlg,WORD *pwControlsList,SIZE_T dwControlsListCount,BOOL bEnabled);
-void CListShowMenuItem(HANDLE hMenuItem,BOOL bShow);
// Declaration of function that returns received string with only numbers
SIZE_T CopyNumberA(LPSTR lpszOutBuff,LPSTR lpszBuff,SIZE_T dwLen);
diff --git a/plugins/SMS/src/functions.cpp b/plugins/SMS/src/functions.cpp index 0bdb9ce46e..5110270f3c 100644 --- a/plugins/SMS/src/functions.cpp +++ b/plugins/SMS/src/functions.cpp @@ -24,7 +24,7 @@ BOOL DB_GetStaticStringW(HANDLE hContact,LPSTR lpszModule,LPSTR lpszValueName,LP }
if (pdwRetBuffSize) (*pdwRetBuffSize)=dwReadedStringLen;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}else{
if (lpwszRetBuff && dwRetBuffSize>=sizeof(WCHAR)) (*((WCHAR*)lpwszRetBuff))=0;
if (pdwRetBuffSize) (*pdwRetBuffSize)=0;
@@ -56,7 +56,7 @@ BOOL DB_SetStringExW(HANDLE hContact,LPSTR lpszModule,LPSTR lpszValueName,LPWSTR }
}else{
bRet=TRUE;
- DBDeleteContactSetting(hContact,lpszModule,lpszValueName);
+ db_unset(hContact,lpszModule,lpszValueName);
}
return(bRet);
}
@@ -81,19 +81,6 @@ void EnableControlsArray(HWND hWndDlg,WORD *pwControlsList,SIZE_T dwControlsList for(SIZE_T i=0;i<dwControlsListCount;i++) EnableWindow(GetDlgItem(hWndDlg,pwControlsList[i]),bEnabled);
}
-
-void CListShowMenuItem(HANDLE hMenuItem,BOOL bShow)
-{
- CLISTMENUITEM mi={0};
-
- mi.cbSize=sizeof(mi);
- mi.flags=CMIM_FLAGS;
- if (bShow==FALSE) mi.flags|=CMIF_HIDDEN;
-
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hMenuItem,(LPARAM)&mi);
-}
-
-
//This function gets a Cellular string szPhone and clean it from symbools.
SIZE_T CopyNumberA(LPSTR lpszOutBuff,LPSTR lpszBuff,SIZE_T dwLen)
{
@@ -570,32 +557,32 @@ void LoadMsgDlgFont(int i,LOGFONT *lf,COLORREF *colour) if (colour)
{
mir_snprintf(str,sizeof(str),"Font%dCol",i);
- (*colour)=DBGetContactSettingDword(NULL,SRMMMOD,str,fontOptionsList[0].defColour);
+ (*colour)=db_get_dw(NULL,SRMMMOD,str,fontOptionsList[0].defColour);
}
if (lf)
{
- if (DBGetContactSetting(NULL,SRMMMOD,str,&dbv))
+ if (db_get(NULL,SRMMMOD,str,&dbv))
{
lstrcpyn(lf->lfFaceName,fontOptionsList[0].szDefFace,SIZEOF(lf->lfFaceName));
}else{
lstrcpyn(lf->lfFaceName,dbv.ptszVal,SIZEOF(lf->lfFaceName));
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
mir_snprintf(str,sizeof(str),"Font%dSize",i);
- lf->lfHeight=(char)DBGetContactSettingByte(NULL,SRMMMOD,str,fontOptionsList[0].defSize);
+ lf->lfHeight=(char)db_get_b(NULL,SRMMMOD,str,fontOptionsList[0].defSize);
lf->lfWidth=0;
lf->lfEscapement=0;
lf->lfOrientation=0;
mir_snprintf(str,sizeof(str),"Font%dSty",i);
- style=DBGetContactSettingByte(NULL,SRMMMOD,str,fontOptionsList[0].defStyle);
+ style=db_get_b(NULL,SRMMMOD,str,fontOptionsList[0].defStyle);
lf->lfWeight=style&FONTF_BOLD?FW_BOLD:FW_NORMAL;
lf->lfItalic=style&FONTF_ITALIC?1:0;
lf->lfUnderline=0;
lf->lfStrikeOut=0;
mir_snprintf(str,sizeof(str),"Font%dSet",i);
- lf->lfCharSet=DBGetContactSettingByte(NULL,SRMMMOD,str,MsgDlgGetFontDefaultCharset(lf->lfFaceName));
+ lf->lfCharSet=db_get_b(NULL,SRMMMOD,str,MsgDlgGetFontDefaultCharset(lf->lfFaceName));
lf->lfOutPrecision=OUT_DEFAULT_PRECIS;
lf->lfClipPrecision=CLIP_DEFAULT_PRECIS;
lf->lfQuality=DEFAULT_QUALITY;
diff --git a/plugins/SMS/src/recvdlg.cpp b/plugins/SMS/src/recvdlg.cpp index 24464c29bd..40d52cde6f 100644 --- a/plugins/SMS/src/recvdlg.cpp +++ b/plugins/SMS/src/recvdlg.cpp @@ -83,7 +83,7 @@ INT_PTR CALLBACK RecvSmsDlgProc(HWND hWndDlg,UINT message,WPARAM wParam,LPARAM l hFont=CreateFontIndirect(&lf);
SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_MESSAGE,WM_SETFONT,(WPARAM)hFont,MAKELPARAM(TRUE,0));
- COLORREF colour=DBGetContactSettingDword(NULL,SRMMMOD,SRMSGSET_BKGCOLOUR,SRMSGDEFSET_BKGCOLOUR);
+ COLORREF colour=db_get_dw(NULL,SRMMMOD,SRMSGSET_BKGCOLOUR,SRMSGDEFSET_BKGCOLOUR);
prswdWindowData->hBkgBrush=CreateSolidBrush(colour);
}
@@ -100,7 +100,7 @@ INT_PTR CALLBACK RecvSmsDlgProc(HWND hWndDlg,UINT message,WPARAM wParam,LPARAM l LoadMsgDlgFont(MSGFONTID_YOURMSG,NULL,&colour);
SetTextColor((HDC)wParam,colour);
- SetBkColor((HDC)wParam,DBGetContactSettingDword(NULL,SRMMMOD,SRMSGSET_BKGCOLOUR,SRMSGDEFSET_BKGCOLOUR));
+ SetBkColor((HDC)wParam,db_get_dw(NULL,SRMMMOD,SRMSGSET_BKGCOLOUR,SRMSGDEFSET_BKGCOLOUR));
return((BOOL)prswdWindowData->hBkgBrush);
}
break;
diff --git a/plugins/SMS/src/senddlg.cpp b/plugins/SMS/src/senddlg.cpp index 965e7fcb6e..ce85e08ecc 100644 --- a/plugins/SMS/src/senddlg.cpp +++ b/plugins/SMS/src/senddlg.cpp @@ -105,7 +105,7 @@ INT_PTR CALLBACK SendSmsDlgProc(HWND hWndDlg,UINT message,WPARAM wParam,LPARAM l hFont=CreateFontIndirect(&lf);
SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_MESSAGE,WM_SETFONT,(WPARAM)hFont,MAKELPARAM(TRUE,0));
- COLORREF colour=DBGetContactSettingDword(NULL,SRMMMOD,SRMSGSET_INPBKGCOLOUR,SRMSGDEFSET_BKGCOLOUR);
+ COLORREF colour=db_get_dw(NULL,SRMMMOD,SRMSGSET_INPBKGCOLOUR,SRMSGDEFSET_BKGCOLOUR);
psswdWindowData->hBkgBrush=CreateSolidBrush(colour);
}
{
@@ -235,7 +235,7 @@ INT_PTR CALLBACK SendSmsDlgProc(HWND hWndDlg,UINT message,WPARAM wParam,LPARAM l LoadMsgDlgFont(MSGFONTID_MESSAGEAREA,NULL,&colour);
SetTextColor((HDC)wParam,colour);
- SetBkColor((HDC)wParam,DBGetContactSettingDword(NULL,SRMMMOD,SRMSGSET_INPBKGCOLOUR,SRMSGDEFSET_BKGCOLOUR));
+ SetBkColor((HDC)wParam,db_get_dw(NULL,SRMMMOD,SRMSGSET_INPBKGCOLOUR,SRMSGDEFSET_BKGCOLOUR));
return((BOOL)psswdWindowData->hBkgBrush);
}
break;
@@ -410,8 +410,8 @@ INT_PTR CALLBACK SendSmsDlgProc(HWND hWndDlg,UINT message,WPARAM wParam,LPARAM l for(DWORD i=0;bCont;i++)
{
mir_snprintf(szBuff,SIZEOF(szBuff),"MyPhone%d",i);
- if (DBGetContactSetting(psswdWindowData->hMyContact,"UserInfo",szBuff,&dbv)) bCont=FALSE;
- DBFreeVariant(&dbv);
+ if (db_get(psswdWindowData->hMyContact,"UserInfo",szBuff,&dbv)) bCont=FALSE;
+ db_free(&dbv);
}
DB_SetStringW(psswdWindowData->hMyContact,"UserInfo",szBuff,wszPhone);
}
|