diff options
Diffstat (limited to 'plugins')
72 files changed, 1804 insertions, 2059 deletions
diff --git a/plugins/KeyboardNotify/src/keyboard.cpp b/plugins/KeyboardNotify/src/keyboard.cpp index 5a613a73f6..fba56a5d6c 100644 --- a/plugins/KeyboardNotify/src/keyboard.cpp +++ b/plugins/KeyboardNotify/src/keyboard.cpp @@ -34,17 +34,6 @@ typedef struct _KEYBOARD_INDICATOR_PARAMETERS { } KEYBOARD_INDICATOR_PARAMETERS, *PKEYBOARD_INDICATOR_PARAMETERS;
-
-void outportb(UINT portid, BYTE value)
-{
- #if !defined( _WIN64 )
- __asm mov edx,portid
- __asm mov al,value
- __asm out dx,al
- #endif
-}
-
-
BOOL OpenKeyboardDevice()
{
int i = 0;
diff --git a/plugins/QuickContacts/src/options.cpp b/plugins/QuickContacts/src/options.cpp index 519382132a..1c04ebf43b 100644 --- a/plugins/QuickContacts/src/options.cpp +++ b/plugins/QuickContacts/src/options.cpp @@ -47,16 +47,16 @@ void LoadOptions() opts.keep_subcontacts_from_offline = db_get_b(NULL, MODULE_NAME, "KeepSubcontactsFromOffline", TRUE);
}
-int InitOptionsCallback(WPARAM wParam,LPARAM lParam)
+int InitOptionsCallback(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance=hInst;
+ odp.hInstance = hInst;
odp.ptszGroup = LPGENT("Contacts");
odp.ptszTitle = LPGENT("Quick Contacts");
odp.pfnDlgProc = OptionsDlgProc;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT);
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
- Options_AddPage(wParam,&odp);
+ Options_AddPage(wParam, &odp);
return 0;
}
@@ -75,20 +75,20 @@ void DeInitOptions() // Options page
-static OptPageControl controls[] = {
- { NULL, CONTROL_CHECKBOX, IDC_LASTSENTTO, "EnableLastSentTo", (BYTE) TRUE },
- { NULL, CONTROL_RADIO, IDC_GLOBAL, "MsgTypeRec", (WORD) TYPE_GLOBAL, TYPE_GLOBAL },
- { NULL, CONTROL_RADIO, IDC_LOCAL, "MsgTypeRec", (WORD) TYPE_GLOBAL, TYPE_LOCAL },
- { NULL, CONTROL_PROTOCOL_LIST, IDC_PROTOCOLS, "ShowOffline%s", (BYTE) FALSE },
- { NULL, CONTROL_CHECKBOX, IDC_HIDE_OFFLINE, "HideOfflineFromOfflineProto", (BYTE) TRUE },
- { NULL, CONTROL_CHECKBOX, IDC_APPEND_GROUP, "AppendGroupName", (BYTE) FALSE },
- { NULL, CONTROL_CHECKBOX, IDC_GROUP_COLUMN, "GroupColumn", (BYTE) FALSE },
- { NULL, CONTROL_CHECKBOX, IDC_GROUP_LEFT, "GroupColumnLeft", (BYTE) FALSE },
- { NULL, CONTROL_CHECKBOX, IDC_SUBCONTACTS, "HideSubcontacts", (BYTE) TRUE },
- { NULL, CONTROL_CHECKBOX, IDC_KEEP_OFFLINE, "KeepSubcontactsFromOffline", (BYTE) TRUE }
+static OptPageControl controls[] = {
+ { NULL, CONTROL_CHECKBOX, IDC_LASTSENTTO, "EnableLastSentTo", (BYTE)TRUE },
+ { NULL, CONTROL_RADIO, IDC_GLOBAL, "MsgTypeRec", (WORD)TYPE_GLOBAL, TYPE_GLOBAL },
+ { NULL, CONTROL_RADIO, IDC_LOCAL, "MsgTypeRec", (WORD)TYPE_GLOBAL, TYPE_LOCAL },
+ { NULL, CONTROL_PROTOCOL_LIST, IDC_PROTOCOLS, "ShowOffline%s", (BYTE)FALSE },
+ { NULL, CONTROL_CHECKBOX, IDC_HIDE_OFFLINE, "HideOfflineFromOfflineProto", (BYTE)TRUE },
+ { NULL, CONTROL_CHECKBOX, IDC_APPEND_GROUP, "AppendGroupName", (BYTE)FALSE },
+ { NULL, CONTROL_CHECKBOX, IDC_GROUP_COLUMN, "GroupColumn", (BYTE)FALSE },
+ { NULL, CONTROL_CHECKBOX, IDC_GROUP_LEFT, "GroupColumnLeft", (BYTE)FALSE },
+ { NULL, CONTROL_CHECKBOX, IDC_SUBCONTACTS, "HideSubcontacts", (BYTE)TRUE },
+ { NULL, CONTROL_CHECKBOX, IDC_KEEP_OFFLINE, "KeepSubcontactsFromOffline", (BYTE)TRUE }
};
-static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
int ret = SaveOptsDlgProc(controls, _countof(controls), MODULE_NAME, hwndDlg, msg, wParam, lParam);
@@ -98,19 +98,19 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP BOOL enabled = IsDlgButtonChecked(hwndDlg, IDC_LASTSENTTO);
EnableWindow(GetDlgItem(hwndDlg, IDC_GLOBAL), enabled);
EnableWindow(GetDlgItem(hwndDlg, IDC_LOCAL), enabled);
-
+
enabled = IsDlgButtonChecked(hwndDlg, IDC_SUBCONTACTS);
EnableWindow(GetDlgItem(hwndDlg, IDC_KEEP_OFFLINE), enabled);
return TRUE;
}
case WM_COMMAND:
- if(LOWORD(wParam) == IDC_LASTSENTTO) {
+ if (LOWORD(wParam) == IDC_LASTSENTTO) {
BOOL enabled = IsDlgButtonChecked(hwndDlg, IDC_LASTSENTTO);
EnableWindow(GetDlgItem(hwndDlg, IDC_GLOBAL), enabled);
EnableWindow(GetDlgItem(hwndDlg, IDC_LOCAL), enabled);
}
- if(LOWORD(wParam) == IDC_SUBCONTACTS) {
+ if (LOWORD(wParam) == IDC_SUBCONTACTS) {
BOOL enabled = IsDlgButtonChecked(hwndDlg, IDC_SUBCONTACTS);
EnableWindow(GetDlgItem(hwndDlg, IDC_KEEP_OFFLINE), enabled);
}
@@ -131,4 +131,3 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP return ret;
}
-
diff --git a/plugins/QuickContacts/src/quickcontacts.cpp b/plugins/QuickContacts/src/quickcontacts.cpp index ecb7b164d8..78e63d086d 100644 --- a/plugins/QuickContacts/src/quickcontacts.cpp +++ b/plugins/QuickContacts/src/quickcontacts.cpp @@ -64,14 +64,14 @@ BOOL hasNewHotkeyModule = FALSE; // Functions ////////////////////////////////////////////////////////////////////////////
-BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
+BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
{
hInst = hinstDLL;
return TRUE;
}
-extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfo;
}
@@ -106,7 +106,7 @@ extern "C" __declspec(dllexport) int Unload(void) // Called when all the modules are loaded
-int ModulesLoaded(WPARAM wParam, LPARAM lParam)
+int ModulesLoaded(WPARAM, LPARAM)
{
InitOptions();
@@ -632,7 +632,7 @@ HHOOK hHook; // This function filters the message queue and translates
// the keyboard accelerators
-LRESULT CALLBACK HookProc(int code, WPARAM wparam, LPARAM lparam)
+LRESULT CALLBACK HookProc(int code, WPARAM, LPARAM lparam)
{
if (code!=MSGF_DIALOGBOX)
return 0;
@@ -747,7 +747,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA GetWindowRect(GetDlgItem(hwndDlg, IDC_USERNAME), &rc);
ScreenToClient(hwndDlg, &rc);
- HWND icon = CreateWindow(_T("STATIC"), _T(""), WS_CHILD | WS_VISIBLE | SS_ICON | SS_CENTERIMAGE,
+ CreateWindow(_T("STATIC"), _T(""), WS_CHILD | WS_VISIBLE | SS_ICON | SS_CENTERIMAGE,
rc.left - 20, rc.top + (rc.bottom - rc.top - 16) / 2, 16, 16, hwndDlg, (HMENU) IDC_ICO,
hInst, NULL);
@@ -1120,7 +1120,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA // Show the main dialog
-INT_PTR ShowDialog(WPARAM wParam, LPARAM lParam)
+INT_PTR ShowDialog(WPARAM, LPARAM)
{
if (!main_dialog_open)
{
diff --git a/plugins/QuickMessages/src/Utils.cpp b/plugins/QuickMessages/src/Utils.cpp index 97cba3ee70..074c7c3f30 100644 --- a/plugins/QuickMessages/src/Utils.cpp +++ b/plugins/QuickMessages/src/Utils.cpp @@ -372,7 +372,7 @@ TCHAR* getMenuEntry(int buttonnum, int entrynum, BYTE mode) return buffer; } -int RegisterCustomButton(WPARAM wParam,LPARAM lParam) +int RegisterCustomButton(WPARAM, LPARAM) { if ( !ServiceExists(MS_BB_ADDBUTTON)) return 1; @@ -397,7 +397,7 @@ int RegisterCustomButton(WPARAM wParam,LPARAM lParam) TCHAR* ParseString(MCONTACT hContact,TCHAR* ptszQValIn,TCHAR* ptszText,TCHAR* ptszClip,int QVSize,int TextSize ,int ClipSize) { - int i = 0, iOffset = 0, iCount = 0; + int i = 0, iOffset = 0; TCHAR* tempPointer = NULL; TCHAR* ptszQValue = _tcsdup(ptszQValIn); TCHAR* tempQValue = ptszQValue; diff --git a/plugins/QuickMessages/src/main.cpp b/plugins/QuickMessages/src/main.cpp index 4939789cc0..78574ebcd0 100644 --- a/plugins/QuickMessages/src/main.cpp +++ b/plugins/QuickMessages/src/main.cpp @@ -43,92 +43,86 @@ PLUGININFOEX pluginInfo = { __AUTHORWEB,
UNICODE_AWARE,
// {37ED754B-6CF9-40ED-9EB6-0FEF8E822475}
- {0x37ed754b, 0x6cf9, 0x40ed, {0x9e, 0xb6, 0xf, 0xef, 0x8e, 0x82, 0x24, 0x75}}
+ { 0x37ed754b, 0x6cf9, 0x40ed, { 0x9e, 0xb6, 0xf, 0xef, 0x8e, 0x82, 0x24, 0x75 } }
};
-int PreShutdown(WPARAM wparam,LPARAM lparam)
+int PreShutdown(WPARAM, LPARAM)
{
g_bShutDown = 1;
DestructButtonsList();
return 0;
}
-static int InputMenuPopup(WPARAM wParam,LPARAM lParam)
+static int InputMenuPopup(WPARAM, LPARAM lParam)
{
- HMENU hSubMenu=NULL;
- int i=0;
+ HMENU hSubMenu = NULL;
+ int i = 0;
MessageWindowPopupData * mwpd = (MessageWindowPopupData *)lParam;
- if(mwpd->uFlags==MSG_WINDOWPOPUP_LOG||!g_bQuickMenu||!QuickList->realCount) return 0;
+ if (mwpd->uFlags == MSG_WINDOWPOPUP_LOG || !g_bQuickMenu || !QuickList->realCount) return 0;
- if(mwpd->uType==MSG_WINDOWPOPUP_SHOWING)
- {
+ if (mwpd->uType == MSG_WINDOWPOPUP_SHOWING) {
hSubMenu = CreatePopupMenu();
- InsertMenu((HMENU)mwpd->hMenu,6,MF_STRING|MF_POPUP|MF_BYPOSITION,(UINT_PTR)hSubMenu,TranslateT("Quick Messages"));
- InsertMenu((HMENU)mwpd->hMenu,7,MF_SEPARATOR|MF_BYPOSITION,0,0);
- qsort(QuickList->items,QuickList->realCount,sizeof(QuickData *),sstQuickSortButtons);
- for(i=0;i<QuickList->realCount;i++)
- {
- QuickData* qd= (QuickData *)QuickList->items[i];
- if(qd->fEntryType&QMF_EX_SEPARATOR)
- AppendMenu(hSubMenu,MF_SEPARATOR,0,NULL);
+ InsertMenu((HMENU)mwpd->hMenu, 6, MF_STRING | MF_POPUP | MF_BYPOSITION, (UINT_PTR)hSubMenu, TranslateT("Quick Messages"));
+ InsertMenu((HMENU)mwpd->hMenu, 7, MF_SEPARATOR | MF_BYPOSITION, 0, 0);
+ qsort(QuickList->items, QuickList->realCount, sizeof(QuickData *), sstQuickSortButtons);
+ for (i = 0; i < QuickList->realCount; i++) {
+ QuickData* qd = (QuickData *)QuickList->items[i];
+ if (qd->fEntryType&QMF_EX_SEPARATOR)
+ AppendMenu(hSubMenu, MF_SEPARATOR, 0, NULL);
else
- AppendMenu(hSubMenu,MF_STRING,qd->dwPos+254,qd->ptszValueName);
+ AppendMenu(hSubMenu, MF_STRING, qd->dwPos + 254, qd->ptszValueName);
}
}
- else if(mwpd->uType==MSG_WINDOWPOPUP_SELECTED&&mwpd->selection>=254)
- {
- for(i=0;i<QuickList->realCount;i++)
- {
- QuickData* qd= (QuickData *)QuickList->items[i];
- if ((qd->dwPos+254)==mwpd->selection)
- {
+ else if (mwpd->uType == MSG_WINDOWPOPUP_SELECTED&&mwpd->selection >= 254) {
+ for (i = 0; i < QuickList->realCount; i++) {
+ QuickData* qd = (QuickData *)QuickList->items[i];
+ if ((qd->dwPos + 254) == mwpd->selection) {
CHARRANGE cr;
- UINT textlenght=0;
- TCHAR* pszText=NULL;
- TCHAR* ptszQValue=NULL;
- TCHAR* pszCBText=NULL;
- BOOL bIsService=0;
+ UINT textlenght = 0;
+ TCHAR* pszText = NULL;
+ TCHAR* ptszQValue = NULL;
+ TCHAR* pszCBText = NULL;
+ BOOL bIsService = 0;
- if(IsClipboardFormatAvailable(CF_TEXT)) {
+ if (IsClipboardFormatAvailable(CF_TEXT)) {
if (OpenClipboard(mwpd->hwnd)) {
- HANDLE hData=NULL;
- TCHAR* chBuffer=NULL;
- int textLength=0;
+ HANDLE hData = NULL;
+ TCHAR* chBuffer = NULL;
+ int textLength = 0;
- hData= GetClipboardData(CF_UNICODETEXT);
+ hData = GetClipboardData(CF_UNICODETEXT);
- chBuffer= (TCHAR*)GlobalLock(hData);
- textLength=(int)mir_tstrlen(chBuffer);
- pszCBText=mir_tstrdup(chBuffer);
+ chBuffer = (TCHAR*)GlobalLock(hData);
+ textLength = (int)mir_tstrlen(chBuffer);
+ pszCBText = mir_tstrdup(chBuffer);
GlobalUnlock(hData);
CloseClipboard();
}
}
SendMessage(mwpd->hwnd, EM_EXGETSEL, 0, (LPARAM)&cr);
- textlenght=cr.cpMax-cr.cpMin;
+ textlenght = cr.cpMax - cr.cpMin;
- if(textlenght)
- {
- pszText = (TCHAR *)mir_alloc((textlenght+10)*sizeof(TCHAR));
+ if (textlenght) {
+ pszText = (TCHAR *)mir_alloc((textlenght + 10)*sizeof(TCHAR));
memset(pszText, 0, ((textlenght + 10) * sizeof(TCHAR)));
- SendMessage(mwpd->hwnd,EM_GETSELTEXT, 0, (LPARAM)pszText);
+ SendMessage(mwpd->hwnd, EM_GETSELTEXT, 0, (LPARAM)pszText);
}
- if(qd->ptszValue){
- ptszQValue=ParseString(mwpd->hContact,qd->ptszValue,pszText?pszText:_T(""),pszCBText?pszCBText:_T(""),(int)mir_tstrlen(qd->ptszValue),textlenght,pszCBText?(int)mir_tstrlen(pszCBText):0);
- if ((bIsService=qd->bIsService)&&ptszQValue)
+ if (qd->ptszValue) {
+ ptszQValue = ParseString(mwpd->hContact, qd->ptszValue, pszText ? pszText : _T(""), pszCBText ? pszCBText : _T(""), (int)mir_tstrlen(qd->ptszValue), textlenght, pszCBText ? (int)mir_tstrlen(pszCBText) : 0);
+ if ((bIsService = qd->bIsService) && ptszQValue)
- CallService(mir_u2a(ptszQValue),(WPARAM)mwpd->hContact,0);
+ CallService(mir_u2a(ptszQValue), (WPARAM)mwpd->hContact, 0);
}
- if(ptszQValue)
+ if (ptszQValue)
SendMessage(mwpd->hwnd, EM_REPLACESEL, TRUE, (LPARAM)ptszQValue);
- if(pszText) mir_free(pszText);
- if(ptszQValue) free(ptszQValue);
- if(pszCBText) mir_free(pszCBText);
+ if (pszText) mir_free(pszText);
+ if (ptszQValue) free(ptszQValue);
+ if (pszCBText) mir_free(pszCBText);
break;
}
}
@@ -137,146 +131,134 @@ static int InputMenuPopup(WPARAM wParam,LPARAM lParam) return 0;
}
-static int CustomButtonPressed(WPARAM wParam,LPARAM lParam)
+static int CustomButtonPressed(WPARAM, LPARAM lParam)
{
- CustomButtonClickData *cbcd=(CustomButtonClickData *)lParam;
+ CustomButtonClickData *cbcd = (CustomButtonClickData *)lParam;
CHARRANGE cr;
- HWND hEdit=NULL;
- int i=0;
- BOOL bCTRL=0;
- BOOL bIsService=0;
- TCHAR* pszText=NULL;
- TCHAR* pszCBText=NULL;
- TCHAR* pszFormatedText=NULL;
- TCHAR* ptszQValue=NULL;
- int cblenght=0,qvlenght=0;
- int count=0,mode=0;
- UINT textlenght=0;
- BBButton bbd={0};
- SortedList* sl=NULL;
- int state=0;
-
- if(mir_strcmp(cbcd->pszModule,PLGNAME)) return 0;
+ HWND hEdit = NULL;
+ BOOL bCTRL = 0;
+ BOOL bIsService = 0;
+ TCHAR* pszText = NULL;
+ TCHAR* pszCBText = NULL;
+ TCHAR* ptszQValue = NULL;
+ UINT textlenght = 0;
+ SortedList* sl = NULL;
+ int state = 0;
+
+ if (mir_strcmp(cbcd->pszModule, PLGNAME)) return 0;
if (!ButtonsList[cbcd->dwButtonId]) return 1;
- sl=ButtonsList[cbcd->dwButtonId]->sl;
+ sl = ButtonsList[cbcd->dwButtonId]->sl;
if (!sl) return 1;
- if(IsClipboardFormatAvailable(CF_TEXT)) {
+ if (IsClipboardFormatAvailable(CF_TEXT)) {
if (OpenClipboard(cbcd->hwndFrom)) {
- HANDLE hData=NULL;
- TCHAR* chBuffer=NULL;
- int textLength=0;
+ HANDLE hData = NULL;
+ TCHAR* chBuffer = NULL;
+ int textLength = 0;
- hData= GetClipboardData(CF_UNICODETEXT);
+ hData = GetClipboardData(CF_UNICODETEXT);
- chBuffer= (TCHAR*)GlobalLock(hData);
- textLength=(int)mir_tstrlen(chBuffer);
- pszCBText=mir_tstrdup(chBuffer);
+ chBuffer = (TCHAR*)GlobalLock(hData);
+ textLength = (int)mir_tstrlen(chBuffer);
+ pszCBText = mir_tstrdup(chBuffer);
GlobalUnlock(hData);
CloseClipboard();
}
}
- qsort(sl->items,sl->realCount,sizeof(ButtonData *),sstSortButtons);
+ qsort(sl->items, sl->realCount, sizeof(ButtonData *), sstSortButtons);
- hEdit=GetDlgItem(cbcd->hwndFrom,IDC_MESSAGE);
- if (!hEdit) hEdit=GetDlgItem(cbcd->hwndFrom,IDC_CHATMESSAGE);
+ hEdit = GetDlgItem(cbcd->hwndFrom, IDC_MESSAGE);
+ if (!hEdit) hEdit = GetDlgItem(cbcd->hwndFrom, IDC_CHATMESSAGE);
cr.cpMin = cr.cpMax = 0;
SendMessage(hEdit, EM_EXGETSEL, 0, (LPARAM)&cr);
- textlenght=cr.cpMax-cr.cpMin;
- if(textlenght)
- {
- pszText = (TCHAR *)mir_alloc((textlenght+10)*sizeof(TCHAR));
+ textlenght = cr.cpMax - cr.cpMin;
+ if (textlenght) {
+ pszText = (TCHAR *)mir_alloc((textlenght + 10)*sizeof(TCHAR));
memset(pszText, 0, ((textlenght + 10) * sizeof(TCHAR)));
- SendMessage(hEdit,EM_GETSELTEXT, 0, (LPARAM)pszText);
+ SendMessage(hEdit, EM_GETSELTEXT, 0, (LPARAM)pszText);
}
- if(cbcd->flags&BBCF_RIGHTBUTTON)
- state=1;
- else if(sl->realCount==1)
- state=2;
+ if (cbcd->flags&BBCF_RIGHTBUTTON)
+ state = 1;
+ else if (sl->realCount == 1)
+ state = 2;
else
- state=3;
+ state = 3;
- switch(state) {
+ switch (state) {
case 1:
- if(ButtonsList[cbcd->dwButtonId]->ptszQValue)
- ptszQValue = ParseString(cbcd->hContact,ButtonsList[cbcd->dwButtonId]->ptszQValue,pszText?pszText:_T(""),pszCBText?pszCBText:_T(""),(int)mir_tstrlen(ButtonsList[cbcd->dwButtonId]->ptszQValue),textlenght,pszCBText?(int)mir_tstrlen(pszCBText):0);
+ if (ButtonsList[cbcd->dwButtonId]->ptszQValue)
+ ptszQValue = ParseString(cbcd->hContact, ButtonsList[cbcd->dwButtonId]->ptszQValue, pszText ? pszText : _T(""), pszCBText ? pszCBText : _T(""), (int)mir_tstrlen(ButtonsList[cbcd->dwButtonId]->ptszQValue), textlenght, pszCBText ? (int)mir_tstrlen(pszCBText) : 0);
if ((bIsService = ButtonsList[cbcd->dwButtonId]->bIsServName) && ptszQValue)
- CallService(mir_u2a(ptszQValue),(WPARAM)cbcd->hContact,0);
+ CallService(mir_u2a(ptszQValue), (WPARAM)cbcd->hContact, 0);
break;
case 2:
{
ButtonData *bd = (ButtonData *)sl->items[0];
- if(bd && bd->pszValue){
- ptszQValue = ParseString(cbcd->hContact,bd->pszValue,pszText?pszText:_T(""),pszCBText?pszCBText:_T(""),(int)mir_tstrlen(bd->pszValue),textlenght,pszCBText?(int)mir_tstrlen(pszCBText):0);
- if ((bIsService = bd->bIsServName)&&ptszQValue)
- CallService(mir_u2a(ptszQValue),(WPARAM)cbcd->hContact,0);
+ if (bd && bd->pszValue) {
+ ptszQValue = ParseString(cbcd->hContact, bd->pszValue, pszText ? pszText : _T(""), pszCBText ? pszCBText : _T(""), (int)mir_tstrlen(bd->pszValue), textlenght, pszCBText ? (int)mir_tstrlen(pszCBText) : 0);
+ if ((bIsService = bd->bIsServName) && ptszQValue)
+ CallService(mir_u2a(ptszQValue), (WPARAM)cbcd->hContact, 0);
}
}
break;
case 3:
- int res=0;
- int menunum;
- ButtonData * bd=NULL;
- HMENU hMenu=NULL,hSubMenu=NULL;
- BOOL bSetPopupMark=FALSE;
-
- if(g_iButtonsCount){
- hMenu = CreatePopupMenu();
- }
- else break;
- for(menunum=0;menunum<sl->realCount;menunum++)
- {
- bd=(ButtonData *)sl->items[menunum];
- if(bd->dwOPFlags&QMF_NEW)
+ if (!g_iButtonsCount)
+ break;
+
+ HMENU hMenu = CreatePopupMenu(), hSubMenu = NULL;
+
+ for (int menunum = 0; menunum < sl->realCount; menunum++) {
+ ButtonData *bd = (ButtonData *)sl->items[menunum];
+ if (bd->dwOPFlags&QMF_NEW)
continue;
- bSetPopupMark=FALSE;
- if(bd->pszValue==0&&bd->fEntryType==0)
- {
+ BOOL bSetPopupMark = FALSE;
+ if (bd->pszValue == 0 && bd->fEntryType == 0) {
hSubMenu = CreatePopupMenu();
- bSetPopupMark=TRUE;
+ bSetPopupMark = TRUE;
}
- if(bd->pszValue&&bd->fEntryType==0)
- hSubMenu=NULL;
+ if (bd->pszValue && bd->fEntryType == 0)
+ hSubMenu = NULL;
- if(bd->fEntryType&QMF_EX_SEPARATOR)
- AppendMenu((HMENU)((hSubMenu&&!bSetPopupMark)?hSubMenu:hMenu),MF_SEPARATOR,0,NULL);
+ if (bd->fEntryType&QMF_EX_SEPARATOR)
+ AppendMenu((HMENU)((hSubMenu && !bSetPopupMark) ? hSubMenu : hMenu), MF_SEPARATOR, 0, NULL);
else
- AppendMenu((HMENU)((hSubMenu&&!bSetPopupMark)?hSubMenu:hMenu),
- MF_STRING|(bSetPopupMark?MF_POPUP:0),
- (bSetPopupMark?(UINT_PTR)hSubMenu:(menunum+1)), bd->pszName);
+ AppendMenu((HMENU)((hSubMenu && !bSetPopupMark) ? hSubMenu : hMenu),
+ MF_STRING | (bSetPopupMark ? MF_POPUP : 0),
+ (bSetPopupMark ? (UINT_PTR)hSubMenu : (menunum + 1)), bd->pszName);
}
- res = TrackPopupMenu(hMenu, TPM_RETURNCMD, cbcd->pt.x, cbcd->pt.y, 0, cbcd->hwndFrom, NULL);
- if(res==0) break;
+ int res = TrackPopupMenu(hMenu, TPM_RETURNCMD, cbcd->pt.x, cbcd->pt.y, 0, cbcd->hwndFrom, NULL);
+ if (res == 0)
+ break;
- bd= (ButtonData *)sl->items[res-1];
- bCTRL=(GetKeyState(VK_CONTROL)&0x8000)?1:0;
- if(bd->pszValue){
- ptszQValue=ParseString(cbcd->hContact,bd->pszValue,pszText?pszText:_T(""),pszCBText?pszCBText:_T(""),(int)mir_tstrlen(bd->pszValue),textlenght,pszCBText?(int)mir_tstrlen(pszCBText):0);
- if ((bIsService=bd->bIsServName)&&ptszQValue)
- CallService(mir_u2a(ptszQValue),(WPARAM)cbcd->hContact,0);
+ ButtonData *bd = (ButtonData *)sl->items[res - 1];
+ bCTRL = (GetKeyState(VK_CONTROL) & 0x8000) ? 1 : 0;
+ if (bd->pszValue) {
+ ptszQValue = ParseString(cbcd->hContact, bd->pszValue, pszText ? pszText : _T(""), pszCBText ? pszCBText : _T(""), (int)mir_tstrlen(bd->pszValue), textlenght, pszCBText ? (int)mir_tstrlen(pszCBText) : 0);
+ if ((bIsService = bd->bIsServName) && ptszQValue)
+ CallService(mir_u2a(ptszQValue), (WPARAM)cbcd->hContact, 0);
}
break;
}
- if(ptszQValue) {
+ if (ptszQValue) {
if (!bIsService) {
SendMessage(hEdit, EM_REPLACESEL, TRUE, (LPARAM)ptszQValue);
- if ((g_bLClickAuto&&state!=1)||(g_bRClickAuto&&state==1)||cbcd->flags&BBCF_CONTROLPRESSED||bCTRL)
- SendMessage(cbcd->hwndFrom, WM_COMMAND,IDOK,0);
+ if ((g_bLClickAuto&&state != 1) || (g_bRClickAuto&&state == 1) || cbcd->flags&BBCF_CONTROLPRESSED || bCTRL)
+ SendMessage(cbcd->hwndFrom, WM_COMMAND, IDOK, 0);
}
free(ptszQValue);
}
@@ -287,7 +269,7 @@ static int CustomButtonPressed(WPARAM wParam,LPARAM lParam) return 1;
}
-static int PluginInit(WPARAM wparam,LPARAM lparam)
+static int PluginInit(WPARAM, LPARAM)
{
g_bStartup = 1;
HookEvent(ME_OPT_INITIALISE, OptionsInit);
@@ -295,10 +277,10 @@ static int PluginInit(WPARAM wparam,LPARAM lparam) HookEvent(ME_MSG_TOOLBARLOADED, RegisterCustomButton);
HookEvent(ME_MSG_WINDOWPOPUP, InputMenuPopup);
- g_bRClickAuto = db_get_b(NULL,PLGNAME,"RClickAuto",0);
- g_bLClickAuto = db_get_b(NULL,PLGNAME,"LClickAuto",0);
- g_iButtonsCount = db_get_b(NULL, PLGNAME,"ButtonsCount", 0);
- g_bQuickMenu = db_get_b(NULL, PLGNAME,"QuickMenu", 1);
+ g_bRClickAuto = db_get_b(NULL, PLGNAME, "RClickAuto", 0);
+ g_bLClickAuto = db_get_b(NULL, PLGNAME, "LClickAuto", 0);
+ g_iButtonsCount = db_get_b(NULL, PLGNAME, "ButtonsCount", 0);
+ g_bQuickMenu = db_get_b(NULL, PLGNAME, "QuickMenu", 1);
InitButtonsList();
@@ -306,7 +288,7 @@ static int PluginInit(WPARAM wparam,LPARAM lparam) return 0;
}
-extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfo;
}
@@ -316,7 +298,7 @@ extern "C" __declspec(dllexport) int Unload(void) return 0;
}
-BOOL WINAPI DllMain(HINSTANCE hinst, DWORD fdwReason, LPVOID lpvReserved)
+BOOL WINAPI DllMain(HINSTANCE hinst, DWORD, LPVOID)
{
hinstance = hinst;
return 1;
@@ -327,7 +309,7 @@ extern "C" __declspec(dllexport) int Load(void) mir_getLP(&pluginInfo);
mir_getCLI();
- HookEvent(ME_SYSTEM_MODULESLOADED,PluginInit);
- HookEvent(ME_SYSTEM_PRESHUTDOWN,PreShutdown);
+ HookEvent(ME_SYSTEM_MODULESLOADED, PluginInit);
+ HookEvent(ME_SYSTEM_PRESHUTDOWN, PreShutdown);
return 0;
}
diff --git a/plugins/QuickMessages/src/options.cpp b/plugins/QuickMessages/src/options.cpp index 4ed6acf0c1..6a21be954f 100644 --- a/plugins/QuickMessages/src/options.cpp +++ b/plugins/QuickMessages/src/options.cpp @@ -29,16 +29,16 @@ HWND hwndEdit = NULL; HWND g_opHdlg = NULL, g_varhelpDlg = NULL;
-INT_PTR CALLBACK HelpDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
-{
- switch(msg){
+INT_PTR CALLBACK HelpDlgProc(HWND hdlg, UINT msg, WPARAM, LPARAM lparam)
+{
+ switch (msg) {
case WM_INITDIALOG:
{
LOGFONT logFont;
HFONT hFont;
RECT rc;
- g_varhelpDlg=hdlg;
- TranslateDialogDefault(hdlg);
+ g_varhelpDlg = hdlg;
+ TranslateDialogDefault(hdlg);
hFont = (HFONT)SendDlgItemMessage(hdlg, IDC_STATICTITLE, WM_GETFONT, 0, 0);
GetObject(hFont, sizeof logFont, &logFont);
logFont.lfWeight = FW_BOLD;
@@ -53,21 +53,21 @@ INT_PTR CALLBACK HelpDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam) SendDlgItemMessage(hdlg, IDC_VARCFNAME, WM_SETFONT, (WPARAM)hFont, 0);
SendDlgItemMessage(hdlg, IDC_VARCLNAME, WM_SETFONT, (WPARAM)hFont, 0);
- GetWindowRect(g_opHdlg,&rc);
- SetWindowPos(hdlg,0,rc.left,rc.top,0,0,SWP_SHOWWINDOW|SWP_NOSIZE);
+ GetWindowRect(g_opHdlg, &rc);
+ SetWindowPos(hdlg, 0, rc.left, rc.top, 0, 0, SWP_SHOWWINDOW | SWP_NOSIZE);
}
break;
case WM_LBUTTONDOWN:
- PostMessage( hdlg,WM_NCLBUTTONDOWN, HTCAPTION,lparam);
+ PostMessage(hdlg, WM_NCLBUTTONDOWN, HTCAPTION, lparam);
break;
case WM_CLOSE:
case WM_DESTROY:
DestroyWindow(g_varhelpDlg);
- g_varhelpDlg=NULL;
+ g_varhelpDlg = NULL;
break;
-
+
default:
return FALSE;
}
@@ -79,7 +79,7 @@ static LRESULT CALLBACK LabelEditSubclassProc(HWND hwnd, UINT msg, WPARAM wParam switch (msg) {
case WM_GETDLGCODE:
return DLGC_WANTALLKEYS;
- }
+ }
return mir_callNextSubclass(hwnd, LabelEditSubclassProc, msg, wParam, lParam);
}
@@ -88,71 +88,65 @@ static LRESULT CALLBACK EditSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPA HWND hParent = GetParent(hwnd);
switch (msg) {
case WM_GETDLGCODE:
- return DLGC_WANTALLKEYS|DLGC_HASSETSEL;
-
+ return DLGC_WANTALLKEYS | DLGC_HASSETSEL;
+
case WM_SETFOCUS:
- PostMessage(hwnd,EM_SETSEL,0,-1);
+ PostMessage(hwnd, EM_SETSEL, 0, -1);
break;
-
+
case WM_KEYDOWN:
{
- if(wParam==VK_RETURN)
- if(hwnd==GetDlgItem(hParent,IDC_BUTTONNAME))
- SendMessage(hParent,WM_COMMAND,IDC_BLISTADD,0);
- else
- SendMessage(hParent,WM_COMMAND,IDC_MTREEADD,0);
+ if (wParam == VK_RETURN)
+ if (hwnd == GetDlgItem(hParent, IDC_BUTTONNAME))
+ SendMessage(hParent, WM_COMMAND, IDC_BLISTADD, 0);
+ else
+ SendMessage(hParent, WM_COMMAND, IDC_MTREEADD, 0);
}break;
- }
-
+ }
+
return mir_callNextSubclass(hwnd, EditSubclassProc, msg, wParam, lParam);
}
void SetMenuEntryProperties(HWND hdlg)
{
TVITEM tvi;
- HTREEITEM hItem=NULL;
- ButtonData* bd=NULL;
- int pos=0;
+ HTREEITEM hItem = NULL;
+ ButtonData* bd = NULL;
+ int pos = 0;
- if(TreeView_GetCount(hButtonsList)&&(tvi.hItem=TreeView_GetSelection(hButtonsList)))
- {
- tvi.mask=TVIF_HANDLE|TVIF_PARAM;
- TreeView_GetItem(hButtonsList,&tvi);
+ if (TreeView_GetCount(hButtonsList) && (tvi.hItem = TreeView_GetSelection(hButtonsList))) {
+ tvi.mask = TVIF_HANDLE | TVIF_PARAM;
+ TreeView_GetItem(hButtonsList, &tvi);
- if (tvi.lParam)
- {
- ListData* ld = ( ListData* )tvi.lParam;
+ if (tvi.lParam) {
+ ListData* ld = (ListData*)tvi.lParam;
TCHAR szValue[256];
GetDlgItemText(hdlg, IDC_RCLICKVALUE, szValue, _countof(szValue));
- if(mir_tstrlen(szValue))
- {
- if(ld->ptszOPQValue&&(ld->ptszOPQValue!=ld->ptszQValue))
+ if (mir_tstrlen(szValue)) {
+ if (ld->ptszOPQValue && (ld->ptszOPQValue != ld->ptszQValue))
mir_free(ld->ptszOPQValue);
- ld->ptszOPQValue=mir_tstrdup(szValue);
+ ld->ptszOPQValue = mir_tstrdup(szValue);
}
- ld->bIsOpServName=IsDlgButtonChecked(hdlg,IDC_ISSERVNAME2);
+ ld->bIsOpServName = IsDlgButtonChecked(hdlg, IDC_ISSERVNAME2);
}
}
- tvi.hItem=NULL;
- if(TreeView_GetCount(hMenuTree)&&(tvi.hItem=TreeView_GetSelection(hMenuTree)))
- {
- tvi.mask=TVIF_HANDLE|TVIF_PARAM;
- TreeView_GetItem(hMenuTree,&tvi);
+ tvi.hItem = NULL;
+ if (TreeView_GetCount(hMenuTree) && (tvi.hItem = TreeView_GetSelection(hMenuTree))) {
+ tvi.mask = TVIF_HANDLE | TVIF_PARAM;
+ TreeView_GetItem(hMenuTree, &tvi);
- if (tvi.lParam)
- {
- ButtonData* bd = ( ButtonData* )tvi.lParam;
+ if (tvi.lParam) {
+ ButtonData* bd = (ButtonData*)tvi.lParam;
TCHAR szValue[256];
GetDlgItemText(hdlg, IDC_MENUVALUE, szValue, _countof(szValue));
- if(mir_tstrlen(szValue))
- {
- if(mir_tstrlen(bd->pszOpValue)&&(bd->pszOpValue!=bd->pszValue))
+ if (mir_tstrlen(szValue)) {
+ if (mir_tstrlen(bd->pszOpValue) && (bd->pszOpValue != bd->pszValue))
mir_free(bd->pszOpValue);
- bd->pszOpValue=mir_tstrdup(szValue);
+ bd->pszOpValue = mir_tstrdup(szValue);
}
- bd->bOpInQMenu=IsDlgButtonChecked(hdlg,IDC_INQMENU);
- bd->bIsOpServName=IsDlgButtonChecked(hdlg,IDC_ISSERVNAME);
+ bd->bOpInQMenu = IsDlgButtonChecked(hdlg, IDC_INQMENU);
+ bd->bIsOpServName = IsDlgButtonChecked(hdlg, IDC_ISSERVNAME);
}
tvi.mask = TVIF_HANDLE | TVIF_PARAM;
@@ -160,273 +154,257 @@ void SetMenuEntryProperties(HWND hdlg) }
while (tvi.hItem) {
TreeView_GetItem(hMenuTree, &tvi);
- bd= (ButtonData*)tvi.lParam;
+ bd = (ButtonData*)tvi.lParam;
- bd->dwOPPos=pos++;
+ bd->dwOPPos = pos++;
- if(hItem=TreeView_GetChild(hMenuTree, tvi.hItem)) {
+ if (hItem = TreeView_GetChild(hMenuTree, tvi.hItem)) {
- bd->fEntryOpType&=~QMF_EX_CHILD;
+ bd->fEntryOpType &= ~QMF_EX_CHILD;
- if(bd->pszOpValue){
+ if (bd->pszOpValue) {
mir_free(bd->pszOpValue);
- bd->pszOpValue=NULL;
+ bd->pszOpValue = NULL;
}
- tvi.hItem=hItem;
+ tvi.hItem = hItem;
continue;
}
- else
- {
- if(bd->fEntryOpType&QMF_EX_SEPARATOR){
- if(bd->pszOpValue){
+ else {
+ if (bd->fEntryOpType&QMF_EX_SEPARATOR) {
+ if (bd->pszOpValue) {
mir_free(bd->pszOpValue);
- bd->pszOpValue=NULL;
- }}
- else
- {
+ bd->pszOpValue = NULL;
+ }
+ }
+ else {
if (!bd->pszOpValue)
- bd->pszOpValue=mir_tstrdup(LPGENT("Enter Value"));
+ bd->pszOpValue = mir_tstrdup(LPGENT("Enter Value"));
}
- if(TreeView_GetParent(hMenuTree, tvi.hItem))
- bd->fEntryOpType|=QMF_EX_CHILD;
- else bd->fEntryOpType&=~QMF_EX_CHILD;
+ if (TreeView_GetParent(hMenuTree, tvi.hItem))
+ bd->fEntryOpType |= QMF_EX_CHILD;
+ else bd->fEntryOpType &= ~QMF_EX_CHILD;
- if (!(hItem=TreeView_GetNextSibling(hMenuTree, tvi.hItem)))
- tvi.hItem=TreeView_GetNextSibling(hMenuTree, TreeView_GetParent(hMenuTree,tvi.hItem));
- else
- tvi.hItem=hItem;
+ if (!(hItem = TreeView_GetNextSibling(hMenuTree, tvi.hItem)))
+ tvi.hItem = TreeView_GetNextSibling(hMenuTree, TreeView_GetParent(hMenuTree, tvi.hItem));
+ else
+ tvi.hItem = hItem;
}
}
}
-void SaveMenuTree(HWND hdlg)
+void SaveMenuTree()
{
- int iBl=0,i=0,k=0;
- int iBtd=g_iButtonsCount;
- BOOL bDeleted=FALSE;
- char szMEntry[256]={'\0'};
+ int iBl = 0, i = 0, k = 0;
+ int iBtd = g_iButtonsCount;
+ BOOL bDeleted = FALSE;
+ char szMEntry[256] = { '\0' };
TCHAR strbuf[256];
- HTREEITEM hti=NULL;
+ HTREEITEM hti = NULL;
TVITEM tvi;
- g_iButtonsCount=TreeView_GetCount(hButtonsList);
+ g_iButtonsCount = TreeView_GetCount(hButtonsList);
tvi.pszText = strbuf;
tvi.cchTextMax = _countof(strbuf);
- tvi.mask=TVIF_HANDLE|TVIF_TEXT ;
- tvi.hItem=TreeView_GetRoot(hButtonsList);
+ tvi.mask = TVIF_HANDLE | TVIF_TEXT;
+ tvi.hItem = TreeView_GetRoot(hButtonsList);
- TreeView_GetItem(hButtonsList,&tvi);
+ TreeView_GetItem(hButtonsList, &tvi);
li_ZeroQuickList(QuickList);
- BalanceButtons(iBtd,g_iButtonsCount);
+ BalanceButtons(iBtd, g_iButtonsCount);
- while(ButtonsList[iBl])
- {
- SortedList * sl=NULL;
- ListData* ld=ButtonsList[iBl];
+ while (ButtonsList[iBl]) {
+ SortedList * sl = NULL;
+ ListData* ld = ButtonsList[iBl];
if (!ld->sl) break;
- sl=ld->sl;
+ sl = ld->sl;
- if(ld->dwOPFlags&QMF_DELETNEEDED)
- {
- bDeleted=(ld->dwOPFlags&QMF_NEW)?FALSE:TRUE;
- if(bDeleted) CleanSettings(ld->dwPos,-1);
+ if (ld->dwOPFlags&QMF_DELETNEEDED) {
+ bDeleted = (ld->dwOPFlags&QMF_NEW) ? FALSE : TRUE;
+ if (bDeleted) CleanSettings(ld->dwPos, -1);
DestroyButton(iBl);
continue;
}
- if(ld->ptszQValue!=ld->ptszOPQValue)
- {
- if(ld->ptszQValue)
+ if (ld->ptszQValue != ld->ptszOPQValue) {
+ if (ld->ptszQValue)
mir_free(ld->ptszQValue);
- ld->ptszQValue=(ld->ptszOPQValue)?ld->ptszOPQValue:NULL;
+ ld->ptszQValue = (ld->ptszOPQValue) ? ld->ptszOPQValue : NULL;
}
- if(ld->ptszButtonName)
+ if (ld->ptszButtonName)
mir_free(ld->ptszButtonName);
- if(iBl>0)
- if(hti=TreeView_GetNextSibling(hButtonsList,hti?hti:tvi.hItem))
- {
- tvi.hItem=hti;
- TreeView_GetItem(hButtonsList,&tvi);
+ if (iBl > 0)
+ if (hti = TreeView_GetNextSibling(hButtonsList, hti ? hti : tvi.hItem)) {
+ tvi.hItem = hti;
+ TreeView_GetItem(hButtonsList, &tvi);
}
- ld->ptszButtonName=mir_tstrdup(tvi.pszText);
+ ld->ptszButtonName = mir_tstrdup(tvi.pszText);
- if(ld->ptszQValue)
- {
- mir_snprintf(szMEntry, _countof(szMEntry), "ButtonValue_%u", iBl);
- db_set_ts(NULL, PLGNAME,szMEntry,ld->ptszQValue);
- }
-
-
- if (ServiceExists(MS_BB_MODIFYBUTTON)&&((ld->dwOPFlags&QMF_NEW)||(ld->dwOPFlags&QMF_RENAMED)||bDeleted))
- {
- BBButton bb={0};
- bb.cbSize=sizeof(BBButton);
- bb.pszModuleName=PLGNAME;
- bb.dwButtonID=iBl;
- bb.ptszTooltip=ld->ptszButtonName;
- CallService(MS_BB_MODIFYBUTTON,0,(LPARAM)&bb);
- }
+ if (ld->ptszQValue) {
+ mir_snprintf(szMEntry, _countof(szMEntry), "ButtonValue_%u", iBl);
+ db_set_ts(NULL, PLGNAME, szMEntry, ld->ptszQValue);
+ }
- mir_snprintf(szMEntry, _countof(szMEntry), "ButtonName_%u", iBl);
- db_set_ts(NULL, PLGNAME,szMEntry,ld->ptszButtonName);
+ if (ServiceExists(MS_BB_MODIFYBUTTON) && ((ld->dwOPFlags&QMF_NEW) || (ld->dwOPFlags&QMF_RENAMED) || bDeleted)) {
+ BBButton bb = { 0 };
+ bb.cbSize = sizeof(BBButton);
+ bb.pszModuleName = PLGNAME;
+ bb.dwButtonID = iBl;
+ bb.ptszTooltip = ld->ptszButtonName;
+ CallService(MS_BB_MODIFYBUTTON, 0, (LPARAM)&bb);
+ }
- ld->dwOPFlags=0;
- ld->dwPos=iBl;
- ld->bIsServName=ld->bIsOpServName;
- mir_snprintf(szMEntry, _countof(szMEntry), "RCEntryIsServiceName_%u", iBl);
- db_set_b(NULL, PLGNAME,szMEntry,ld->bIsServName);
- bDeleted=FALSE;
+ mir_snprintf(szMEntry, _countof(szMEntry), "ButtonName_%u", iBl);
+ db_set_ts(NULL, PLGNAME, szMEntry, ld->ptszButtonName);
- qsort(sl->items,sl->realCount,sizeof(ButtonData *),sstSortButtons);
+ ld->dwOPFlags = 0;
+ ld->dwPos = iBl;
+ ld->bIsServName = ld->bIsOpServName;
+ mir_snprintf(szMEntry, _countof(szMEntry), "RCEntryIsServiceName_%u", iBl);
+ db_set_b(NULL, PLGNAME, szMEntry, ld->bIsServName);
- for ( i=0; i < sl->realCount; i++ ) {
- ButtonData * bd= (ButtonData *)sl->items[i];
+ bDeleted = FALSE;
- if(bd->dwOPFlags&QMF_DELETNEEDED){
- RemoveMenuEntryNode(sl, i--);
- continue;
- }
- bd->bIsServName=bd->bIsOpServName;
- bd->bInQMenu=bd->bOpInQMenu;
- bd->dwPos=bd->dwOPPos;
- bd->fEntryType=bd->fEntryOpType;
- bd->dwOPFlags=0;
+ qsort(sl->items, sl->realCount, sizeof(ButtonData *), sstSortButtons);
- if(bd->pszName!=bd->pszOpName)
- {
- if(bd->pszName)
- mir_free(bd->pszName);
- bd->pszName=bd->pszOpName?bd->pszOpName:NULL;
- }
+ for (i = 0; i < sl->realCount; i++) {
+ ButtonData * bd = (ButtonData *)sl->items[i];
- if(bd->pszValue!=bd->pszOpValue)
- {
- if(bd->pszValue)
- mir_free(bd->pszValue);
- bd->pszValue=bd->pszOpValue?bd->pszOpValue:NULL;
- }
- if(bd->bInQMenu)
- {
- QuickData* qd = (QuickData *)mir_alloc(sizeof(QuickData));
- qd->dwPos=k++;
- qd->fEntryType=bd->fEntryType;
- qd->bIsService=bd->bIsServName;
- qd->ptszValue=bd->pszValue;
- qd->ptszValueName=bd->pszName;
- List_InsertPtr(QuickList,qd);
- }
+ if (bd->dwOPFlags&QMF_DELETNEEDED) {
+ RemoveMenuEntryNode(sl, i--);
+ continue;
+ }
+ bd->bIsServName = bd->bIsOpServName;
+ bd->bInQMenu = bd->bOpInQMenu;
+ bd->dwPos = bd->dwOPPos;
+ bd->fEntryType = bd->fEntryOpType;
+ bd->dwOPFlags = 0;
+
+ if (bd->pszName != bd->pszOpName) {
+ if (bd->pszName)
+ mir_free(bd->pszName);
+ bd->pszName = bd->pszOpName ? bd->pszOpName : NULL;
+ }
- SaveModuleSettings(iBl,bd);
+ if (bd->pszValue != bd->pszOpValue) {
+ if (bd->pszValue)
+ mir_free(bd->pszValue);
+ bd->pszValue = bd->pszOpValue ? bd->pszOpValue : NULL;
+ }
+ if (bd->bInQMenu) {
+ QuickData* qd = (QuickData *)mir_alloc(sizeof(QuickData));
+ qd->dwPos = k++;
+ qd->fEntryType = bd->fEntryType;
+ qd->bIsService = bd->bIsServName;
+ qd->ptszValue = bd->pszValue;
+ qd->ptszValueName = bd->pszName;
+ List_InsertPtr(QuickList, qd);
}
- CleanSettings(iBl,sl->realCount);
- iBl++;
+ SaveModuleSettings(iBl, bd);
+ }
+ CleanSettings(iBl, sl->realCount);
+
+ iBl++;
}
- db_set_b(NULL, PLGNAME,"ButtonsCount", (BYTE)g_iButtonsCount);
+ db_set_b(NULL, PLGNAME, "ButtonsCount", (BYTE)g_iButtonsCount);
}
-void RestoreModuleData(HWND hdlg)
+void RestoreModuleData()
{
- int iBl=0,i=0;
- char szMEntry[256]={'\0'};
- while(ButtonsList[iBl])
- {
- SortedList * sl=NULL;
- ListData* ld=ButtonsList[iBl];
+ int iBl = 0, i = 0;
- if (!(sl=ld->sl)) break;
+ while (ButtonsList[iBl]) {
+ SortedList * sl = NULL;
+ ListData* ld = ButtonsList[iBl];
- if(ld->dwOPFlags&QMF_NEW)
- {
+ if (!(sl = ld->sl)) break;
+
+ if (ld->dwOPFlags&QMF_NEW) {
DestroyButton(iBl);
continue;
}
- if(ld->ptszQValue!=ld->ptszOPQValue)
- {
- if(ld->ptszOPQValue)
+ if (ld->ptszQValue != ld->ptszOPQValue) {
+ if (ld->ptszOPQValue)
mir_free(ld->ptszOPQValue);
- ld->ptszOPQValue=(ld->ptszQValue)?ld->ptszQValue:NULL;
+ ld->ptszOPQValue = (ld->ptszQValue) ? ld->ptszQValue : NULL;
}
- ld->bIsOpServName=ld->bIsServName;
- ld->dwOPFlags=0;
+ ld->bIsOpServName = ld->bIsServName;
+ ld->dwOPFlags = 0;
- qsort(sl->items,sl->realCount,sizeof(ButtonData *),sstSortButtons);
+ qsort(sl->items, sl->realCount, sizeof(ButtonData *), sstSortButtons);
- for ( i=0; i < sl->realCount; i++ ) {
- ButtonData * bd= (ButtonData *)sl->items[i];
+ for (i = 0; i < sl->realCount; i++) {
+ ButtonData * bd = (ButtonData *)sl->items[i];
- if(bd->dwOPFlags&QMF_NEW){
+ if (bd->dwOPFlags&QMF_NEW) {
RemoveMenuEntryNode(sl, i--);
continue;
}
- bd->bIsOpServName=bd->bIsServName;
- bd->bOpInQMenu=bd->bInQMenu;
- bd->dwOPPos=bd->dwPos;
- bd->fEntryOpType=bd->fEntryType;
- bd->dwOPFlags=0;
-
- if(bd->pszName!=bd->pszOpName)
- {
- if(bd->pszOpName)
+ bd->bIsOpServName = bd->bIsServName;
+ bd->bOpInQMenu = bd->bInQMenu;
+ bd->dwOPPos = bd->dwPos;
+ bd->fEntryOpType = bd->fEntryType;
+ bd->dwOPFlags = 0;
+
+ if (bd->pszName != bd->pszOpName) {
+ if (bd->pszOpName)
mir_free(bd->pszOpName);
- bd->pszOpName=bd->pszName?bd->pszName:NULL;
+ bd->pszOpName = bd->pszName ? bd->pszName : NULL;
}
- if(bd->pszValue!=bd->pszOpValue)
- {
- if(bd->pszOpValue)
+ if (bd->pszValue != bd->pszOpValue) {
+ if (bd->pszOpValue)
mir_free(bd->pszOpValue);
- bd->pszOpValue=bd->pszValue?bd->pszValue:NULL;
+ bd->pszOpValue = bd->pszValue ? bd->pszValue : NULL;
}
}
iBl++;
}
}
-static int BuildMenuTree(HWND hToolBarTree,SortedList * sl)
+static int BuildMenuTree(HWND hToolBarTree, SortedList * sl)
{
TVINSERTSTRUCT tvis;
int i;
- HTREEITEM hParent=NULL;
+ HTREEITEM hParent = NULL;
tvis.hParent = NULL;
tvis.hInsertAfter = TVI_LAST;
tvis.item.mask = TVIF_PARAM | TVIF_TEXT;
- TreeView_DeleteAllItems( hToolBarTree );
+ TreeView_DeleteAllItems(hToolBarTree);
if (!sl) return 1;
- qsort(sl->items,sl->realCount,sizeof(ButtonData *),sstOpSortButtons);
+ qsort(sl->items, sl->realCount, sizeof(ButtonData *), sstOpSortButtons);
- for ( i=0; i < sl->realCount; i++ ) {
- ButtonData * bd= (ButtonData *)sl->items[i];
+ for (i = 0; i < sl->realCount; i++) {
+ ButtonData * bd = (ButtonData *)sl->items[i];
- if(bd->dwOPFlags&QMF_DELETNEEDED)
+ if (bd->dwOPFlags&QMF_DELETNEEDED)
continue;
- tvis.item.lParam= (LPARAM) bd;
- tvis.item.pszText= bd->pszOpName;
+ tvis.item.lParam = (LPARAM)bd;
+ tvis.item.pszText = bd->pszOpName;
- if(bd->fEntryOpType==0)
+ if (bd->fEntryOpType == 0)
tvis.hParent = NULL;
- hParent=TreeView_InsertItem( hToolBarTree, &tvis );
- if(tvis.hParent) TreeView_Expand( hMenuTree, tvis.hParent, TVE_EXPAND );
- if (!bd->pszOpValue&&bd->fEntryOpType==0)
- {
+ hParent = TreeView_InsertItem(hToolBarTree, &tvis);
+ if (tvis.hParent) TreeView_Expand(hMenuTree, tvis.hParent, TVE_EXPAND);
+ if (!bd->pszOpValue&&bd->fEntryOpType == 0) {
tvis.hParent = hParent;
}
// else if (!(bd->fEntryOpType&QMF_EX_CHILD))
@@ -439,20 +417,19 @@ static int BuildMenuTree(HWND hToolBarTree,SortedList * sl) static int BuildButtonsList(HWND hToolBarTree)
{
TVINSERTSTRUCT tvis;
- int i=0;
+ int i = 0;
tvis.hParent = NULL;
tvis.hInsertAfter = TVI_LAST;
- tvis.item.mask =TVIF_PARAM | TVIF_TEXT;
+ tvis.item.mask = TVIF_PARAM | TVIF_TEXT;
- TreeView_DeleteAllItems( hToolBarTree );
+ TreeView_DeleteAllItems(hToolBarTree);
//for(i=0;i<g_iButtonsCount;i++)
- while(ButtonsList[i])
- {
- tvis.item.lParam =(LPARAM) ButtonsList[i];
+ while (ButtonsList[i]) {
+ tvis.item.lParam = (LPARAM)ButtonsList[i];
tvis.item.pszText = ButtonsList[i]->ptszButtonName;
- TreeView_InsertItem( hToolBarTree, &tvis );
+ TreeView_InsertItem(hToolBarTree, &tvis);
i++;
}
return 1;
@@ -460,18 +437,18 @@ static int BuildButtonsList(HWND hToolBarTree) ///////////////////////////////////
//From UserInfoEx by DeathAxe
//
-void MoveItem( HTREEITEM hItem, HTREEITEM hInsertAfter, BOOLEAN bAsChild )
+void MoveItem(HTREEITEM hItem, HTREEITEM hInsertAfter, BOOLEAN bAsChild)
{
TVINSERTSTRUCT tvis;
//TCHAR strbuf[128];
HTREEITEM hParent, hChild, hNewItem;
- if ( !hItem || !hInsertAfter )
+ if (!hItem || !hInsertAfter)
return;
- if ( hItem == hInsertAfter )
+ if (hItem == hInsertAfter)
return;
- switch( ( ULONG_PTR )hInsertAfter ) {
+ switch ((ULONG_PTR)hInsertAfter) {
case TVI_ROOT:
case TVI_FIRST:
case TVI_LAST:
@@ -479,28 +456,28 @@ void MoveItem( HTREEITEM hItem, HTREEITEM hInsertAfter, BOOLEAN bAsChild ) bAsChild = FALSE;
break;
default:
- hParent = TreeView_GetParent( hMenuTree, hInsertAfter );
+ hParent = TreeView_GetParent(hMenuTree, hInsertAfter);
break;
}
// do not move a parent next to its own children!
- if ( hItem == hParent )
+ if (hItem == hParent)
return;
// prepare the insert structure
{
TCHAR strbuf[128];
- tvis.item.mask=TVIF_HANDLE|TVIF_PARAM|TVIF_TEXT;
+ tvis.item.mask = TVIF_HANDLE | TVIF_PARAM | TVIF_TEXT;
- tvis.item.pszText=strbuf;
- tvis.item.cchTextMax=_countof(strbuf);
- tvis.item.hItem=hItem;
- TreeView_GetItem(hMenuTree,&tvis.item);
+ tvis.item.pszText = strbuf;
+ tvis.item.cchTextMax = _countof(strbuf);
+ tvis.item.hItem = hItem;
+ TreeView_GetItem(hMenuTree, &tvis.item);
}
// item should be inserted as the first child of an existing root item
- if ( bAsChild ) {
+ if (bAsChild) {
tvis.hParent = hInsertAfter;
- tvis.hInsertAfter = ( bAsChild == 2 ) ? TVI_LAST : TVI_FIRST ;
+ tvis.hInsertAfter = (bAsChild == 2) ? TVI_LAST : TVI_FIRST;
}
// item should be inserted after an existing item
else {
@@ -508,170 +485,169 @@ void MoveItem( HTREEITEM hItem, HTREEITEM hInsertAfter, BOOLEAN bAsChild ) tvis.hInsertAfter = hInsertAfter;
}
// insert the item
- if ( !( hNewItem = TreeView_InsertItem( hMenuTree, &tvis )) )
+ if (!(hNewItem = TreeView_InsertItem(hMenuTree, &tvis)))
return;
// move children
hInsertAfter = hNewItem;
- while( hChild = TreeView_GetChild( hMenuTree, hItem )) {
- MoveItem( hChild, hInsertAfter, 2 );
+ while (hChild = TreeView_GetChild(hMenuTree, hItem)) {
+ MoveItem(hChild, hInsertAfter, 2);
}
// delete old tree
- TreeView_DeleteItem( hMenuTree, hItem );
+ TreeView_DeleteItem(hMenuTree, hItem);
- TreeView_SelectItem( hMenuTree, hNewItem );
+ TreeView_SelectItem(hMenuTree, hNewItem);
//TreeView_Expand( hMenuTree, hNewItem, TVE_EXPAND );
}
///////
-INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
-{
- switch(msg){
+INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam)
+{
+ switch (msg) {
case WM_INITDIALOG:{
- DWORD style;
- g_opHdlg=hdlg;
- bOptionsInit=TRUE;
- TranslateDialogDefault(hdlg);
- if(g_iButtonsCount!=db_get_b(NULL, PLGNAME,"ButtonsCount", 0))
- {
- LOGFONT logFont;
- HFONT hFont;
- bNeedRestart=TRUE;
- EnableWindow(GetDlgItem(hdlg,IDC_BUTTONSLIST),FALSE);
- EnableWindow(GetDlgItem(hdlg,IDC_BLISTADD),FALSE);
- EnableWindow(GetDlgItem(hdlg,IDC_BLISTREMOVE),FALSE);
- EnableWindow(GetDlgItem(hdlg,IDC_MENUTREE),FALSE);
- EnableWindow(GetDlgItem(hdlg,IDC_MTREEADD),FALSE);
- EnableWindow(GetDlgItem(hdlg,IDC_MTREEREMOVE),FALSE);
- EnableWindow(GetDlgItem(hdlg,IDC_MENUVALUE),FALSE);
- EnableWindow(GetDlgItem(hdlg,IDC_RCLICKVALUE),FALSE);
- EnableWindow(GetDlgItem(hdlg,IDC_BUTTONNAME),FALSE);
- EnableWindow(GetDlgItem(hdlg,IDC_INQMENU),FALSE);
- EnableWindow(GetDlgItem(hdlg,IDC_ISSERVNAME),FALSE);
- EnableWindow(GetDlgItem(hdlg,IDC_MENUNAME),FALSE);
- ShowWindow(GetDlgItem(hdlg,IDC_WARNING),SW_SHOW);
-
- hFont = (HFONT)SendDlgItemMessage(hdlg, IDC_WARNING, WM_GETFONT, 0, 0);
- GetObject(hFont, sizeof(logFont), &logFont);
- logFont.lfWeight = FW_BOLD;
- hFont = CreateFontIndirect(&logFont);
- SendDlgItemMessage(hdlg, IDC_WARNING, WM_SETFONT, (WPARAM)hFont, 0);
- break;
- }
+ DWORD style;
+ g_opHdlg = hdlg;
+ bOptionsInit = TRUE;
+ TranslateDialogDefault(hdlg);
+ if (g_iButtonsCount != db_get_b(NULL, PLGNAME, "ButtonsCount", 0)) {
+ LOGFONT logFont;
+ HFONT hFont;
+ bNeedRestart = TRUE;
+ EnableWindow(GetDlgItem(hdlg, IDC_BUTTONSLIST), FALSE);
+ EnableWindow(GetDlgItem(hdlg, IDC_BLISTADD), FALSE);
+ EnableWindow(GetDlgItem(hdlg, IDC_BLISTREMOVE), FALSE);
+ EnableWindow(GetDlgItem(hdlg, IDC_MENUTREE), FALSE);
+ EnableWindow(GetDlgItem(hdlg, IDC_MTREEADD), FALSE);
+ EnableWindow(GetDlgItem(hdlg, IDC_MTREEREMOVE), FALSE);
+ EnableWindow(GetDlgItem(hdlg, IDC_MENUVALUE), FALSE);
+ EnableWindow(GetDlgItem(hdlg, IDC_RCLICKVALUE), FALSE);
+ EnableWindow(GetDlgItem(hdlg, IDC_BUTTONNAME), FALSE);
+ EnableWindow(GetDlgItem(hdlg, IDC_INQMENU), FALSE);
+ EnableWindow(GetDlgItem(hdlg, IDC_ISSERVNAME), FALSE);
+ EnableWindow(GetDlgItem(hdlg, IDC_MENUNAME), FALSE);
+ ShowWindow(GetDlgItem(hdlg, IDC_WARNING), SW_SHOW);
+
+ hFont = (HFONT)SendDlgItemMessage(hdlg, IDC_WARNING, WM_GETFONT, 0, 0);
+ GetObject(hFont, sizeof(logFont), &logFont);
+ logFont.lfWeight = FW_BOLD;
+ hFont = CreateFontIndirect(&logFont);
+ SendDlgItemMessage(hdlg, IDC_WARNING, WM_SETFONT, (WPARAM)hFont, 0);
+ break;
+ }
- g_iOPButtonsCount=g_iButtonsCount;
+ g_iOPButtonsCount = g_iButtonsCount;
- hButtonsList=GetDlgItem(hdlg,IDC_BUTTONSLIST);
- hMenuTree=GetDlgItem(hdlg,IDC_MENUTREE);
+ hButtonsList = GetDlgItem(hdlg, IDC_BUTTONSLIST);
+ hMenuTree = GetDlgItem(hdlg, IDC_MENUTREE);
- style = GetWindowLongPtr(hButtonsList,GWL_STYLE);
- style |=TVS_NOHSCROLL;
- SetWindowLongPtr(hButtonsList,GWL_STYLE, style);
+ style = GetWindowLongPtr(hButtonsList, GWL_STYLE);
+ style |= TVS_NOHSCROLL;
+ SetWindowLongPtr(hButtonsList, GWL_STYLE, style);
- style = GetWindowLongPtr(hMenuTree,GWL_STYLE);
- style |=TVS_NOHSCROLL;
- SetWindowLongPtr(hMenuTree,GWL_STYLE, style);
- BuildButtonsList(hButtonsList);
+ style = GetWindowLongPtr(hMenuTree, GWL_STYLE);
+ style |= TVS_NOHSCROLL;
+ SetWindowLongPtr(hMenuTree, GWL_STYLE, style);
+ BuildButtonsList(hButtonsList);
- if (!TreeView_GetCount(hButtonsList))
- EnableWindow(GetDlgItem(hdlg,IDC_RCLICKVALUE),FALSE);
+ if (!TreeView_GetCount(hButtonsList))
+ EnableWindow(GetDlgItem(hdlg, IDC_RCLICKVALUE), FALSE);
- mir_subclassWindow( GetDlgItem(hdlg,IDC_BUTTONNAME), EditSubclassProc);
- mir_subclassWindow( GetDlgItem(hdlg,IDC_MENUNAME), EditSubclassProc);
+ mir_subclassWindow(GetDlgItem(hdlg, IDC_BUTTONNAME), EditSubclassProc);
+ mir_subclassWindow(GetDlgItem(hdlg, IDC_MENUNAME), EditSubclassProc);
- EnableWindow(GetDlgItem(hdlg,IDC_MENUVALUE),FALSE);
- EnableWindow(GetDlgItem(hdlg,IDC_INQMENU),FALSE);
- EnableWindow(GetDlgItem(hdlg,IDC_ISSERVNAME),FALSE);
- CheckDlgButton(hdlg,IDC_RAUTOSEND,(g_bRClickAuto=db_get_b(NULL,PLGNAME,"RClickAuto",0)) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hdlg,IDC_LAUTOSEND,(g_bLClickAuto=db_get_b(NULL,PLGNAME,"LClickAuto",0)) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hdlg,IDC_ENABLEQUICKMENU,(g_bQuickMenu=db_get_b(NULL, PLGNAME,"QuickMenu", 1)) ? BST_CHECKED : BST_UNCHECKED);
+ EnableWindow(GetDlgItem(hdlg, IDC_MENUVALUE), FALSE);
+ EnableWindow(GetDlgItem(hdlg, IDC_INQMENU), FALSE);
+ EnableWindow(GetDlgItem(hdlg, IDC_ISSERVNAME), FALSE);
+ CheckDlgButton(hdlg, IDC_RAUTOSEND, (g_bRClickAuto = db_get_b(NULL, PLGNAME, "RClickAuto", 0)) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hdlg, IDC_LAUTOSEND, (g_bLClickAuto = db_get_b(NULL, PLGNAME, "LClickAuto", 0)) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hdlg, IDC_ENABLEQUICKMENU, (g_bQuickMenu = db_get_b(NULL, PLGNAME, "QuickMenu", 1)) ? BST_CHECKED : BST_UNCHECKED);
- bOptionsInit=FALSE;
- }break;
+ bOptionsInit = FALSE;
+ }break;
case WM_LBUTTONUP:
- if(drag) {
- TVHITTESTINFO hti;
- HTREEITEM htiAfter=NULL;
- ButtonData* bd=NULL;
+ if (drag) {
+ TVHITTESTINFO hti;
+ HTREEITEM htiAfter = NULL;
+ ButtonData* bd = NULL;
TVITEM tvi;
RECT rc;
BYTE height;
BOOLEAN bAsChild = FALSE;
- TreeView_SetInsertMark(hMenuTree, NULL, 0 );
+ TreeView_SetInsertMark(hMenuTree, NULL, 0);
ReleaseCapture();
- SetCursor( LoadCursor( NULL, IDC_ARROW ));
+ SetCursor(LoadCursor(NULL, IDC_ARROW));
- hti.pt.x = ( SHORT )LOWORD( lparam );
- hti.pt.y = ( SHORT )HIWORD( lparam );
- ClientToScreen(hdlg,&hti.pt);
- ScreenToClient(hMenuTree,&hti.pt);
- TreeView_HitTest( hMenuTree, &hti );
+ hti.pt.x = (SHORT)LOWORD(lparam);
+ hti.pt.y = (SHORT)HIWORD(lparam);
+ ClientToScreen(hdlg, &hti.pt);
+ ScreenToClient(hMenuTree, &hti.pt);
+ TreeView_HitTest(hMenuTree, &hti);
- if(TreeView_GetParent(hMenuTree,hti.hItem)&&TreeView_GetChild(hMenuTree,hDragItem))
+ if (TreeView_GetParent(hMenuTree, hti.hItem) && TreeView_GetChild(hMenuTree, hDragItem))
break;
- if(TreeView_GetChild(hMenuTree,hti.hItem)&&TreeView_GetChild(hMenuTree,hDragItem))
+ if (TreeView_GetChild(hMenuTree, hti.hItem) && TreeView_GetChild(hMenuTree, hDragItem))
break;
- if ( hti.flags & TVHT_ABOVE ) {
+ if (hti.flags & TVHT_ABOVE) {
htiAfter = TVI_FIRST;
}
else
- if ( hti.flags & ( TVHT_NOWHERE|TVHT_BELOW )) {
+ if (hti.flags & (TVHT_NOWHERE | TVHT_BELOW)) {
htiAfter = TVI_LAST;
}
else
- if ( hti.flags & ( TVHT_ONITEM|TVHT_ONITEMRIGHT )) {
+ if (hti.flags & (TVHT_ONITEM | TVHT_ONITEMRIGHT)) {
// check where over the item, the pointer is
- if ( !TreeView_GetItemRect( hMenuTree, hti.hItem, &rc, FALSE )) {
- drag=0;
+ if (!TreeView_GetItemRect(hMenuTree, hti.hItem, &rc, FALSE)) {
+ drag = 0;
break;
}
- height = ( BYTE )( rc.bottom - rc.top );
+ height = (BYTE)(rc.bottom - rc.top);
- if ( hti.pt.y - ( height / 3 ) < rc.top ) {
+ if (hti.pt.y - (height / 3) < rc.top) {
HTREEITEM hItem = hti.hItem;
- if ( !( hti.hItem = TreeView_GetPrevSibling( hMenuTree, hItem )) ) {
- if ( !( hti.hItem = TreeView_GetParent(hMenuTree, hItem )))
+ if (!(hti.hItem = TreeView_GetPrevSibling(hMenuTree, hItem))) {
+ if (!(hti.hItem = TreeView_GetParent(hMenuTree, hItem)))
htiAfter = TVI_FIRST;
else
bAsChild = TRUE;
}
}
- else
- if ( hti.pt.y + ( height / 3 ) <= rc.bottom ) {
+ else
+ if (hti.pt.y + (height / 3) <= rc.bottom) {
bAsChild = TRUE;
}
- }
+ }
- if(TreeView_GetChild(hMenuTree,hDragItem)&&bAsChild)
- break;
+ if (TreeView_GetChild(hMenuTree, hDragItem) && bAsChild)
+ break;
- if(hti.hItem){
- tvi.hItem=hti.hItem;
- tvi.mask=TVIF_PARAM |TVIF_HANDLE;
- TreeView_GetItem(hMenuTree,&tvi);
- if ((bd=(ButtonData*)tvi.lParam)&&(bd->fEntryOpType&QMF_EX_SEPARATOR))
- bAsChild = FALSE;
- }
+ if (hti.hItem) {
+ tvi.hItem = hti.hItem;
+ tvi.mask = TVIF_PARAM | TVIF_HANDLE;
+ TreeView_GetItem(hMenuTree, &tvi);
+ if ((bd = (ButtonData*)tvi.lParam) && (bd->fEntryOpType&QMF_EX_SEPARATOR))
+ bAsChild = FALSE;
+ }
- if(TreeView_GetParent(hMenuTree,hti.hItem))
- bAsChild = FALSE;
+ if (TreeView_GetParent(hMenuTree, hti.hItem))
+ bAsChild = FALSE;
- MoveItem( hDragItem, htiAfter?htiAfter:hti.hItem, bAsChild );
- SendMessage(GetParent(hdlg),PSM_CHANGED,0,0);
- drag=0;
+ MoveItem(hDragItem, htiAfter ? htiAfter : hti.hItem, bAsChild);
+ SendMessage(GetParent(hdlg), PSM_CHANGED, 0, 0);
+ drag = 0;
}
- break;
+ break;
///////////////////////////////////
//From UserInfoEx by DeathAxe
@@ -682,37 +658,37 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam) {
TVHITTESTINFO hti;
- hti.pt.x=(short)LOWORD(lparam);
- hti.pt.y=(short)HIWORD(lparam);
- ClientToScreen(hdlg,&hti.pt);
- ScreenToClient(hMenuTree,&hti.pt);
- TreeView_HitTest(hMenuTree,&hti);
- if ( hti.flags & ( TVHT_ONITEM|TVHT_ONITEMRIGHT )) {
+ hti.pt.x = (short)LOWORD(lparam);
+ hti.pt.y = (short)HIWORD(lparam);
+ ClientToScreen(hdlg, &hti.pt);
+ ScreenToClient(hMenuTree, &hti.pt);
+ TreeView_HitTest(hMenuTree, &hti);
+ if (hti.flags & (TVHT_ONITEM | TVHT_ONITEMRIGHT)) {
RECT rc;
BYTE height;
- if ( TreeView_GetItemRect(hMenuTree, hti.hItem, &rc, FALSE )) {
- height = ( BYTE )( rc.bottom - rc.top );
+ if (TreeView_GetItemRect(hMenuTree, hti.hItem, &rc, FALSE)) {
+ height = (BYTE)(rc.bottom - rc.top);
- if ( hti.pt.y - ( height / 3 ) < rc.top ) {
- SetCursor( LoadCursor( NULL, IDC_ARROW ));
- TreeView_SetInsertMark( hMenuTree, hti.hItem, 0 );
+ if (hti.pt.y - (height / 3) < rc.top) {
+ SetCursor(LoadCursor(NULL, IDC_ARROW));
+ TreeView_SetInsertMark(hMenuTree, hti.hItem, 0);
}
else
- if ( hti.pt.y + ( height / 3 ) > rc.bottom ) {
- SetCursor( LoadCursor( NULL, IDC_ARROW ));
- TreeView_SetInsertMark( hMenuTree, hti.hItem, 1 );
+ if (hti.pt.y + (height / 3) > rc.bottom) {
+ SetCursor(LoadCursor(NULL, IDC_ARROW));
+ TreeView_SetInsertMark(hMenuTree, hti.hItem, 1);
}
else {
- TreeView_SetInsertMark( hMenuTree, NULL, 0 );
- SetCursor( LoadCursor( GetModuleHandle(NULL), MAKEINTRESOURCE( 183 )) );
+ TreeView_SetInsertMark(hMenuTree, NULL, 0);
+ SetCursor(LoadCursor(GetModuleHandle(NULL), MAKEINTRESOURCE(183)));
}
}
}
else {
- if ( hti.flags & TVHT_ABOVE ) SendMessage( hMenuTree, WM_VSCROLL, MAKEWPARAM( SB_LINEUP, 0 ), 0 );
- if ( hti.flags & TVHT_BELOW ) SendMessage( hMenuTree, WM_VSCROLL, MAKEWPARAM( SB_LINEDOWN, 0 ), 0 );
- TreeView_SetInsertMark( hMenuTree, NULL, 0 );
+ if (hti.flags & TVHT_ABOVE) SendMessage(hMenuTree, WM_VSCROLL, MAKEWPARAM(SB_LINEUP, 0), 0);
+ if (hti.flags & TVHT_BELOW) SendMessage(hMenuTree, WM_VSCROLL, MAKEWPARAM(SB_LINEDOWN, 0), 0);
+ TreeView_SetInsertMark(hMenuTree, NULL, 0);
}
}
}break;
@@ -720,83 +696,83 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam) case WM_DESTROY:
if (g_varhelpDlg)
DestroyWindow(g_varhelpDlg);
- g_varhelpDlg=NULL;
+ g_varhelpDlg = NULL;
break;
case WM_NOTIFY:
- switch(((LPNMHDR)lparam)->idFrom) {
+ switch (((LPNMHDR)lparam)->idFrom) {
case 0:
- if (((LPNMHDR)lparam)->code == PSN_APPLY ) {
- if (!bNeedRestart){
+ if (((LPNMHDR)lparam)->code == PSN_APPLY) {
+ if (!bNeedRestart) {
SetMenuEntryProperties(hdlg);
- SaveMenuTree(hdlg);
+ SaveMenuTree();
}
- db_set_b(NULL,PLGNAME,"RClickAuto",(BYTE)(g_bRClickAuto=IsDlgButtonChecked(hdlg,IDC_RAUTOSEND)));
- db_set_b(NULL,PLGNAME,"LClickAuto",(BYTE)(g_bLClickAuto=IsDlgButtonChecked(hdlg,IDC_LAUTOSEND)));
- db_set_b(NULL,PLGNAME,"QuickMenu",(BYTE)(g_bQuickMenu=IsDlgButtonChecked(hdlg,IDC_ENABLEQUICKMENU)));
+ db_set_b(NULL, PLGNAME, "RClickAuto", (BYTE)(g_bRClickAuto = IsDlgButtonChecked(hdlg, IDC_RAUTOSEND)));
+ db_set_b(NULL, PLGNAME, "LClickAuto", (BYTE)(g_bLClickAuto = IsDlgButtonChecked(hdlg, IDC_LAUTOSEND)));
+ db_set_b(NULL, PLGNAME, "QuickMenu", (BYTE)(g_bQuickMenu = IsDlgButtonChecked(hdlg, IDC_ENABLEQUICKMENU)));
return 1;
}
- else if (((LPNMHDR)lparam)->code == PSN_RESET ) {
+ else if (((LPNMHDR)lparam)->code == PSN_RESET) {
if (!bNeedRestart)
- RestoreModuleData(hdlg);
+ RestoreModuleData();
return 1;
}
- break;
+ break;
case IDC_MENUTREE:
- switch (((LPNMHDR)lparam)->code){
+ switch (((LPNMHDR)lparam)->code) {
case TVN_KEYDOWN:{
- TV_KEYDOWN* pTVKeyDown = (TV_KEYDOWN*) ((LPNMHDR)lparam);
- if ( pTVKeyDown->wVKey == VK_F2 )
- TreeView_EditLabel(hMenuTree,TreeView_GetSelection(hMenuTree));
- else if ( pTVKeyDown->wVKey == VK_DELETE )
- SendMessage(hdlg,WM_COMMAND,IDC_MTREEREMOVE,0);
- }break;
+ TV_KEYDOWN* pTVKeyDown = (TV_KEYDOWN*)((LPNMHDR)lparam);
+ if (pTVKeyDown->wVKey == VK_F2)
+ TreeView_EditLabel(hMenuTree, TreeView_GetSelection(hMenuTree));
+ else if (pTVKeyDown->wVKey == VK_DELETE)
+ SendMessage(hdlg, WM_COMMAND, IDC_MTREEREMOVE, 0);
+ }break;
case TVN_BEGINLABELEDIT:
- hwndEdit=TreeView_GetEditControl(hMenuTree);
+ hwndEdit = TreeView_GetEditControl(hMenuTree);
mir_subclassWindow(hwndEdit, LabelEditSubclassProc);
break;
case TVN_ENDLABELEDIT:
{
TVITEM tvi;
- ButtonData* bd=NULL;
+ ButtonData* bd = NULL;
TCHAR strbuf[256];
TCHAR szLabel[256];
tvi.pszText = strbuf;
tvi.cchTextMax = _countof(strbuf);
- tvi.mask=TVIF_TEXT |TVIF_HANDLE|TVIF_PARAM;
- tvi.hItem=TreeView_GetSelection(hMenuTree);
- TreeView_GetItem(hMenuTree,&tvi);
+ tvi.mask = TVIF_TEXT | TVIF_HANDLE | TVIF_PARAM;
+ tvi.hItem = TreeView_GetSelection(hMenuTree);
+ TreeView_GetItem(hMenuTree, &tvi);
GetWindowText(hwndEdit, szLabel, _countof(szLabel));
- hwndEdit=NULL;
+ hwndEdit = NULL;
if (!mir_tstrlen(szLabel)) break;
- if (bd = (ButtonData*)tvi.lParam){
- if (!mir_tstrcmp(szLabel,_T("---"))) {
- if(TreeView_GetChild(hMenuTree,tvi.hItem))
+ if (bd = (ButtonData*)tvi.lParam) {
+ if (!mir_tstrcmp(szLabel, _T("---"))) {
+ if (TreeView_GetChild(hMenuTree, tvi.hItem))
break;
- else{
- bd->fEntryOpType=QMF_EX_SEPARATOR;
- EnableWindow(GetDlgItem(hdlg,IDC_MENUVALUE),FALSE);
- EnableWindow(GetDlgItem(hdlg,IDC_ISSERVNAME),FALSE);
+ else {
+ bd->fEntryOpType = QMF_EX_SEPARATOR;
+ EnableWindow(GetDlgItem(hdlg, IDC_MENUVALUE), FALSE);
+ EnableWindow(GetDlgItem(hdlg, IDC_ISSERVNAME), FALSE);
SetDlgItemText(hdlg, IDC_MENUVALUE, _T(""));
}
}
else {
- bd->fEntryOpType&=~QMF_EX_SEPARATOR;
- EnableWindow(GetDlgItem(hdlg,IDC_MENUVALUE),TRUE);
- EnableWindow(GetDlgItem(hdlg,IDC_ISSERVNAME),TRUE);
+ bd->fEntryOpType &= ~QMF_EX_SEPARATOR;
+ EnableWindow(GetDlgItem(hdlg, IDC_MENUVALUE), TRUE);
+ EnableWindow(GetDlgItem(hdlg, IDC_ISSERVNAME), TRUE);
SetDlgItemText(hdlg, IDC_MENUVALUE, bd->pszOpValue/*?bd->pszOpValue:bd->pszValue*/);
}
- bd->pszOpName=mir_tstrdup(szLabel);
+ bd->pszOpName = mir_tstrdup(szLabel);
- tvi.pszText=szLabel;
+ tvi.pszText = szLabel;
TreeView_SetItem(hMenuTree, &tvi);
- SendMessage(GetParent(hdlg),PSM_CHANGED,0,0);
+ SendMessage(GetParent(hdlg), PSM_CHANGED, 0, 0);
}
}
break;
@@ -807,36 +783,35 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam) case TVN_BEGINDRAG:
SetCapture(hdlg);
- drag=1;
- hDragItem=((LPNMTREEVIEW)lparam)->itemNew.hItem;
- TreeView_SelectItem(hMenuTree,hDragItem);
+ drag = 1;
+ hDragItem = ((LPNMTREEVIEW)lparam)->itemNew.hItem;
+ TreeView_SelectItem(hMenuTree, hDragItem);
break;
case TVN_SELCHANGING:
{
HTREEITEM hti = TreeView_GetSelection(hMenuTree);
- if (hti==NULL)
+ if (hti == NULL)
break;
TVITEM tvi;
- tvi.hItem=hti;
- tvi.mask=TVIF_HANDLE|TVIF_PARAM;
- TreeView_GetItem(hMenuTree,&tvi);
+ tvi.hItem = hti;
+ tvi.mask = TVIF_HANDLE | TVIF_PARAM;
+ TreeView_GetItem(hMenuTree, &tvi);
if (tvi.lParam == 0)
break;
- ButtonData *bd = ( ButtonData* )tvi.lParam;
+ ButtonData *bd = (ButtonData*)tvi.lParam;
if (bd) {
TCHAR szValue[256];
GetDlgItemText(hdlg, IDC_MENUVALUE, szValue, _countof(szValue));
- if(mir_tstrlen(szValue))
- {
- if(bd->pszOpValue&&(bd->pszOpValue!=bd->pszValue))
+ if (mir_tstrlen(szValue)) {
+ if (bd->pszOpValue && (bd->pszOpValue != bd->pszValue))
mir_free(bd->pszOpValue);
- bd->pszOpValue=mir_tstrdup(szValue);
+ bd->pszOpValue = mir_tstrdup(szValue);
}
- bd->bOpInQMenu=IsDlgButtonChecked(hdlg,IDC_INQMENU);
- bd->bIsOpServName=IsDlgButtonChecked(hdlg,IDC_ISSERVNAME);
+ bd->bOpInQMenu = IsDlgButtonChecked(hdlg, IDC_INQMENU);
+ bd->bIsOpServName = IsDlgButtonChecked(hdlg, IDC_ISSERVNAME);
}
}
break;
@@ -848,29 +823,27 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam) break;
TVITEM tvi;
- tvi.mask=TVIF_HANDLE|TVIF_PARAM;
- tvi.hItem=hti;
- TreeView_GetItem(hMenuTree,&tvi);
+ tvi.mask = TVIF_HANDLE | TVIF_PARAM;
+ tvi.hItem = hti;
+ TreeView_GetItem(hMenuTree, &tvi);
- ButtonData *bd = ( ButtonData* )tvi.lParam;
+ ButtonData *bd = (ButtonData*)tvi.lParam;
if (bd) {
- if (!TreeView_GetChild(hMenuTree, tvi.hItem)&&!(bd->fEntryOpType&QMF_EX_SEPARATOR))
- {
- EnableWindow(GetDlgItem(hdlg,IDC_MENUVALUE),TRUE);
- EnableWindow(GetDlgItem(hdlg,IDC_ISSERVNAME),TRUE);
- EnableWindow(GetDlgItem(hdlg,IDC_INQMENU),TRUE);
+ if (!TreeView_GetChild(hMenuTree, tvi.hItem) && !(bd->fEntryOpType&QMF_EX_SEPARATOR)) {
+ EnableWindow(GetDlgItem(hdlg, IDC_MENUVALUE), TRUE);
+ EnableWindow(GetDlgItem(hdlg, IDC_ISSERVNAME), TRUE);
+ EnableWindow(GetDlgItem(hdlg, IDC_INQMENU), TRUE);
SetDlgItemText(hdlg, IDC_MENUVALUE, bd->pszOpValue/*?bd->pszOpValue:bd->pszValue*/);
}
- else
- {
- EnableWindow(GetDlgItem(hdlg,IDC_MENUVALUE),FALSE);
- EnableWindow(GetDlgItem(hdlg,IDC_ISSERVNAME),FALSE);
+ else {
+ EnableWindow(GetDlgItem(hdlg, IDC_MENUVALUE), FALSE);
+ EnableWindow(GetDlgItem(hdlg, IDC_ISSERVNAME), FALSE);
if (!(bd->fEntryOpType&QMF_EX_SEPARATOR))
- EnableWindow(GetDlgItem(hdlg,IDC_INQMENU),FALSE);
+ EnableWindow(GetDlgItem(hdlg, IDC_INQMENU), FALSE);
SetDlgItemText(hdlg, IDC_MENUVALUE, _T(""));
}
- CheckDlgButton(hdlg,IDC_INQMENU,bd->bOpInQMenu ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hdlg,IDC_ISSERVNAME,bd->bIsOpServName ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hdlg, IDC_INQMENU, bd->bOpInQMenu ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hdlg, IDC_ISSERVNAME, bd->bIsOpServName ? BST_CHECKED : BST_UNCHECKED);
}
}
}
@@ -879,12 +852,12 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam) case IDC_BUTTONSLIST:
switch (((LPNMHDR)lparam)->code) {
case TVN_KEYDOWN:{
- TV_KEYDOWN* pTVKeyDown = (TV_KEYDOWN*) ((LPNMHDR)lparam);
- if ( pTVKeyDown->wVKey == VK_F2 )
- TreeView_EditLabel(hButtonsList,TreeView_GetSelection(hButtonsList));
- else if ( pTVKeyDown->wVKey == VK_DELETE )
- SendMessage(hdlg,WM_COMMAND,IDC_BLISTREMOVE,0);
- }break;
+ TV_KEYDOWN* pTVKeyDown = (TV_KEYDOWN*)((LPNMHDR)lparam);
+ if (pTVKeyDown->wVKey == VK_F2)
+ TreeView_EditLabel(hButtonsList, TreeView_GetSelection(hButtonsList));
+ else if (pTVKeyDown->wVKey == VK_DELETE)
+ SendMessage(hdlg, WM_COMMAND, IDC_BLISTREMOVE, 0);
+ }break;
case TVN_BEGINLABELEDIT:
hwndEdit = TreeView_GetEditControl(hButtonsList);
@@ -899,19 +872,19 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam) tvi.pszText = strbuf;
tvi.cchTextMax = _countof(strbuf);
- tvi.mask=TVIF_TEXT |TVIF_HANDLE|TVIF_PARAM;
- tvi.hItem=TreeView_GetSelection(hButtonsList);
- TreeView_GetItem(hButtonsList,&tvi);
+ tvi.mask = TVIF_TEXT | TVIF_HANDLE | TVIF_PARAM;
+ tvi.hItem = TreeView_GetSelection(hButtonsList);
+ TreeView_GetItem(hButtonsList, &tvi);
GetWindowText(hwndEdit, szLabel, _countof(szLabel));
- hwndEdit=NULL;
+ hwndEdit = NULL;
if (!mir_tstrlen(szLabel)) break;
- tvi.pszText=szLabel;
- ((ListData*)tvi.lParam)->dwOPFlags|=QMF_RENAMED;
+ tvi.pszText = szLabel;
+ ((ListData*)tvi.lParam)->dwOPFlags |= QMF_RENAMED;
TreeView_SetItem(hButtonsList, &tvi);
- SendMessage(GetParent(hdlg),PSM_CHANGED,0,0);
+ SendMessage(GetParent(hdlg), PSM_CHANGED, 0, 0);
}
break;
@@ -922,30 +895,30 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam) case TVN_SELCHANGED:
{
HTREEITEM hti = TreeView_GetSelection(hButtonsList);
- if(hti==NULL||!TreeView_GetCount(hButtonsList)) {
- EnableWindow(GetDlgItem(hdlg,IDC_MENUVALUE),FALSE);
- EnableWindow(GetDlgItem(hdlg,IDC_ISSERVNAME),FALSE);
- EnableWindow(GetDlgItem(hdlg,IDC_INQMENU),FALSE);
- EnableWindow(GetDlgItem(hdlg,IDC_ISSERVNAME2),FALSE);
+ if (hti == NULL || !TreeView_GetCount(hButtonsList)) {
+ EnableWindow(GetDlgItem(hdlg, IDC_MENUVALUE), FALSE);
+ EnableWindow(GetDlgItem(hdlg, IDC_ISSERVNAME), FALSE);
+ EnableWindow(GetDlgItem(hdlg, IDC_INQMENU), FALSE);
+ EnableWindow(GetDlgItem(hdlg, IDC_ISSERVNAME2), FALSE);
SetDlgItemText(hdlg, IDC_MENUVALUE, _T(""));
break;
}
TVITEM tvi;
- tvi.mask=TVIF_HANDLE|TVIF_PARAM;
- tvi.hItem=hti;
- TreeView_GetItem(hButtonsList,&tvi);
+ tvi.mask = TVIF_HANDLE | TVIF_PARAM;
+ tvi.hItem = hti;
+ TreeView_GetItem(hButtonsList, &tvi);
- if(tvi.lParam==0) break;
+ if (tvi.lParam == 0) break;
- BuildMenuTree(hMenuTree,(SortedList *)((ListData*)tvi.lParam)->sl);
+ BuildMenuTree(hMenuTree, (SortedList *)((ListData*)tvi.lParam)->sl);
SetDlgItemText(hdlg, IDC_MENUVALUE, _T(""));
- EnableWindow(GetDlgItem(hdlg,IDC_RCLICKVALUE),TRUE);
- EnableWindow(GetDlgItem(hdlg,IDC_ISSERVNAME2),TRUE);
- CheckDlgButton(hdlg,IDC_ISSERVNAME2,((ListData*)tvi.lParam)->bIsOpServName ? BST_CHECKED : BST_UNCHECKED);
+ EnableWindow(GetDlgItem(hdlg, IDC_RCLICKVALUE), TRUE);
+ EnableWindow(GetDlgItem(hdlg, IDC_ISSERVNAME2), TRUE);
+ CheckDlgButton(hdlg, IDC_ISSERVNAME2, ((ListData*)tvi.lParam)->bIsOpServName ? BST_CHECKED : BST_UNCHECKED);
- if (((ListData*)tvi.lParam)->ptszOPQValue)
+ if (((ListData*)tvi.lParam)->ptszOPQValue)
SetDlgItemText(hdlg, IDC_RCLICKVALUE, ((ListData*)tvi.lParam)->ptszOPQValue);
else
SetDlgItemText(hdlg, IDC_RCLICKVALUE, _T(""));
@@ -957,69 +930,69 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam) break;
case WM_COMMAND:
- switch(LOWORD(wparam)) {
+ switch (LOWORD(wparam)) {
case IDC_VARHELP:
if (!g_varhelpDlg)
- g_varhelpDlg=CreateDialog(hinstance,MAKEINTRESOURCE(IDD_HELPDIALOG), 0, HelpDlgProc);
+ g_varhelpDlg = CreateDialog(hinstance, MAKEINTRESOURCE(IDD_HELPDIALOG), 0, HelpDlgProc);
else
//ShowWindow(g_varhelpDlg,SW_SHOWDEFAULT);
- SetWindowPos(g_varhelpDlg,0,0,0,0,0,SWP_SHOWWINDOW|SWP_NOMOVE|SWP_NOSIZE);
+ SetWindowPos(g_varhelpDlg, 0, 0, 0, 0, 0, SWP_SHOWWINDOW | SWP_NOMOVE | SWP_NOSIZE);
break;
case IDC_BLISTADD:
{
TVINSERTSTRUCT tvis;
- ListData* ld=NULL;
- TCHAR namebuff[MAX_PATH]={'\0'};
- int count=TreeView_GetCount(hButtonsList);
- if (count>10) break;
- if(g_iOPButtonsCount==99){
- MessageBox(NULL, TranslateT("Congratulation!\r\nYou have clicked this button 100 times!\r\nThere was access violation at this point...\r\nAnd now function for freeing resources must be called...\r\nBut no! there's only break :D"), TranslateT("You win!"),MB_OK);
+ ListData* ld = NULL;
+ TCHAR namebuff[MAX_PATH] = { '\0' };
+ int count = TreeView_GetCount(hButtonsList);
+ if (count > 10) break;
+ if (g_iOPButtonsCount == 99) {
+ MessageBox(NULL, TranslateT("Congratulation!\r\nYou have clicked this button 100 times!\r\nThere was access violation at this point...\r\nAnd now function for freeing resources must be called...\r\nBut no! there's only break :D"), TranslateT("You win!"), MB_OK);
break;
}
ld = (ListData *)mir_alloc(sizeof(ListData));
- ButtonsList[g_iOPButtonsCount++]=ld;
-
- ld->sl=List_Create(0,1);
- ld->dwOPFlags=QMF_NEW;
- ld->bIsOpServName=0;
- ld->ptszButtonName=NULL;
- ld->ptszOPQValue=NULL;
- ld->ptszQValue=NULL;
+ ButtonsList[g_iOPButtonsCount++] = ld;
+
+ ld->sl = List_Create(0, 1);
+ ld->dwOPFlags = QMF_NEW;
+ ld->bIsOpServName = 0;
+ ld->ptszButtonName = NULL;
+ ld->ptszOPQValue = NULL;
+ ld->ptszQValue = NULL;
tvis.hParent = NULL;
tvis.hInsertAfter = TVI_LAST;
GetDlgItemText(hdlg, IDC_BUTTONNAME, namebuff, _countof(namebuff));
- tvis.item.mask=TVIF_PARAM|TVIF_TEXT;
- tvis.item.pszText=(mir_tstrlen(namebuff))?namebuff:TranslateT("New Button");
- tvis.item.lParam=(LPARAM)ld;
- TreeView_SelectItem(hButtonsList,TreeView_InsertItem(hButtonsList,&tvis));
+ tvis.item.mask = TVIF_PARAM | TVIF_TEXT;
+ tvis.item.pszText = (mir_tstrlen(namebuff)) ? namebuff : TranslateT("New Button");
+ tvis.item.lParam = (LPARAM)ld;
+ TreeView_SelectItem(hButtonsList, TreeView_InsertItem(hButtonsList, &tvis));
}break;
case IDC_BLISTREMOVE:
- {
+ {
TVITEM tvi;
ListData* ld;
- if (!(tvi.hItem=TreeView_GetSelection(hButtonsList)))
+ if (!(tvi.hItem = TreeView_GetSelection(hButtonsList)))
break;
- tvi.mask=TVIF_HANDLE|TVIF_PARAM;
- TreeView_GetItem(hButtonsList,&tvi);
+ tvi.mask = TVIF_HANDLE | TVIF_PARAM;
+ TreeView_GetItem(hButtonsList, &tvi);
- ld= (ListData*)tvi.lParam;
+ ld = (ListData*)tvi.lParam;
- ld->dwOPFlags|=QMF_DELETNEEDED;
+ ld->dwOPFlags |= QMF_DELETNEEDED;
- TreeView_DeleteItem(hButtonsList,tvi.hItem);
+ TreeView_DeleteItem(hButtonsList, tvi.hItem);
if (!TreeView_GetCount(hButtonsList)) {
TreeView_DeleteAllItems(hMenuTree);
- EnableWindow(GetDlgItem(hdlg,IDC_MENUVALUE),FALSE);
- EnableWindow(GetDlgItem(hdlg,IDC_RCLICKVALUE),FALSE);
- EnableWindow(GetDlgItem(hdlg,IDC_ISSERVNAME),FALSE);
- EnableWindow(GetDlgItem(hdlg,IDC_INQMENU),FALSE);
- EnableWindow(GetDlgItem(hdlg,IDC_ISSERVNAME2),FALSE);
+ EnableWindow(GetDlgItem(hdlg, IDC_MENUVALUE), FALSE);
+ EnableWindow(GetDlgItem(hdlg, IDC_RCLICKVALUE), FALSE);
+ EnableWindow(GetDlgItem(hdlg, IDC_ISSERVNAME), FALSE);
+ EnableWindow(GetDlgItem(hdlg, IDC_INQMENU), FALSE);
+ EnableWindow(GetDlgItem(hdlg, IDC_ISSERVNAME2), FALSE);
SetDlgItemText(hdlg, IDC_MENUVALUE, _T(""));
SetDlgItemText(hdlg, IDC_RCLICKVALUE, _T(""));
}
@@ -1029,79 +1002,79 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam) {
TVINSERTSTRUCT tvis;
TVITEM tvi;
- ButtonData *bd=NULL;
- SortedList *sl=NULL;
- TCHAR namebuff[MAX_PATH]={'\0'};
+ ButtonData *bd = NULL;
+ SortedList *sl = NULL;
+ TCHAR namebuff[MAX_PATH] = { '\0' };
if (!TreeView_GetCount(hButtonsList)) break;
- if (!(tvi.hItem=TreeView_GetSelection(hButtonsList))) break;
+ if (!(tvi.hItem = TreeView_GetSelection(hButtonsList))) break;
bd = (ButtonData *)mir_alloc(sizeof(ButtonData));
- memset(bd,0,sizeof(ButtonData));
+ memset(bd, 0, sizeof(ButtonData));
GetDlgItemText(hdlg, IDC_MENUNAME, namebuff, _countof(namebuff));
- bd->dwOPPos=TreeView_GetCount(hMenuTree)-1;
- bd->pszOpName=mir_tstrlen(namebuff)?mir_tstrdup(namebuff):mir_tstrdup(TranslateT("New Menu Entry"));
- bd->pszOpValue=mir_tstrdup(bd->pszOpName);
- bd->fEntryOpType=!mir_tstrcmp(namebuff,_T("---"))?QMF_EX_SEPARATOR:0;
- bd->dwOPFlags=QMF_NEW;
- bd->pszName=NULL;
- bd->pszValue=NULL;
+ bd->dwOPPos = TreeView_GetCount(hMenuTree) - 1;
+ bd->pszOpName = mir_tstrlen(namebuff) ? mir_tstrdup(namebuff) : mir_tstrdup(TranslateT("New Menu Entry"));
+ bd->pszOpValue = mir_tstrdup(bd->pszOpName);
+ bd->fEntryOpType = !mir_tstrcmp(namebuff, _T("---")) ? QMF_EX_SEPARATOR : 0;
+ bd->dwOPFlags = QMF_NEW;
+ bd->pszName = NULL;
+ bd->pszValue = NULL;
- tvi.mask=TVIF_HANDLE|TVIF_PARAM;
+ tvi.mask = TVIF_HANDLE | TVIF_PARAM;
- TreeView_GetItem(hButtonsList,&tvi);
+ TreeView_GetItem(hButtonsList, &tvi);
- sl=((ListData*)tvi.lParam)->sl;
+ sl = ((ListData*)tvi.lParam)->sl;
- List_InsertPtr(sl,bd);
+ List_InsertPtr(sl, bd);
tvis.hParent = NULL;
tvis.hInsertAfter = TVI_LAST;
- tvis.item.mask=TVIF_PARAM|TVIF_TEXT;
- tvis.item.pszText=bd->pszOpName;
- tvis.item.lParam=(LPARAM)bd;
- TreeView_SelectItem(hMenuTree,TreeView_InsertItem(hMenuTree,&tvis));
+ tvis.item.mask = TVIF_PARAM | TVIF_TEXT;
+ tvis.item.pszText = bd->pszOpName;
+ tvis.item.lParam = (LPARAM)bd;
+ TreeView_SelectItem(hMenuTree, TreeView_InsertItem(hMenuTree, &tvis));
}break;
case IDC_MTREEREMOVE:
{
TVITEM tvi;
TVINSERTSTRUCT tvis;
- HTREEITEM hti=NULL;
- ButtonData *bd=NULL;
- tvi.mask=TVIF_HANDLE|TVIF_PARAM;
- if (!(tvi.hItem=TreeView_GetSelection(hMenuTree)))
+ HTREEITEM hti = NULL;
+ ButtonData *bd = NULL;
+ tvi.mask = TVIF_HANDLE | TVIF_PARAM;
+ if (!(tvi.hItem = TreeView_GetSelection(hMenuTree)))
break;
- TreeView_GetItem(hMenuTree,&tvi);
- hti=tvi.hItem;
+ TreeView_GetItem(hMenuTree, &tvi);
+ hti = tvi.hItem;
- bd= (ButtonData*)tvi.lParam;
- bd->dwOPFlags|=QMF_DELETNEEDED;
+ bd = (ButtonData*)tvi.lParam;
+ bd->dwOPFlags |= QMF_DELETNEEDED;
- if(tvi.hItem=TreeView_GetChild(hMenuTree,tvi.hItem)) {
+ if (tvi.hItem = TreeView_GetChild(hMenuTree, tvi.hItem)) {
TCHAR strbuf[128];
- while(tvi.hItem){
- tvis.hInsertAfter=hti;
+ while (tvi.hItem) {
+ tvis.hInsertAfter = hti;
tvi.pszText = strbuf;
tvi.cchTextMax = _countof(strbuf);
- tvi.mask=TVIF_HANDLE|TVIF_PARAM|TVIF_TEXT;
+ tvi.mask = TVIF_HANDLE | TVIF_PARAM | TVIF_TEXT;
- TreeView_GetItem(hMenuTree,&tvi);
- tvis.hParent=NULL;
- tvis.item=tvi;
- TreeView_InsertItem(hMenuTree,&tvis);
- tvi.hItem=TreeView_GetNextSibling(hMenuTree,tvi.hItem);
+ TreeView_GetItem(hMenuTree, &tvi);
+ tvis.hParent = NULL;
+ tvis.item = tvi;
+ TreeView_InsertItem(hMenuTree, &tvis);
+ tvi.hItem = TreeView_GetNextSibling(hMenuTree, tvi.hItem);
}
}
- TreeView_DeleteItem(hMenuTree,hti);
+ TreeView_DeleteItem(hMenuTree, hti);
if (!TreeView_GetCount(hMenuTree)) {
- EnableWindow(GetDlgItem(hdlg,IDC_MENUVALUE),FALSE);
- EnableWindow(GetDlgItem(hdlg,IDC_ISSERVNAME),FALSE);
- EnableWindow(GetDlgItem(hdlg,IDC_INQMENU),FALSE);
+ EnableWindow(GetDlgItem(hdlg, IDC_MENUVALUE), FALSE);
+ EnableWindow(GetDlgItem(hdlg, IDC_ISSERVNAME), FALSE);
+ EnableWindow(GetDlgItem(hdlg, IDC_INQMENU), FALSE);
SetDlgItemText(hdlg, IDC_MENUVALUE, _T(""));
}
}break;
@@ -1109,18 +1082,19 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam) break;
case WM_CLOSE:
- EndDialog(hdlg,0);
+ EndDialog(hdlg, 0);
return 0;
}
- if (HIWORD(wparam)==BN_CLICKED && GetFocus()==(HWND)lparam)
- SendMessage(GetParent(hdlg),PSM_CHANGED,0,0);
- else if ((HIWORD(wparam) == EN_CHANGE)&&(GetFocus()==(HWND)lparam))
- if (!bOptionsInit) SendMessage(GetParent(hdlg),PSM_CHANGED,0,0);
+
+ if (HIWORD(wparam) == BN_CLICKED && GetFocus() == (HWND)lparam)
+ SendMessage(GetParent(hdlg), PSM_CHANGED, 0, 0);
+ else if ((HIWORD(wparam) == EN_CHANGE) && (GetFocus() == (HWND)lparam))
+ if (!bOptionsInit) SendMessage(GetParent(hdlg), PSM_CHANGED, 0, 0);
return 0;
}
-int OptionsInit(WPARAM wparam,LPARAM lparam)
+int OptionsInit(WPARAM wparam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
odp.position = 940000000;
@@ -1130,6 +1104,6 @@ int OptionsInit(WPARAM wparam,LPARAM lparam) odp.pfnDlgProc = OptionsProc;
odp.pszGroup = LPGEN("Message sessions");
odp.flags = ODPF_BOLDGROUPS;
- Options_AddPage(wparam,&odp);
+ Options_AddPage(wparam, &odp);
return 0;
}
diff --git a/plugins/QuickReplies/src/events.cpp b/plugins/QuickReplies/src/events.cpp index 224f8cb621..6cddb3322f 100644 --- a/plugins/QuickReplies/src/events.cpp +++ b/plugins/QuickReplies/src/events.cpp @@ -34,7 +34,7 @@ INT_PTR QuickRepliesService(WPARAM, LPARAM) static IconItem icon = { LPGEN("Button"), "qr_button", IDI_QICON };
-int OnModulesLoaded(WPARAM wParam, LPARAM lParam)
+int OnModulesLoaded(WPARAM, LPARAM)
{
UnhookEvent(hOnModulesLoaded);
@@ -73,7 +73,6 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam) int OnButtonPressed(WPARAM wParam, LPARAM lParam)
{
char key[64];
- int index = 0;
int count = 0;
HMENU hMenu = NULL;
char buttonName[32];
@@ -151,7 +150,7 @@ int OnButtonPressed(WPARAM wParam, LPARAM lParam) return 1;
}
-int OnPreShutdown(WPARAM wParam, LPARAM lParam)
+int OnPreShutdown(WPARAM, LPARAM)
{
if (ServiceExists(MS_BB_REMOVEBUTTON))
{
diff --git a/plugins/QuickReplies/src/options.cpp b/plugins/QuickReplies/src/options.cpp index 9a3d9067cc..6a6f9d9417 100644 --- a/plugins/QuickReplies/src/options.cpp +++ b/plugins/QuickReplies/src/options.cpp @@ -166,7 +166,7 @@ INT_PTR CALLBACK DlgProcOptionsPage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR return FALSE;
}
-int OnOptInitialized(WPARAM wParam, LPARAM lParam)
+int OnOptInitialized(WPARAM wParam, LPARAM)
{
char tabName[32];
mir_snprintf(tabName, _countof(tabName), "%s %x", Translate("Button"), iNumber + 1);
diff --git a/plugins/QuickReplies/src/quickreplies.cpp b/plugins/QuickReplies/src/quickreplies.cpp index 7b77d8b8cb..475a30e06e 100644 --- a/plugins/QuickReplies/src/quickreplies.cpp +++ b/plugins/QuickReplies/src/quickreplies.cpp @@ -39,14 +39,13 @@ PLUGININFOEX pluginInfoEx = { {0xa6a031b6, 0xd32f, 0x4842, {0x98, 0xc6, 0xec, 0x71, 0x6c, 0x57, 0x6b, 0x77}}
};
-BOOL WINAPI DllMain(HINSTANCE hInstanceDLL, DWORD fdwReason, LPVOID lpvReserved)
+BOOL WINAPI DllMain(HINSTANCE hInstanceDLL, DWORD, LPVOID)
{
hInstance = hInstanceDLL;
-
return TRUE;
}
-extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfoEx;
}
diff --git a/plugins/Rate/src/main.cpp b/plugins/Rate/src/main.cpp index e8772dbcc0..d4e34a913e 100644 --- a/plugins/Rate/src/main.cpp +++ b/plugins/Rate/src/main.cpp @@ -55,14 +55,14 @@ PLUGININFOEX pluginInfo={ {0x45230488, 0x977b, 0x405b, {0x85, 0x6d, 0xea, 0x27, 0x6d, 0x70, 0x83, 0xb7}}
};
-BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
+BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
{
g_hInst = hinstDLL;
return TRUE;
}
// ïëàãèíèíôî
-extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfo;
}
@@ -78,10 +78,10 @@ static void setExtraIcon(MCONTACT hContact, int bRate = -1, BOOL clear = TRUE) bRate = db_get_b(hContact, "CList", "Rate", 0);
const char *icon = NULL;
- switch(bRate) {
- case 1: icon = "rate_low"; break;
- case 2: icon = "rate_medium"; break;
- case 3: icon = "rate_high"; break;
+ switch (bRate) {
+ case 1: icon = "rate_low"; break;
+ case 2: icon = "rate_medium"; break;
+ case 3: icon = "rate_high"; break;
}
if (icon != NULL || clear)
@@ -97,7 +97,7 @@ static IconItem iconList[] = { LPGEN("Rate low"), "rate_low", IDI_RATELO },
};
-int onModulesLoaded(WPARAM wParam,LPARAM lParam)
+int onModulesLoaded(WPARAM, LPARAM)
{
// Set initial value for all contacts
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
@@ -106,11 +106,11 @@ int onModulesLoaded(WPARAM wParam,LPARAM lParam) return 0;
}
-int onContactSettingChanged(WPARAM hContact,LPARAM lParam)
+int onContactSettingChanged(WPARAM hContact, LPARAM lParam)
{
- DBCONTACTWRITESETTING *cws=(DBCONTACTWRITESETTING*)lParam;
+ DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam;
- if (hContact != NULL && !mir_strcmp(cws->szModule,"CList") && !mir_strcmp(cws->szSetting,"Rate"))
+ if (hContact != NULL && !mir_strcmp(cws->szModule, "CList") && !mir_strcmp(cws->szSetting, "Rate"))
setExtraIcon(hContact, cws->value.type == DBVT_DELETED ? 0 : cws->value.bVal);
return 0;
@@ -128,10 +128,10 @@ extern "C" int __declspec(dllexport) Load(void) // Extra icon support
hExtraIcon = ExtraIcon_RegisterIcolib("contact_rate", LPGEN("Contact rate"), "rate_high");
- return 0;
+ return 0;
}
extern "C" int __declspec(dllexport) Unload(void)
{
- return 0;
+ return 0;
}
diff --git a/plugins/RecentContacts/src/RecentContacts.cpp b/plugins/RecentContacts/src/RecentContacts.cpp index f197eca6e6..e4202c77f0 100644 --- a/plugins/RecentContacts/src/RecentContacts.cpp +++ b/plugins/RecentContacts/src/RecentContacts.cpp @@ -24,7 +24,7 @@ LastUCOptions LastUCOpt = {0}; /////////////////////////////////////////////////////////////////////////////////////////
-BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
+BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
{
hInst = hinstDLL;
return TRUE;
@@ -49,7 +49,7 @@ PLUGININFOEX pluginInfo = static IconItem icon = { LPGEN("Main icon"), "recent_main", IDI_SHOWRECENT };
-extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfo;
}
@@ -389,7 +389,7 @@ INT_PTR CALLBACK ShowListMainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM return FALSE;
}
-INT_PTR OnMenuCommandShowList(WPARAM wParam, LPARAM lParam)
+INT_PTR OnMenuCommandShowList(WPARAM, LPARAM)
{
cmultimap *contacts = new cmultimap;
@@ -447,7 +447,7 @@ static int OnContactSettingChanged( WPARAM hContact, LPARAM lParam ) return 0;
}
-int Create_TopToolbarShowList(WPARAM wParam, LPARAM lParam)
+int Create_TopToolbarShowList(WPARAM, LPARAM)
{
TTBButton ttb = { 0 };
ttb.hIconHandleUp = icon.hIcolib;
@@ -482,7 +482,7 @@ BOOL SaveLastUsedTimeStamp(MCONTACT hContact) return TRUE;
}
-int OnMsgEvent(WPARAM wParam, LPARAM lParam)
+int OnMsgEvent(WPARAM, LPARAM lParam)
{
MessageWindowEventData *ed = (MessageWindowEventData *)lParam;
if (ed->hContact == NULL)
@@ -499,7 +499,7 @@ int OnMsgEvent(WPARAM wParam, LPARAM lParam) return 0;
}
-static int OnPrebuildContactMenu(WPARAM hContact, LPARAM lParam)
+static int OnPrebuildContactMenu(WPARAM hContact, LPARAM)
{
if (db_get_b(hContact, dbLastUC_ModuleName, dbLastUC_IgnoreContact, 0) == 0)
Menu_ModifyItem(hMenuItemRemove, LPGENT("Ignore Contact"));
@@ -508,7 +508,7 @@ static int OnPrebuildContactMenu(WPARAM hContact, LPARAM lParam) return 0;
}
-int OnModulesLoaded(WPARAM wParam, LPARAM lParam)
+int OnModulesLoaded(WPARAM, LPARAM)
{
HookEvent(ME_TTB_MODULELOADED, Create_TopToolbarShowList);
@@ -527,7 +527,7 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam) return 0;
}
-INT_PTR ToggleIgnore (WPARAM hContact, LPARAM lParam)
+INT_PTR ToggleIgnore (WPARAM hContact, LPARAM)
{
if (hContact != NULL) {
int state = db_get_b(hContact, dbLastUC_ModuleName, dbLastUC_IgnoreContact, 0) == 0 ? 1 : 0 ;
diff --git a/plugins/RecentContacts/src/options.cpp b/plugins/RecentContacts/src/options.cpp index d8f733a3fa..b98a34b2ea 100644 --- a/plugins/RecentContacts/src/options.cpp +++ b/plugins/RecentContacts/src/options.cpp @@ -36,8 +36,6 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP {
LPNMHDR phdr = (LPNMHDR)(lParam);
if (phdr->idFrom == 0 && phdr->code == PSN_APPLY) {
- BOOL bSuccess = FALSE;
-
LastUCOpt.HideOffline = (BOOL)IsDlgButtonChecked(hwndDlg, IDC_HIDEOFFLINE);
db_set_b(NULL, dbLastUC_ModuleName, dbLastUC_HideOfflineContacts, (BYTE)LastUCOpt.HideOffline);
@@ -60,7 +58,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP return FALSE;
}
-int onOptInitialise(WPARAM wParam, LPARAM lParam)
+int onOptInitialise(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = hInst;
diff --git a/plugins/Restart/src/restart.cpp b/plugins/Restart/src/restart.cpp index 104f3835ec..9e967e37b7 100644 --- a/plugins/Restart/src/restart.cpp +++ b/plugins/Restart/src/restart.cpp @@ -18,18 +18,18 @@ PLUGININFOEX pluginInfo={ {0x61bedf3a, 0xcc2, 0x41a3, {0xb9, 0x80, 0xbb, 0x93, 0x93, 0x36, 0x89, 0x35}}
};
-BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
+BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
{
hInst = hinstDLL;
return TRUE;
}
-extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfo;
}
-static INT_PTR RestartMe(WPARAM wParam, LPARAM lParam)
+static INT_PTR RestartMe(WPARAM, LPARAM)
{
CallService(MS_SYSTEM_RESTART, 1, 0);
return 0;
diff --git a/plugins/SeenPlugin/src/file.cpp b/plugins/SeenPlugin/src/file.cpp index fccd0ca9e6..adbea85e83 100644 --- a/plugins/SeenPlugin/src/file.cpp +++ b/plugins/SeenPlugin/src/file.cpp @@ -55,9 +55,9 @@ void UninitFileOutput() void FileWrite(MCONTACT hcontact)
{
- FILE *log = _tfopen(ParseString(g_ptszFileName, hcontact, 1), _T("a"));
+ FILE *log = _tfopen(ParseString(g_ptszFileName, hcontact), _T("a"));
if (log != NULL) {
- _fputts(ParseString(g_ptszFileStamp, hcontact, 1), log);
+ _fputts(ParseString(g_ptszFileStamp, hcontact), log);
fputs("\r\n", log);
fclose(log);
}
diff --git a/plugins/SeenPlugin/src/history.cpp b/plugins/SeenPlugin/src/history.cpp index 2c5c60c8d2..2aaea47284 100644 --- a/plugins/SeenPlugin/src/history.cpp +++ b/plugins/SeenPlugin/src/history.cpp @@ -53,10 +53,10 @@ void HistoryWrite(MCONTACT hContact) TCHAR *ptszString;
DBVARIANT dbv;
if (!db_get_ts(NULL, S_MOD, "HistoryStamp", &dbv)) {
- ptszString = ParseString(dbv.ptszVal, hContact, 0);
+ ptszString = ParseString(dbv.ptszVal, hContact);
db_free(&dbv);
}
- else ptszString = ParseString(DEFAULT_HISTORYSTAMP, hContact, 0);
+ else ptszString = ParseString(DEFAULT_HISTORYSTAMP, hContact);
db_set_ts(hContact, S_MOD, BuildSetting(historyLast), ptszString);
historyLast = (historyLast + 1) % historyMax;
@@ -152,7 +152,7 @@ HDWP MyHorizCenterWindow(HDWP hDwp, HWND hwndDlg, HWND hwndControl, }
-void MyResizeGetOffset(HWND hwndDlg, HWND hwndControl, int nWidth, int nHeight, int* nDx, int* nDy)
+void MyResizeGetOffset(HWND hwndControl, int nWidth, int nHeight, int* nDx, int* nDy)
{
RECT rcinit;
@@ -235,7 +235,7 @@ INT_PTR CALLBACK HistoryDlgProc(HWND hwndDlg, UINT Message, WPARAM wparam, LPARA CallService(MS_MSG_SENDMESSAGE, hContact, 0);
break;
case IDC_TEST:
- debug(ParseString(LPGENT("Date: %d.%m.%y(%Y) \n Date desc: %W - %w - %E - %e \n Time: %H:%M:%S (%h-%p) \n user: %n - %u \n Status: %s \n IP: %i - %r"), hContact, 0));
+ debug(ParseString(LPGENT("Date: %d.%m.%y(%Y) \n Date desc: %W - %w - %E - %e \n Time: %H:%M:%S (%h-%p) \n user: %n - %u \n Status: %s \n IP: %i - %r"), hContact));
break;
}
break;
@@ -244,7 +244,7 @@ INT_PTR CALLBACK HistoryDlgProc(HWND hwndDlg, UINT Message, WPARAM wparam, LPARA int dx, dy;
{
HDWP hDwp = BeginDeferWindowPos(6);
- MyResizeGetOffset(hwndDlg, GetDlgItem(hwndDlg, IDC_HISTORYLIST), LOWORD(lparam) - 15, HIWORD(lparam) - 99, &dx, &dy);
+ MyResizeGetOffset(GetDlgItem(hwndDlg, IDC_HISTORYLIST), LOWORD(lparam) - 15, HIWORD(lparam) - 99, &dx, &dy);
hDwp = MyResizeWindow(hDwp, hwndDlg, GetDlgItem(hwndDlg, IDC_USERMENU), dx, 0, 0, 0);
hDwp = MyResizeWindow(hDwp, hwndDlg, GetDlgItem(hwndDlg, IDC_DETAILS), dx, 0, 0, 0);
hDwp = MyResizeWindow(hDwp, hwndDlg, GetDlgItem(hwndDlg, IDC_SENDMSG), dx, 0, 0, 0);
diff --git a/plugins/SeenPlugin/src/main.cpp b/plugins/SeenPlugin/src/main.cpp index 84af665552..7403d10827 100644 --- a/plugins/SeenPlugin/src/main.cpp +++ b/plugins/SeenPlugin/src/main.cpp @@ -131,7 +131,7 @@ extern "C" __declspec(dllexport) int Unload(void) return 0;
}
-BOOL WINAPI DllMain(HINSTANCE hinst, DWORD fdwReason, LPVOID lpvReserved)
+BOOL WINAPI DllMain(HINSTANCE hinst, DWORD, LPVOID)
{
hInstance = hinst;
return 1;
diff --git a/plugins/SeenPlugin/src/menu.cpp b/plugins/SeenPlugin/src/menu.cpp index 9bd1c79b98..5d11fa4c54 100644 --- a/plugins/SeenPlugin/src/menu.cpp +++ b/plugins/SeenPlugin/src/menu.cpp @@ -28,18 +28,15 @@ void InitHistoryDialog(void); /////////////////////////////////////////////////////////////////////////////////////////
// Handles the messages sent by clicking the contact's menu item
-INT_PTR MenuitemClicked(WPARAM wparam, LPARAM)
+INT_PTR MenuitemClicked(WPARAM hContact, LPARAM)
{
- ShowHistory((MCONTACT)wparam, 0);
+ ShowHistory(hContact, 0);
return 0;
}
-int BuildContactMenu(WPARAM wparam, LPARAM)
+int BuildContactMenu(WPARAM hContact, LPARAM)
{
- int id = -1, isetting;
- MCONTACT hContact = (MCONTACT)wparam;
char *szProto = GetContactProto(hContact);
-
if (!IsWatchedProtocol(szProto) || db_get_b(hContact, szProto, "ChatRoom", false) || !db_get_b(NULL, S_MOD, "MenuItem", 1)) {
Menu_ShowItem(hmenuitem, false);
return 0;
@@ -48,9 +45,9 @@ int BuildContactMenu(WPARAM wparam, LPARAM) LPCTSTR ptszName;
ptrT tszStamp(db_get_tsa(NULL, S_MOD, "MenuStamp"));
if (tszStamp != NULL)
- ptszName = ParseString(tszStamp , (MCONTACT)wparam, 0);
+ ptszName = ParseString(tszStamp , hContact);
else
- ptszName = ParseString(DEFAULT_MENUSTAMP, (MCONTACT)wparam, 0);
+ ptszName = ParseString(DEFAULT_MENUSTAMP, hContact);
int flags = 0;
HICON hIcon = NULL;
@@ -61,7 +58,7 @@ int BuildContactMenu(WPARAM wparam, LPARAM) flags |= CMIF_HIDDEN;
}
else if (db_get_b(NULL, S_MOD, "ShowIcon", 1)) {
- isetting = db_get_w(hContact, S_MOD, "StatusTriger", -1);
+ int isetting = db_get_w(hContact, S_MOD, "StatusTriger", -1);
hIcon = Skin_LoadProtoIcon(szProto, isetting | 0x8000);
}
Menu_ModifyItem(hmenuitem, ptszName, hIcon, flags);
diff --git a/plugins/SeenPlugin/src/options.cpp b/plugins/SeenPlugin/src/options.cpp index 4d1db993c4..e704a9f8c2 100644 --- a/plugins/SeenPlugin/src/options.cpp +++ b/plugins/SeenPlugin/src/options.cpp @@ -93,10 +93,10 @@ INT_PTR CALLBACK OptsPopupsDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lp ppd.lchIcon = Skin_LoadProtoIcon(NULL, idBack);
GetDlgItemText(hdlg, IDC_POPUPSTAMP, szstamp, _countof(szstamp));
- _tcsncpy(ppd.lptzContactName, ParseString(szstamp, NULL, 0), MAX_CONTACTNAME);
+ _tcsncpy(ppd.lptzContactName, ParseString(szstamp, NULL), MAX_CONTACTNAME);
GetDlgItemText(hdlg, IDC_POPUPSTAMPTEXT, szstamp, _countof(szstamp));
- _tcsncpy(ppd.lptzText, ParseString(szstamp, NULL, 0), MAX_SECONDLINE);
+ _tcsncpy(ppd.lptzText, ParseString(szstamp, NULL), MAX_SECONDLINE);
PUAddPopupT(&ppd);
SendMessage(GetParent(hdlg), PSM_CHANGED, 0, 0);
diff --git a/plugins/SeenPlugin/src/stdafx.h b/plugins/SeenPlugin/src/stdafx.h index 4b703c9eb2..09aac51737 100644 --- a/plugins/SeenPlugin/src/stdafx.h +++ b/plugins/SeenPlugin/src/stdafx.h @@ -93,7 +93,7 @@ typedef struct{ } MISSEDCONTACTS;
int IsWatchedProtocol(const char* szProto);
-TCHAR *ParseString(TCHAR*, MCONTACT, BYTE);
+TCHAR *ParseString(TCHAR*, MCONTACT);
void GetColorsFromDWord(LPCOLORREF First, LPCOLORREF Second, DWORD colDword);
DWORD GetDWordFromColors(COLORREF First, COLORREF Second);
int OptionsInit(WPARAM,LPARAM);
diff --git a/plugins/SeenPlugin/src/userinfo.cpp b/plugins/SeenPlugin/src/userinfo.cpp index dc94193927..25844a0435 100644 --- a/plugins/SeenPlugin/src/userinfo.cpp +++ b/plugins/SeenPlugin/src/userinfo.cpp @@ -42,7 +42,7 @@ INT_PTR CALLBACK UserinfoDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lpar case WM_REFRESH_UI:
{
ptrT szout(db_get_tsa(NULL, S_MOD, "UserStamp"));
- TCHAR *str = ParseString((szout != NULL) ? szout : DEFAULT_USERSTAMP, wparam, 0);
+ TCHAR *str = ParseString((szout != NULL) ? szout : DEFAULT_USERSTAMP, wparam);
SetDlgItemText(hdlg, IDC_INFOTEXT, str);
if (!mir_tstrcmp(str, TranslateT("<unknown>")))
diff --git a/plugins/SeenPlugin/src/utils.cpp b/plugins/SeenPlugin/src/utils.cpp index e57c451cd4..a1f5e80995 100644 --- a/plugins/SeenPlugin/src/utils.cpp +++ b/plugins/SeenPlugin/src/utils.cpp @@ -146,7 +146,7 @@ TCHAR *wdays_short[] = { LPGENT("Sun."), LPGENT("Mon."), LPGENT("Tue."), LPGENT( TCHAR *monthnames[] = { LPGENT("January"), LPGENT("February"), LPGENT("March"), LPGENT("April"), LPGENT("May"), LPGENT("June"), LPGENT("July"), LPGENT("August"), LPGENT("September"), LPGENT("October"), LPGENT("November"), LPGENT("December") };
TCHAR *mnames_short[] = { LPGENT("Jan."), LPGENT("Feb."), LPGENT("Mar."), LPGENT("Apr."), LPGENT("May"), LPGENT("Jun."), LPGENT("Jul."), LPGENT("Aug."), LPGENT("Sep."), LPGENT("Oct."), LPGENT("Nov."), LPGENT("Dec.") };
-TCHAR *ParseString(TCHAR *szstring, MCONTACT hcontact, BYTE isfile)
+TCHAR* ParseString(TCHAR *szstring, MCONTACT hcontact)
{
#define MAXSIZE 1024
static TCHAR sztemp[MAXSIZE + 1];
@@ -496,16 +496,16 @@ void ShowPopup(MCONTACT hcontact, const char * lpzProto, int newStatus) ppd.lchIcon = Skin_LoadProtoIcon(lpzProto, newStatus);
if (!db_get_ts(NULL, S_MOD, "PopupStamp", &dbv)) {
- _tcsncpy(ppd.lptzContactName, ParseString(dbv.ptszVal, hcontact, 0), MAX_CONTACTNAME);
+ _tcsncpy(ppd.lptzContactName, ParseString(dbv.ptszVal, hcontact), MAX_CONTACTNAME);
db_free(&dbv);
}
- else _tcsncpy(ppd.lptzContactName, ParseString(DEFAULT_POPUPSTAMP, hcontact, 0), MAX_CONTACTNAME);
+ else _tcsncpy(ppd.lptzContactName, ParseString(DEFAULT_POPUPSTAMP, hcontact), MAX_CONTACTNAME);
if (!db_get_ts(NULL, S_MOD, "PopupStampText", &dbv)) {
- _tcsncpy(ppd.lptzText, ParseString(dbv.ptszVal, hcontact, 0), MAX_SECONDLINE);
+ _tcsncpy(ppd.lptzText, ParseString(dbv.ptszVal, hcontact), MAX_SECONDLINE);
db_free(&dbv);
}
- else _tcsncpy(ppd.lptzText, ParseString(DEFAULT_POPUPSTAMPTEXT, hcontact, 0), MAX_SECONDLINE);
+ else _tcsncpy(ppd.lptzText, ParseString(DEFAULT_POPUPSTAMPTEXT, hcontact), MAX_SECONDLINE);
ppd.PluginWindowProc = PopupDlgProc;
PUAddPopupT(&ppd);
}
@@ -678,7 +678,7 @@ static void cleanThread(void *param) mir_free(infoParam);
}
-int ModeChange(WPARAM wparam, LPARAM lparam)
+int ModeChange(WPARAM, LPARAM lparam)
{
ACKDATA *ack = (ACKDATA *)lparam;
diff --git a/plugins/SimpleAR/src/Main.cpp b/plugins/SimpleAR/src/Main.cpp index 569eff1d9f..6ef08d12dd 100644 --- a/plugins/SimpleAR/src/Main.cpp +++ b/plugins/SimpleAR/src/Main.cpp @@ -24,7 +24,7 @@ BOOL gbVarsServiceExist = FALSE; INT interval;
int hLangpack;
-TCHAR* ptszDefaultMsg[]={
+TCHAR* ptszDefaultMsg[] = {
TranslateT("I am currently away. I will reply to you when I am back."),
TranslateT("I am currently very busy and can't spare any time to talk with you. Sorry..."),
TranslateT("I am not available right now."),
@@ -34,7 +34,7 @@ TCHAR* ptszDefaultMsg[]={ };
PLUGININFOEX pluginInfoEx = {
- sizeof(PLUGININFOEX),
+ sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
__DESCRIPTION,
@@ -44,21 +44,21 @@ PLUGININFOEX pluginInfoEx = { __AUTHORWEB,
UNICODE_AWARE,
// {46BF191F-8DFB-4656-88B2-4C20BE4CFA44}
- {0x46bf191f, 0x8dfb, 0x4656, {0x88, 0xb2, 0x4c, 0x20, 0xbe, 0x4c, 0xfa, 0x44}}
+ { 0x46bf191f, 0x8dfb, 0x4656, { 0x88, 0xb2, 0x4c, 0x20, 0xbe, 0x4c, 0xfa, 0x44 } }
};
-extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfoEx;
}
-BOOL WINAPI DllMain(HINSTANCE hinst, DWORD fdwReason, LPVOID lpvReserved)
+BOOL WINAPI DllMain(HINSTANCE hinst, DWORD, LPVOID)
{
hinstance = hinst;
return TRUE;
}
-INT_PTR ToggleEnable(WPARAM wParam, LPARAM lParam)
+INT_PTR ToggleEnable(WPARAM, LPARAM)
{
BOOL fEnabled = !db_get_b(NULL, protocolname, KEY_ENABLED, 1);
db_set_b(NULL, protocolname, KEY_ENABLED, fEnabled);
@@ -70,26 +70,23 @@ INT_PTR ToggleEnable(WPARAM wParam, LPARAM lParam) return 0;
}
-INT_PTR Toggle(WPARAM w, LPARAM l)
+INT_PTR Toggle(WPARAM hContact, LPARAM)
{
- MCONTACT hContact = (MCONTACT)w;
BOOL on = !db_get_b(hContact, protocolname, "TurnedOn", 0);
db_set_b(hContact, protocolname, "TurnedOn", on);
on = !on;
- if (on)
+ if (on)
Menu_ModifyItem(hToggle, LPGENT("Turn off Autoanswer"), iconList[0].hIcolib);
else
Menu_ModifyItem(hToggle, LPGENT("Turn on Autoanswer"), iconList[1].hIcolib);
return 0;
}
-INT OnPreBuildContactMenu(WPARAM w, LPARAM l)
+INT OnPreBuildContactMenu(WPARAM hContact, LPARAM)
{
- MCONTACT hContact = (MCONTACT)w;
-
BOOL on = !db_get_b(hContact, protocolname, "TurnedOn", 0);
- if (on)
+ if (on)
Menu_ModifyItem(hToggle, LPGENT("Turn off Autoanswer"), iconList[0].hIcolib);
else
Menu_ModifyItem(hToggle, LPGENT("Turn on Autoanswer"), iconList[1].hIcolib);
@@ -100,32 +97,29 @@ INT CheckDefaults(WPARAM, LPARAM) {
DBVARIANT dbv;
TCHAR *ptszDefault;
- char szStatus[6]={0};
+ char szStatus[6] = { 0 };
- interval=db_get_w(NULL,protocolname,KEY_REPEATINTERVAL,300);
+ interval = db_get_w(NULL, protocolname, KEY_REPEATINTERVAL, 300);
- if (db_get_ts(NULL,protocolname,KEY_HEADING,&dbv))
+ if (db_get_ts(NULL, protocolname, KEY_HEADING, &dbv))
// Heading not set
- db_set_ts(NULL,protocolname,KEY_HEADING,TranslateT("Dear %user%, the owner left the following message:"));
+ db_set_ts(NULL, protocolname, KEY_HEADING, TranslateT("Dear %user%, the owner left the following message:"));
else
db_free(&dbv);
- for (int c=ID_STATUS_ONLINE; c<ID_STATUS_IDLE; c++)
- {
- mir_snprintf(szStatus,_countof(szStatus),"%d",c);
+ for (int c = ID_STATUS_ONLINE; c < ID_STATUS_IDLE; c++) {
+ mir_snprintf(szStatus, _countof(szStatus), "%d", c);
if (c == ID_STATUS_ONLINE || c == ID_STATUS_FREECHAT || c == ID_STATUS_INVISIBLE)
continue;
- else
- {
- if (db_get_ts(NULL,protocolname,szStatus,&dbv))
- {
+ else {
+ if (db_get_ts(NULL, protocolname, szStatus, &dbv)) {
if (c < ID_STATUS_FREECHAT)
// This mode does not have a preset message
- ptszDefault=ptszDefaultMsg[c-ID_STATUS_ONLINE-1];
- else if(c > ID_STATUS_INVISIBLE)
- ptszDefault=ptszDefaultMsg[c-ID_STATUS_ONLINE-3];
+ ptszDefault = ptszDefaultMsg[c - ID_STATUS_ONLINE - 1];
+ else if (c > ID_STATUS_INVISIBLE)
+ ptszDefault = ptszDefaultMsg[c - ID_STATUS_ONLINE - 3];
if (ptszDefault)
- db_set_ts(NULL,protocolname,szStatus,ptszDefault);
+ db_set_ts(NULL, protocolname, szStatus, ptszDefault);
}
else
db_free(&dbv);
@@ -154,68 +148,58 @@ INT addEvent(WPARAM hContact, LPARAM hDBEvent) if (status == ID_STATUS_ONLINE || status == ID_STATUS_FREECHAT || status == ID_STATUS_INVISIBLE)
return FALSE;
- DBEVENTINFO dbei = {sizeof(dbei)};
+ DBEVENTINFO dbei = { sizeof(dbei) };
db_event_get(hDBEvent, &dbei); /// detect size of msg
if ((dbei.eventType != EVENTTYPE_MESSAGE) || (dbei.flags == DBEF_READ))
return FALSE; /// we need EVENTTYPE_MESSAGE event..
- else
- { /// needed event has occured..
+ else { /// needed event has occured..
DBVARIANT dbv;
if (!dbei.cbBlob) /// invalid size
return FALSE;
- if (db_get_ts(hContact,"Protocol","p",&dbv))
- // Contact with no protocol ?!!
+ if (db_get_ts(hContact, "Protocol", "p", &dbv)) // Contact with no protocol ?!!
return FALSE;
- else
- db_free(&dbv);
+ db_free(&dbv);
- if(db_get_b(hContact, "CList", "NotOnList", 0))
+ if (db_get_b(hContact, "CList", "NotOnList", 0))
return FALSE;
- if(db_get_b(hContact, protocolname, "TurnedOn", 0))
+ if (db_get_b(hContact, protocolname, "TurnedOn", 0))
return FALSE;
- if (!( dbei.flags & DBEF_SENT))
- {
- int timeBetween=time(NULL)-db_get_dw(hContact,protocolname,"LastReplyTS",0);
- if (timeBetween>interval || db_get_w(hContact,protocolname,"LastStatus",0)!=status)
- {
- char szStatus[6]={0};
- int msgLen=1;
- int isQun=db_get_b(hContact,pszProto,"IsQun",0);
+ if (!(dbei.flags & DBEF_SENT)) {
+ int timeBetween = time(NULL) - db_get_dw(hContact, protocolname, "LastReplyTS", 0);
+ if (timeBetween > interval || db_get_w(hContact, protocolname, "LastStatus", 0) != status) {
+ char szStatus[6] = { 0 };
+ int msgLen = 1;
+ int isQun = db_get_b(hContact, pszProto, "IsQun", 0);
if (isQun)
return FALSE;
- mir_snprintf(szStatus,_countof(szStatus),"%d",status);
- if (!db_get_ts(NULL,protocolname,szStatus,&dbv))
- {
- if (*dbv.ptszVal)
- {
- DBVARIANT dbvHead={0}, dbvNick={0};
+ mir_snprintf(szStatus, _countof(szStatus), "%d", status);
+ if (!db_get_ts(NULL, protocolname, szStatus, &dbv)) {
+ if (*dbv.ptszVal) {
+ DBVARIANT dbvHead = { 0 }, dbvNick = { 0 };
CMString ptszTemp;
TCHAR *ptszTemp2;
- db_get_ts(hContact,pszProto,"Nick",&dbvNick);
- if (mir_tstrcmp(dbvNick.ptszVal, NULL) == 0)
- {
+ db_get_ts(hContact, pszProto, "Nick", &dbvNick);
+ if (mir_tstrcmp(dbvNick.ptszVal, NULL) == 0) {
db_free(&dbvNick);
return FALSE;
}
msgLen += (int)mir_tstrlen(dbv.ptszVal);
- if (!db_get_ts(NULL,protocolname,KEY_HEADING,&dbvHead))
- {
+ if (!db_get_ts(NULL, protocolname, KEY_HEADING, &dbvHead)) {
ptszTemp = dbvHead.ptszVal;
ptszTemp.Replace(_T("%user%"), dbvNick.ptszVal);
msgLen += (int)(mir_tstrlen(ptszTemp));
}
- ptszTemp2 = (TCHAR*)mir_alloc(sizeof(TCHAR) * (msgLen+5));
- mir_sntprintf(ptszTemp2, msgLen+5, _T("%s\r\n\r\n%s"), ptszTemp.c_str(), dbv.ptszVal);
- if (ServiceExists(MS_VARS_FORMATSTRING))
- {
+ ptszTemp2 = (TCHAR*)mir_alloc(sizeof(TCHAR) * (msgLen + 5));
+ mir_sntprintf(ptszTemp2, msgLen + 5, _T("%s\r\n\r\n%s"), ptszTemp.c_str(), dbv.ptszVal);
+ if (ServiceExists(MS_VARS_FORMATSTRING)) {
FORMATINFO fi = { 0 };
fi.cbSize = sizeof(fi);
fi.flags = FIF_TCHAR;
@@ -223,7 +207,7 @@ INT addEvent(WPARAM hContact, LPARAM hDBEvent) ptszTemp = (TCHAR*)CallService(MS_VARS_FORMATSTRING, (WPARAM)&fi, 0);
}
else ptszTemp = Utils_ReplaceVarsT(ptszTemp2);
-
+
T2Utf pszUtf(ptszTemp);
CallContactService(hContact, PSS_MESSAGE, 0, pszUtf);
@@ -247,8 +231,8 @@ INT addEvent(WPARAM hContact, LPARAM hDBEvent) }
}
- db_set_dw(hContact,protocolname,"LastReplyTS",time(NULL));
- db_set_w(hContact,protocolname,"LastStatus",status);
+ db_set_dw(hContact, protocolname, "LastReplyTS", time(NULL));
+ db_set_w(hContact, protocolname, "LastStatus", status);
}
return 0;
}
@@ -265,7 +249,7 @@ extern "C" int __declspec(dllexport)Load(void) mir_getCLI();
CreateServiceFunction(protocolname"/ToggleEnable", ToggleEnable);
- CreateServiceFunction(protocolname"/ToggleAutoanswer",Toggle);
+ CreateServiceFunction(protocolname"/ToggleAutoanswer", Toggle);
CMenuItem mi;
mi.position = 500090000;
@@ -291,4 +275,4 @@ extern "C" int __declspec(dllexport)Load(void) extern "C" __declspec(dllexport)int Unload(void)
{
return 0;
-}
\ No newline at end of file +}
diff --git a/plugins/SimpleAR/src/Options.cpp b/plugins/SimpleAR/src/Options.cpp index 23c41e10ca..75516552a2 100644 --- a/plugins/SimpleAR/src/Options.cpp +++ b/plugins/SimpleAR/src/Options.cpp @@ -5,150 +5,135 @@ INT lastIndex=-1; INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- switch (msg)
- {
- case WM_INITDIALOG:
+ switch (msg) {
+ case WM_INITDIALOG:
+ TranslateDialogDefault(hwndDlg);
{
- DBVARIANT dbv;
- TranslateDialogDefault(hwndDlg);
- TCHAR* pszStatus;
- char tszStatus[6]={0};
+ char tszStatus[6] = { 0 };
- CheckDlgButton(hwndDlg,IDC_ENABLEREPLIER,db_get_b(NULL,protocolname,KEY_ENABLED,1)==1 ? BST_CHECKED : BST_UNCHECKED);
- SetDlgItemInt(hwndDlg,IDC_INTERVAL,db_get_w(NULL,protocolname,KEY_REPEATINTERVAL,300)/60,FALSE);
+ CheckDlgButton(hwndDlg, IDC_ENABLEREPLIER, db_get_b(NULL, protocolname, KEY_ENABLED, 1) == 1 ? BST_CHECKED : BST_UNCHECKED);
+ SetDlgItemInt(hwndDlg, IDC_INTERVAL, db_get_w(NULL, protocolname, KEY_REPEATINTERVAL, 300) / 60, FALSE);
- if (!db_get_ts(NULL,protocolname,KEY_HEADING,&dbv))
- {
- SetDlgItemText(hwndDlg,IDC_HEADING,dbv.ptszVal);
+ DBVARIANT dbv;
+ if (!db_get_ts(NULL, protocolname, KEY_HEADING, &dbv)) {
+ SetDlgItemText(hwndDlg, IDC_HEADING, dbv.ptszVal);
db_free(&dbv);
}
- for (INT c = ID_STATUS_ONLINE; c < ID_STATUS_IDLE; c++)
- {
+ for (INT c = ID_STATUS_ONLINE; c < ID_STATUS_IDLE; c++) {
mir_snprintf(tszStatus, _countof(tszStatus), "%d", c);
- pszStatus = pcli->pfnGetStatusModeDescription(c, 0);
+ TCHAR *pszStatus = pcli->pfnGetStatusModeDescription(c, 0);
if (c == ID_STATUS_ONLINE || c == ID_STATUS_FREECHAT || c == ID_STATUS_INVISIBLE)
continue;
- else
- {
- SendDlgItemMessage(hwndDlg,IDC_STATUSMODE,CB_ADDSTRING,0,(LPARAM)pszStatus);
+ else {
+ SendDlgItemMessage(hwndDlg, IDC_STATUSMODE, CB_ADDSTRING, 0, (LPARAM)pszStatus);
- if (!db_get_ts(NULL, protocolname, tszStatus, &dbv))
- {
+ if (!db_get_ts(NULL, protocolname, tszStatus, &dbv)) {
if (c < ID_STATUS_FREECHAT)
- ptszMessage[c-ID_STATUS_ONLINE-1] = _tcsdup(dbv.ptszVal);
+ ptszMessage[c - ID_STATUS_ONLINE - 1] = _tcsdup(dbv.ptszVal);
else if (c > ID_STATUS_INVISIBLE)
- ptszMessage[c-ID_STATUS_ONLINE-3] = _tcsdup(dbv.ptszVal);
+ ptszMessage[c - ID_STATUS_ONLINE - 3] = _tcsdup(dbv.ptszVal);
db_free(&dbv);
}
}
}
- SendDlgItemMessage(hwndDlg,IDC_STATUSMODE,CB_SETCURSEL,0,0);
+ SendDlgItemMessage(hwndDlg, IDC_STATUSMODE, CB_SETCURSEL, 0, 0);
- lastIndex=0;
- SetDlgItemText(hwndDlg,IDC_MESSAGE,ptszMessage[lastIndex]);
-
- return TRUE;
+ lastIndex = 0;
+ SetDlgItemText(hwndDlg, IDC_MESSAGE, ptszMessage[lastIndex]);
}
+ return TRUE;
- case WM_COMMAND:
- switch (LOWORD(wParam))
- {
- case IDC_ENABLEREPLIER:
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- break;
- case IDC_STATUSMODE:
- // First, save last, then load current
- if (lastIndex>-1)
- {
- int size=SendDlgItemMessage(hwndDlg,IDC_MESSAGE,WM_GETTEXTLENGTH,0,0)+1;
- GetDlgItemText(hwndDlg,IDC_MESSAGE,ptszMessage[lastIndex],size);
- }
- lastIndex=SendDlgItemMessage(hwndDlg,IDC_STATUSMODE,CB_GETCURSEL,0,0);
- SetDlgItemText(hwndDlg,IDC_MESSAGE,ptszMessage[lastIndex]);
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- break;
- case IDC_DEFAULT:
- SetDlgItemText(hwndDlg,IDC_MESSAGE,TranslateTS(ptszDefaultMsg[lastIndex]));
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- break;
- case IDC_INTERVAL:
- case IDC_HEADING:
- case IDC_MESSAGE:
- if ((HIWORD(wParam) == BN_CLICKED || HIWORD(wParam) == EN_CHANGE) && (HWND)lParam == GetFocus())
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- break;
- }
+ case WM_COMMAND:
+ switch (LOWORD(wParam)) {
+ case IDC_ENABLEREPLIER:
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
-
- case WM_NOTIFY:
- switch (((LPNMHDR)lParam)->code)
- {
- case PSN_APPLY:
- {
- TCHAR ptszText[1024];
- BOOL translated;
-
- BOOL fEnabled = IsDlgButtonChecked(hwndDlg, IDC_ENABLEREPLIER) == 1;
- db_set_b(NULL, protocolname, KEY_ENABLED, (BYTE)fEnabled);
-
- if (fEnabled)
- Menu_ModifyItem(hEnableMenu, LPGENT("Disable Auto&reply"), iconList[0].hIcolib);
- else
- Menu_ModifyItem(hEnableMenu, LPGENT("Enable Auto&reply"), iconList[1].hIcolib);
-
- GetDlgItemText(hwndDlg, IDC_HEADING, ptszText, _countof(ptszText));
- db_set_ts(NULL, protocolname, KEY_HEADING, ptszText);
-
- INT size = GetDlgItemInt(hwndDlg, IDC_INTERVAL, &translated, FALSE);
- if (translated)
- interval=size*60;
- db_set_w(NULL,protocolname,KEY_REPEATINTERVAL,interval);
-
- size=SendDlgItemMessage(hwndDlg,IDC_MESSAGE,WM_GETTEXTLENGTH,0,0)+1;
- GetDlgItemText(hwndDlg,IDC_MESSAGE,ptszMessage[lastIndex],size);
-
- for (int c=ID_STATUS_ONLINE; c<ID_STATUS_IDLE; c++)
- {
- if (c == ID_STATUS_ONLINE || c == ID_STATUS_FREECHAT || c == ID_STATUS_INVISIBLE)
- continue;
- else
- {
- char szStatus[6] = {0};
- mir_snprintf(szStatus, _countof(szStatus), "%d", c);
-
- if (c<ID_STATUS_FREECHAT && ptszMessage[c-ID_STATUS_ONLINE-1])
- db_set_ts(NULL,protocolname,szStatus,ptszMessage[c-ID_STATUS_ONLINE-1]);
- else if (c>ID_STATUS_INVISIBLE && ptszMessage[c-ID_STATUS_ONLINE-3])
- db_set_ts(NULL,protocolname,szStatus,ptszMessage[c-ID_STATUS_ONLINE-3]);
- else
- db_unset(NULL,protocolname,szStatus);
- }
- }
- return TRUE;
- }
+ case IDC_STATUSMODE:
+ // First, save last, then load current
+ if (lastIndex > -1) {
+ int size = SendDlgItemMessage(hwndDlg, IDC_MESSAGE, WM_GETTEXTLENGTH, 0, 0) + 1;
+ GetDlgItemText(hwndDlg, IDC_MESSAGE, ptszMessage[lastIndex], size);
}
+ lastIndex = SendDlgItemMessage(hwndDlg, IDC_STATUSMODE, CB_GETCURSEL, 0, 0);
+ SetDlgItemText(hwndDlg, IDC_MESSAGE, ptszMessage[lastIndex]);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+ case IDC_DEFAULT:
+ SetDlgItemText(hwndDlg, IDC_MESSAGE, TranslateTS(ptszDefaultMsg[lastIndex]));
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
- case WM_DESTROY:
- for (int c=ID_STATUS_ONLINE; c<ID_STATUS_IDLE; c++)
- {
+ case IDC_INTERVAL:
+ case IDC_HEADING:
+ case IDC_MESSAGE:
+ if ((HIWORD(wParam) == BN_CLICKED || HIWORD(wParam) == EN_CHANGE) && (HWND)lParam == GetFocus())
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+ }
+ break;
+
+ case WM_NOTIFY:
+ switch (((LPNMHDR)lParam)->code) {
+ case PSN_APPLY:
+ TCHAR ptszText[1024];
+ BOOL translated;
+
+ BOOL fEnabled = IsDlgButtonChecked(hwndDlg, IDC_ENABLEREPLIER) == 1;
+ db_set_b(NULL, protocolname, KEY_ENABLED, (BYTE)fEnabled);
+
+ if (fEnabled)
+ Menu_ModifyItem(hEnableMenu, LPGENT("Disable Auto&reply"), iconList[0].hIcolib);
+ else
+ Menu_ModifyItem(hEnableMenu, LPGENT("Enable Auto&reply"), iconList[1].hIcolib);
+
+ GetDlgItemText(hwndDlg, IDC_HEADING, ptszText, _countof(ptszText));
+ db_set_ts(NULL, protocolname, KEY_HEADING, ptszText);
+
+ INT size = GetDlgItemInt(hwndDlg, IDC_INTERVAL, &translated, FALSE);
+ if (translated)
+ interval = size * 60;
+ db_set_w(NULL, protocolname, KEY_REPEATINTERVAL, interval);
+
+ size = SendDlgItemMessage(hwndDlg, IDC_MESSAGE, WM_GETTEXTLENGTH, 0, 0) + 1;
+ GetDlgItemText(hwndDlg, IDC_MESSAGE, ptszMessage[lastIndex], size);
+
+ for (int c = ID_STATUS_ONLINE; c < ID_STATUS_IDLE; c++) {
if (c == ID_STATUS_ONLINE || c == ID_STATUS_FREECHAT || c == ID_STATUS_INVISIBLE)
continue;
- else
- {
- if (c<ID_STATUS_FREECHAT)
- ptszMessage[c-ID_STATUS_ONLINE-1]=NULL;
- else if (c>ID_STATUS_INVISIBLE)
- ptszMessage[c-ID_STATUS_ONLINE-3]=NULL;
+ else {
+ char szStatus[6] = { 0 };
+ mir_snprintf(szStatus, _countof(szStatus), "%d", c);
+
+ if (c<ID_STATUS_FREECHAT && ptszMessage[c - ID_STATUS_ONLINE - 1])
+ db_set_ts(NULL, protocolname, szStatus, ptszMessage[c - ID_STATUS_ONLINE - 1]);
+ else if (c>ID_STATUS_INVISIBLE && ptszMessage[c - ID_STATUS_ONLINE - 3])
+ db_set_ts(NULL, protocolname, szStatus, ptszMessage[c - ID_STATUS_ONLINE - 3]);
+ else
+ db_unset(NULL, protocolname, szStatus);
}
}
- break;
+ return TRUE;
+ }
+ break;
+
+ case WM_DESTROY:
+ for (int c = ID_STATUS_ONLINE; c < ID_STATUS_IDLE; c++) {
+ if (c == ID_STATUS_ONLINE || c == ID_STATUS_FREECHAT || c == ID_STATUS_INVISIBLE)
+ continue;
+ else {
+ if (c<ID_STATUS_FREECHAT)
+ ptszMessage[c - ID_STATUS_ONLINE - 1] = NULL;
+ else if (c>ID_STATUS_INVISIBLE)
+ ptszMessage[c - ID_STATUS_ONLINE - 3] = NULL;
+ }
+ }
+ break;
}
return FALSE;
}
-INT OptInit(WPARAM wParam,LPARAM lParam)
+INT OptInit(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
odp.position = -790000000;
diff --git a/plugins/SimpleStatusMsg/src/awaymsg.cpp b/plugins/SimpleStatusMsg/src/awaymsg.cpp index 3d227992f2..20c14a01d6 100644 --- a/plugins/SimpleStatusMsg/src/awaymsg.cpp +++ b/plugins/SimpleStatusMsg/src/awaymsg.cpp @@ -30,31 +30,6 @@ with this program; if not, write to the Free Software Foundation, Inc., static HGENMENU hAwayMsgMenuItem, hCopyMsgMenuItem, hGoToURLMenuItem;
static MWindowList hWindowList, hWindowList2;
-static char *StrNormNewlineA(char *szStr)
-{
- if (szStr == NULL)
- return NULL;
-
- int nCR = 0;
- for (int i = 0; szStr[i]; i++)
- if (szStr[i] != 0x0D && szStr[i + 1] == 0x0A)
- nCR++;
-
- if (!nCR)
- return mir_strdup(szStr);
-
- char *szNewStr = (char *)mir_alloc(mir_strlen(szStr) + nCR + 1), *pszStr = szNewStr;
- while (*szStr) {
- if (*szStr == 0x0A)
- *pszStr++ = 0x0D;
- *pszStr++ = *szStr++;
- }
- *pszStr++ = 0;
-
- return szNewStr;
-}
-
-
static TCHAR *StrNormNewline(TCHAR *tszStr)
{
if (tszStr == NULL)
@@ -339,7 +314,7 @@ static char *StrFindURL(char *pszStr) return pszURL;
}
-static INT_PTR GoToURLMsgCommand(WPARAM wParam, LPARAM lParam)
+static INT_PTR GoToURLMsgCommand(WPARAM wParam, LPARAM)
{
ptrA szMsg(db_get_sa(wParam, "CList", "StatusMsg"));
@@ -359,7 +334,7 @@ static INT_PTR GoToURLMsgCommand(WPARAM wParam, LPARAM lParam) return 0;
}
-static int AwayMsgPreBuildMenu(WPARAM hContact, LPARAM lParam)
+static int AwayMsgPreBuildMenu(WPARAM hContact, LPARAM)
{
TCHAR str[128];
char *szProto = GetContactProto(hContact);
diff --git a/plugins/SimpleStatusMsg/src/main.cpp b/plugins/SimpleStatusMsg/src/main.cpp index dc14c22ee8..d164f846bd 100644 --- a/plugins/SimpleStatusMsg/src/main.cpp +++ b/plugins/SimpleStatusMsg/src/main.cpp @@ -47,13 +47,13 @@ PLUGININFOEX pluginInfo = { {0x768ce156, 0x34ac, 0x45a3, {0xb5, 0x3b, 0x0, 0x83, 0xc4, 0x76, 0x15, 0xc4}}
};
-BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
+BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
{
g_hInst = hinstDLL;
return TRUE;
}
-extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfo;
}
@@ -146,7 +146,7 @@ static TCHAR *GetWinampSong(void) return res;
}
-TCHAR *InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int status)
+TCHAR* InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int)
{
int i, count = 0, len;
TCHAR substituteStr[1024], *msg = mir_tstrdup(in);
@@ -859,7 +859,7 @@ void SetStatusMessage(const char *szProto, int iInitialStatus, int iStatus, TCHA }
}
-INT_PTR ShowStatusMessageDialogInternal(WPARAM wParam, LPARAM lParam)
+INT_PTR ShowStatusMessageDialogInternal(WPARAM, LPARAM lParam)
{
struct MsgBoxInitData *box_data;
BOOL idvstatusmsg = FALSE;
@@ -935,7 +935,7 @@ INT_PTR ShowStatusMessageDialogInternal(WPARAM wParam, LPARAM lParam) return 0;
}
-INT_PTR ShowStatusMessageDialog(WPARAM wParam, LPARAM lParam)
+INT_PTR ShowStatusMessageDialog(WPARAM, LPARAM lParam)
{
struct MsgBoxInitData *box_data;
BOOL idvstatusmsg = FALSE;
@@ -985,7 +985,7 @@ INT_PTR ShowStatusMessageDialog(WPARAM wParam, LPARAM lParam) return 0;
}
-static int ChangeStatusMessage(WPARAM wParam, LPARAM lParam)
+int ChangeStatusMessage(WPARAM wParam, LPARAM lParam)
{
if (Miranda_Terminated())
return 0;
@@ -1167,7 +1167,7 @@ static INT_PTR ChangeStatusMsg(WPARAM wParam, LPARAM lParam) return 0;
}
-static int ProcessProtoAck(WPARAM wParam,LPARAM lParam)
+static int ProcessProtoAck(WPARAM , LPARAM lParam)
{
ACKDATA *ack = (ACKDATA *)lParam;
if (!ack || !ack->szModule)
@@ -1245,7 +1245,7 @@ int SetStartupStatus(int i) return 0;
}
-VOID CALLBACK SetStartupStatusGlobal(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
+VOID CALLBACK SetStartupStatusGlobal(HWND hwnd, UINT, UINT_PTR idEvent, DWORD)
{
int prev_status_mode = -1, status_mode, temp_status_mode = ID_STATUS_OFFLINE, i;
BOOL globalstatus = TRUE;
@@ -1279,14 +1279,11 @@ VOID CALLBACK SetStartupStatusGlobal(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWO if (db_get_b(NULL, "SimpleStatusMsg", "StartupPopupDlg", 1) && accounts->statusMsgFlags)
{
if (globalstatus)
- {
- ChangeStatusMessage((WPARAM)status_mode, (LPARAM)"SimpleStatusMsgGlobalStartupStatus");
- }
- else
- {
+ ChangeStatusMessage(status_mode, (LPARAM)"SimpleStatusMsgGlobalStartupStatus");
+ else {
// pseudo-currentDesiredStatusMode ;-)
db_set_w(NULL, "SimpleStatusMsg", "StartupStatus", (WORD)temp_status_mode);
- ChangeStatusMessage((WPARAM)ID_STATUS_CURRENT, (LPARAM)"SimpleStatusMsgGlobalStartupStatus");
+ ChangeStatusMessage(ID_STATUS_CURRENT, (LPARAM)"SimpleStatusMsgGlobalStartupStatus");
}
return;
}
@@ -1299,14 +1296,11 @@ VOID CALLBACK SetStartupStatusGlobal(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWO if (!(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0)&~CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_5, 0)))
continue;
-// if (db_get_b(NULL, accounts->pa[i]->szModuleName, "LockMainStatus", 0))
-// continue;
-
SetStartupStatus(i);
}
}
-VOID CALLBACK SetStartupStatusProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
+VOID CALLBACK SetStartupStatusProc(HWND hwnd, UINT, UINT_PTR idEvent, DWORD)
{
BOOL found = FALSE;
int i;
@@ -1336,7 +1330,7 @@ VOID CALLBACK SetStartupStatusProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD SetStartupStatus(i);
}
-VOID CALLBACK UpdateMsgTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
+VOID CALLBACK UpdateMsgTimerProc(HWND, UINT, UINT_PTR, DWORD)
{
MIRANDA_IDLE_INFO mii = {0};
mii.cbSize = sizeof(mii);
@@ -1398,7 +1392,7 @@ VOID CALLBACK UpdateMsgTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD d }
}
-static int AddTopToolbarButton(WPARAM wParam, LPARAM lParam)
+static int AddTopToolbarButton(WPARAM, LPARAM)
{
TTBButton tbb = { 0 };
tbb.hIconHandleUp = tbb.hIconHandleDn = GetIconHandle(IDI_CSMSG);
@@ -1425,7 +1419,7 @@ void RegisterHotkey(void) Hotkey_Register(&hkd);
}
-static int ChangeStatusMsgPrebuild(WPARAM wParam, LPARAM lParam)
+static int ChangeStatusMsgPrebuild(WPARAM, LPARAM)
{
#ifdef _DEBUG
log2file("ChangeStatusMsgPrebuild()");
@@ -1559,7 +1553,7 @@ static int OnIdleChanged(WPARAM, LPARAM lParam) return 0;
}
-static int CSStatusChange(WPARAM wParam, LPARAM lParam)
+static int CSStatusChange(WPARAM wParam, LPARAM)
{
PROTOCOLSETTINGEX **ps = *(PROTOCOLSETTINGEX***)wParam;
int status_mode, CSProtoCount;
@@ -1711,7 +1705,7 @@ static int OnICQStatusMsgRequest(WPARAM wParam, LPARAM lParam, LPARAM lMirParam) return 0;
}
-static int OnAccListChanged(WPARAM wParam, LPARAM lParam)
+static int OnAccListChanged(WPARAM, LPARAM)
{
#ifdef _DEBUG
log2file("OnAccListChanged()");
diff --git a/plugins/SimpleStatusMsg/src/options.cpp b/plugins/SimpleStatusMsg/src/options.cpp index ab3133f1b3..5e40cd08c5 100644 --- a/plugins/SimpleStatusMsg/src/options.cpp +++ b/plugins/SimpleStatusMsg/src/options.cpp @@ -438,9 +438,9 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l }
else if (data->status_msg[i].flags[j] & STATUS_LAST_MSG)
{
- char setting[80];
DBVARIANT dbv, dbv2;
+ char setting[80];
if (i)
mir_snprintf(setting, "Last%sMsg", accounts->pa[k]->szModuleName);
else
@@ -1189,7 +1189,7 @@ static INT_PTR CALLBACK DlgVariablesOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM return FALSE;
}
-static BOOL IsHistoryMsgsFound(HWND hwndDlg, int histMax)
+static BOOL IsHistoryMsgsFound(HWND, int histMax)
{
char szSetting[16];
DBVARIANT dbv;
@@ -1662,7 +1662,7 @@ static INT_PTR CALLBACK DlgStatusOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wPa return FALSE;
}
-int InitOptions(WPARAM wParam, LPARAM lParam)
+int InitOptions(WPARAM wParam, LPARAM)
{
if (accounts->statusCount == 0)
return 0;
diff --git a/plugins/StopSpamMod/src/init.cpp b/plugins/StopSpamMod/src/init.cpp index 78aeea2420..d7c9193380 100755 --- a/plugins/StopSpamMod/src/init.cpp +++ b/plugins/StopSpamMod/src/init.cpp @@ -112,7 +112,7 @@ void InitVars() }
-static int OnSystemModulesLoaded(WPARAM wParam,LPARAM lParam)
+static int OnSystemModulesLoaded(WPARAM, LPARAM)
{
/* if (ServiceExists(MS_DOS_SERVICE))
gbDosServiceExist = TRUE; */
@@ -121,7 +121,7 @@ static int OnSystemModulesLoaded(WPARAM wParam,LPARAM lParam) InitVars();
void CleanThread();
if(gbDelAllTempory || gbDelExcluded)
- boost::thread *thr = new boost::thread(&CleanThread);
+ new boost::thread(&CleanThread);
// Folders plugin support
hStopSpamLogDirH = FoldersRegisterCustomPathT(LPGEN("StopSpam"), LPGEN("StopSpam Logs"), FOLDER_LOGS);
@@ -131,7 +131,7 @@ static int OnSystemModulesLoaded(WPARAM wParam,LPARAM lParam) HANDLE hEventFilter = 0, hOptInitialise = 0, hSettingChanged = 0;
-BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved)
+BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
{
hInst = hinstDLL;
return TRUE;
diff --git a/plugins/TipperYM/src/bitmap_func.cpp b/plugins/TipperYM/src/bitmap_func.cpp index 41235c0f07..0483556753 100644 --- a/plugins/TipperYM/src/bitmap_func.cpp +++ b/plugins/TipperYM/src/bitmap_func.cpp @@ -178,6 +178,7 @@ void CreateFromBitmaps(bool bServiceTip) rcWidth = opt.iSidebarWidth;
rcHeight = skin.iHeight;
}
+ else rcWidth = rcHeight = 0;
// bitmap size
iBmpWidth = fii->FI_GetWidth(fib);
diff --git a/plugins/TipperYM/src/message_pump.cpp b/plugins/TipperYM/src/message_pump.cpp index 07fd28ea3e..fa9f32515d 100644 --- a/plugins/TipperYM/src/message_pump.cpp +++ b/plugins/TipperYM/src/message_pump.cpp @@ -34,7 +34,7 @@ __inline bool IsContactTooltip(CLCINFOTIPEX *clc) return !(clc->szProto || clc->swzText);
}
-void CALLBACK TimerProcWaitForContent(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
+void CALLBACK TimerProcWaitForContent(HWND, UINT, UINT_PTR, DWORD)
{
KillTimer(0, WaitForContentTimerID);
WaitForContentTimerID = 0;
@@ -99,7 +99,7 @@ bool NeedWaitForContent(CLCINFOTIPEX *clcitex) return bNeedWait;
}
-unsigned int CALLBACK MessagePumpThread(void *param)
+unsigned int CALLBACK MessagePumpThread(void*)
{
HWND hwndTip = NULL;
CLCINFOTIPEX *clcitex = NULL;
@@ -304,7 +304,7 @@ int HideTipHook(WPARAM wParam, LPARAM lParam) return 0;
}
-int ProtoAck(WPARAM wParam, LPARAM lParam)
+int ProtoAck(WPARAM, LPARAM lParam)
{
ACKDATA *ack = (ACKDATA*)lParam;
if ((ack==NULL) || (ack->result != ACKRESULT_SUCCESS))
@@ -321,13 +321,13 @@ int ProtoAck(WPARAM wParam, LPARAM lParam) return 0;
}
-int AvatarChanged(WPARAM hContact, LPARAM lParam)
+int AvatarChanged(WPARAM hContact, LPARAM)
{
PostMPMessage(MUM_GOTAVATAR, hContact, 0);
return 0;
}
-int FramesShowSBTip(WPARAM wParam, LPARAM lParam)
+int FramesShowSBTip(WPARAM wParam, LPARAM)
{
if (opt.bStatusBarTips)
{
diff --git a/plugins/TipperYM/src/mir_smileys.cpp b/plugins/TipperYM/src/mir_smileys.cpp index 19b963e0de..3aeafcb697 100644 --- a/plugins/TipperYM/src/mir_smileys.cpp +++ b/plugins/TipperYM/src/mir_smileys.cpp @@ -66,13 +66,13 @@ void Smileys_FreeParse(SMILEYPARSEINFO parseInfo) // Similar to DrawText win32 api function
// Pass uFormat | DT_CALCRECT to calc rectangle to be returned by lpRect
// parseInfo is optional (pass NULL and it will be calculated and deleted inside function
-int Smileys_DrawText(HDC hDC, LPCTSTR lpString, int nCount, LPRECT lpRect, UINT uFormat, const char *protocol, SMILEYPARSEINFO parseInfo)
+int Smileys_DrawText(HDC hDC, LPCTSTR lpString, int nCount, LPRECT lpRect, UINT uFormat, SMILEYPARSEINFO parseInfo)
{
if (nCount == -1)
nCount = (int)mir_tstrlen(lpString);
if (uFormat & DT_CALCRECT) {
- SIZE text_size = GetTextSize(hDC, lpString, parseInfo, uFormat, parseInfo->max_height, (lpRect->right - lpRect->left));
+ SIZE text_size = GetTextSize(hDC, lpString, parseInfo, uFormat, (lpRect->right - lpRect->left));
lpRect->bottom = text_size.cy;
if (text_size.cx < lpRect->right - lpRect->left) {
@@ -91,7 +91,7 @@ int Smileys_DrawText(HDC hDC, LPCTSTR lpString, int nCount, LPRECT lpRect, UINT return DrawText(hDC, lpString, nCount, lpRect, uFormat);
RECT rc = *lpRect;
- SIZE text_size = GetTextSize(hDC, lpString, parseInfo, uFormat, parseInfo->max_height, (lpRect->right - lpRect->left));
+ SIZE text_size = GetTextSize(hDC, lpString, parseInfo, uFormat, (lpRect->right - lpRect->left));
if (text_size.cx < rc.right - rc.left) {
if (uFormat & DT_RIGHT)
@@ -100,11 +100,11 @@ int Smileys_DrawText(HDC hDC, LPCTSTR lpString, int nCount, LPRECT lpRect, UINT rc.right = rc.left + text_size.cx;
}
- DrawTextSmiley(hDC, rc, lpString, nCount, parseInfo, uFormat, parseInfo->max_height);
+ DrawTextSmiley(hDC, rc, lpString, nCount, parseInfo, uFormat);
return text_size.cy;
}
-SIZE GetTextSize(HDC hdcMem, const TCHAR *szText, SMILEYPARSEINFO info, UINT uTextFormat, int max_smiley_height, int max_width)
+SIZE GetTextSize(HDC hdcMem, const TCHAR *szText, SMILEYPARSEINFO info, UINT uTextFormat, int max_width)
{
SIZE text_size = { 0 };
int text_height;
@@ -178,7 +178,7 @@ SIZE GetTextSize(HDC hdcMem, const TCHAR *szText, SMILEYPARSEINFO info, UINT uTe return text_size;
}
-void DrawTextSmiley(HDC hdcMem, RECT free_rc, const TCHAR *szText, int len, SMILEYPARSEINFO info, UINT uTextFormat, int max_smiley_height)
+void DrawTextSmiley(HDC hdcMem, RECT free_rc, const TCHAR *szText, int len, SMILEYPARSEINFO info, UINT uTextFormat)
{
if (szText == NULL)
return;
@@ -423,13 +423,13 @@ SortedList *ReplaceSmileys(const TCHAR *text, int text_size, const char *protoco return plText;
}
-int DrawTextExt(HDC hdc, LPCTSTR lpString, int nCount, LPRECT lpRect, UINT uFormat, LPCSTR lpProto, SMILEYPARSEINFO spi)
+int DrawTextExt(HDC hdc, LPCTSTR lpString, int nCount, LPRECT lpRect, UINT uFormat, SMILEYPARSEINFO spi)
{
if ((opt.iSmileyAddFlags & SMILEYADD_ENABLE) && spi != NULL) {
if (opt.iSmileyAddFlags & SMILEYADD_RESIZE)
uFormat |= DT_RESIZE_SMILEYS;
- return Smileys_DrawText(hdc, lpString, nCount, lpRect, uFormat, lpProto, spi);
+ return Smileys_DrawText(hdc, lpString, nCount, lpRect, uFormat, spi);
}
if (uFormat & DT_CALCRECT)
diff --git a/plugins/TipperYM/src/mir_smileys.h b/plugins/TipperYM/src/mir_smileys.h index 5f78ac8f09..04d6256331 100644 --- a/plugins/TipperYM/src/mir_smileys.h +++ b/plugins/TipperYM/src/mir_smileys.h @@ -60,11 +60,11 @@ SMILEYPARSEINFO Smileys_PreParse(LPCTSTR lpString, int nCount, const char *proto void Smileys_FreeParse(SMILEYPARSEINFO parseInfo);
SortedList *ReplaceSmileys(const TCHAR *text, int text_size, const char *protocol, int *max_smiley_height);
-SIZE GetTextSize(HDC hdcMem, const TCHAR *szText, SMILEYPARSEINFO info, UINT uTextFormat, int max_smiley_height, int max_width);
-void DrawTextSmiley(HDC hdcMem, RECT free_rc, const TCHAR *szText, int len, SMILEYPARSEINFO info, UINT uTextFormat, int max_smiley_height);
+SIZE GetTextSize(HDC hdcMem, const TCHAR *szText, SMILEYPARSEINFO info, UINT uTextFormat, int max_width);
+void DrawTextSmiley(HDC hdcMem, RECT free_rc, const TCHAR *szText, int len, SMILEYPARSEINFO info, UINT uTextFormat);
void DestroySmileyList(SortedList* p_list);
-int Smileys_DrawText(HDC hDC, LPCTSTR lpString, int nCount, LPRECT lpRect, UINT uFormat, const char *protocol, SMILEYPARSEINFO parseInfo);
-int DrawTextExt(HDC hdc, LPCTSTR lpString, int nCount, LPRECT lpRect, UINT uFormat, LPCSTR lpProto, SMILEYPARSEINFO spi);
+int Smileys_DrawText(HDC hDC, LPCTSTR lpString, int nCount, LPRECT lpRect, UINT uFormat, SMILEYPARSEINFO parseInfo);
+int DrawTextExt(HDC hdc, LPCTSTR lpString, int nCount, LPRECT lpRect, UINT uFormat, SMILEYPARSEINFO spi);
#endif // __MIR_SMILEYS_H__
diff --git a/plugins/TipperYM/src/options.cpp b/plugins/TipperYM/src/options.cpp index 7dd3896f19..fe719e5d90 100644 --- a/plugins/TipperYM/src/options.cpp +++ b/plugins/TipperYM/src/options.cpp @@ -1876,7 +1876,7 @@ INT_PTR CALLBACK DlgProcOptsSkin(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l return FALSE;
}
-INT_PTR CALLBACK DlgProcFavouriteContacts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK DlgProcFavouriteContacts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM)
{
switch (msg) {
case WM_INITDIALOG:
@@ -2130,7 +2130,7 @@ INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA return FALSE;
}
-int OptInit(WPARAM wParam, LPARAM lParam)
+int OptInit(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
odp.flags = ODPF_BOLDGROUPS;
diff --git a/plugins/TipperYM/src/popwin.cpp b/plugins/TipperYM/src/popwin.cpp index 4c0fd2000a..15b6f6f7f9 100644 --- a/plugins/TipperYM/src/popwin.cpp +++ b/plugins/TipperYM/src/popwin.cpp @@ -583,7 +583,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa tr.top = opt.iPadding; tr.bottom = tr.top + pwd->iTitleHeight - opt.iPadding; UINT uTextFormat = DT_TOP | DT_LEFT | DT_WORDBREAK | DT_WORD_ELLIPSIS | DT_END_ELLIPSIS | DT_NOPREFIX; - DrawTextExt(hdc, pwd->swzTitle, -1, &tr, uTextFormat, NULL, pwd->spiTitle); + DrawTextExt(hdc, pwd->swzTitle, -1, &tr, uTextFormat, pwd->spiTitle); } } @@ -694,7 +694,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa DrawIconExAlpha(hdc, opt.iPadding, tr.top + (pwd->rows[i].iValueHeight - 16) / 2, pwd->rows[i].hIcon, 16, 16, 0, NULL, DI_NORMAL, false); UINT uFormat = opt.iValueValign | opt.iValueHalign | DT_WORDBREAK | DT_WORD_ELLIPSIS | DT_END_ELLIPSIS | DT_NOPREFIX; - DrawTextExt(hdc, pwd->rows[i].swzValue, -1, &tr, uFormat, NULL, pwd->rows[i].spi); + DrawTextExt(hdc, pwd->rows[i].swzValue, -1, &tr, uFormat, pwd->rows[i].spi); } } @@ -1149,7 +1149,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa smr.right -= opt.iPadding; if (hFontTitle) SelectObject(hdc, (HGDIOBJ)hFontTitle); - DrawTextExt(hdc, pwd->swzTitle, -1, &smr, DT_CALCRECT | DT_LEFT | DT_WORDBREAK | DT_END_ELLIPSIS | DT_NOPREFIX, NULL, pwd->spiTitle); + DrawTextExt(hdc, pwd->swzTitle, -1, &smr, DT_CALCRECT | DT_LEFT | DT_WORDBREAK | DT_END_ELLIPSIS | DT_NOPREFIX, pwd->spiTitle); iWidth += opt.iPadding + opt.iTitleIndent + smr.right; pwd->iTitleHeight = opt.iPadding + smr.bottom; @@ -1221,7 +1221,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa bStatusMsg = true; } - DrawTextExt(hdc, pwd->rows[i].swzValue, -1, &smr, DT_CALCRECT | DT_LEFT | DT_WORDBREAK | DT_END_ELLIPSIS | DT_NOPREFIX, NULL, pwd->rows[i].spi); + DrawTextExt(hdc, pwd->rows[i].swzValue, -1, &smr, DT_CALCRECT | DT_LEFT | DT_WORDBREAK | DT_END_ELLIPSIS | DT_NOPREFIX, pwd->rows[i].spi); } else smr.left = smr.right = 0; diff --git a/plugins/TipperYM/src/tipper.cpp b/plugins/TipperYM/src/tipper.cpp index 1b5bfa2547..67218d0e40 100644 --- a/plugins/TipperYM/src/tipper.cpp +++ b/plugins/TipperYM/src/tipper.cpp @@ -54,18 +54,18 @@ PLUGININFOEX pluginInfoEx = {0x8392df1d, 0x9090, 0x4f8e, {0x9d, 0xf6, 0x2f, 0xe0, 0x58, 0xed, 0xd8, 0x00}}
};
-bool WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
+bool WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
{
hInst = hinstDLL;
return TRUE;
}
-extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfoEx;
}
-int ReloadFont(WPARAM wParam, LPARAM lParam)
+int ReloadFont(WPARAM, LPARAM)
{
LOGFONT logFont;
if (hFontTitle) DeleteObject(hFontTitle);
@@ -91,7 +91,7 @@ int ReloadFont(WPARAM wParam, LPARAM lParam) }
// hack to hide tip when clist hides from timeout
-int SettingChanged(WPARAM hContact, LPARAM lParam)
+int SettingChanged(WPARAM, LPARAM lParam)
{
DBCONTACTWRITESETTING *dcws = (DBCONTACTWRITESETTING *)lParam;
if (mir_strcmp(dcws->szModule, "CList") != 0 || mir_strcmp(dcws->szSetting, "State") != 0)
@@ -115,7 +115,7 @@ int EventDeleted(WPARAM wParam, LPARAM lParam) return 0;
}
-int ReloadSkinFolder(WPARAM wParam, LPARAM lParam)
+int ReloadSkinFolder(WPARAM, LPARAM)
{
FoldersGetCustomPathT(hSkinFolder, SKIN_FOLDER, _countof(SKIN_FOLDER), _T(DEFAULT_SKIN_FOLDER));
return 0;
@@ -270,7 +270,7 @@ int ModulesLoaded(WPARAM, LPARAM) return 0;
}
-int Shutdown(WPARAM wParam, LPARAM lParam)
+int Shutdown(WPARAM, LPARAM)
{
if (hFramesSBShow) UnhookEvent(hFramesSBShow);
if (hFramesSBHide) UnhookEvent(hFramesSBHide);
diff --git a/plugins/TipperYM/src/translations.cpp b/plugins/TipperYM/src/translations.cpp index aee33a5dc8..7fe285ac0f 100644 --- a/plugins/TipperYM/src/translations.cpp +++ b/plugins/TipperYM/src/translations.cpp @@ -671,7 +671,7 @@ TCHAR *ByteToLanguage(MCONTACT hContact, const char *szModuleName, const char *s return 0;
}
-INT_PTR ServiceAddTranslation(WPARAM wParam, LPARAM lParam)
+INT_PTR ServiceAddTranslation(WPARAM, LPARAM lParam)
{
if (!lParam) return 1;
diff --git a/plugins/TooltipNotify/src/DbHelpers.cpp b/plugins/TooltipNotify/src/DbHelpers.cpp index ee64d85a3b..4393e44b5a 100644 --- a/plugins/TooltipNotify/src/DbHelpers.cpp +++ b/plugins/TooltipNotify/src/DbHelpers.cpp @@ -6,7 +6,7 @@ typedef std::vector<const char*> SettingsList;
-static int EnumSettingsProc1(const char *pszSetting, LPARAM lParam)
+static int EnumSettingsProc1(const char*, LPARAM)
{
return 0;
}
diff --git a/plugins/TooltipNotify/src/TooltipNotify.cpp b/plugins/TooltipNotify/src/TooltipNotify.cpp index 08a8e0864f..65eedd0467 100644 --- a/plugins/TooltipNotify/src/TooltipNotify.cpp +++ b/plugins/TooltipNotify/src/TooltipNotify.cpp @@ -16,9 +16,9 @@ static const char* SND_OTHER = "ttntfOther"; static const char* SND_TYPING = "ttntfTyping";
static const char* CONTACT_IGNORE_TTNOTIFY = "Ignore";
-static const int ID_TTNTF_STATUS_TYPING = ID_STATUS_INVISIBLE+10;
-static const int ID_TTNTF_STATUS_IDLE = ID_STATUS_INVISIBLE+11;
-static const int ID_TTNTF_STATUS_NOT_IDLE = ID_STATUS_INVISIBLE+12;
+static const int ID_TTNTF_STATUS_TYPING = ID_STATUS_INVISIBLE + 10;
+static const int ID_TTNTF_STATUS_IDLE = ID_STATUS_INVISIBLE + 11;
+static const int ID_TTNTF_STATUS_NOT_IDLE = ID_STATUS_INVISIBLE + 12;
#define FONTSERV_GROUP LPGENT("Tooltip Notify")
#define FONTSERV_ONLINE LPGENT("Online")
@@ -35,14 +35,14 @@ struct FontEntry char* clrPrefix;
};
-static FontEntry s_fontTable[] =
+static FontEntry s_fontTable[] =
{
- ID_STATUS_ONLINE, FONTSERV_ONLINE, "OnlineFont", "OnlineBgColor",
- ID_STATUS_OFFLINE, FONTSERV_OFFLINE, "OfflineFont", "OfflineBgColor",
- ID_TTNTF_STATUS_TYPING, FONTSERV_TYPING, "TypingFont", "TypingBgColor",
- ID_TTNTF_STATUS_IDLE, FONTSERV_IDLE, "IdleFont", "IdleBgColor",
- ID_TTNTF_STATUS_NOT_IDLE, FONTSERV_IDLE, "IdleFont", "IdleBgColor",
- 0, FONTSERV_OTHER, "OtherFont", "OtherBgColor",
+ ID_STATUS_ONLINE, FONTSERV_ONLINE, "OnlineFont", "OnlineBgColor",
+ ID_STATUS_OFFLINE, FONTSERV_OFFLINE, "OfflineFont", "OfflineBgColor",
+ ID_TTNTF_STATUS_TYPING, FONTSERV_TYPING, "TypingFont", "TypingBgColor",
+ ID_TTNTF_STATUS_IDLE, FONTSERV_IDLE, "IdleFont", "IdleBgColor",
+ ID_TTNTF_STATUS_NOT_IDLE, FONTSERV_IDLE, "IdleFont", "IdleBgColor",
+ 0, FONTSERV_OTHER, "OtherFont", "OtherBgColor",
};
CTooltipNotify *CTooltipNotify::s_pInstance = 0;
@@ -53,9 +53,9 @@ const char *CTooltipNotify::s_szModuleNameOld = "ttntfmod"; //////////////////////////////////////////////////////////////////////
CTooltipNotify::CTooltipNotify() :
- m_bNt50( IsNt50())
+m_bNt50(IsNt50())
{
- if (s_pInstance!=0)
+ if (s_pInstance != 0)
throw EAlreadyExists();
s_pInstance = this;
@@ -67,38 +67,38 @@ CTooltipNotify::~CTooltipNotify() {
EndNotifyAll();
CTooltip::Deinitialize();
- s_pInstance=0;
+ s_pInstance = 0;
}
void CTooltipNotify::RegisterFonts()
{
FontIDT fontId = { sizeof(fontId) };
- _tcsncpy(fontId.group, FONTSERV_GROUP, _countof(fontId.group)-1);
- strncpy(fontId.dbSettingsGroup, MODULENAME, _countof(fontId.dbSettingsGroup)-1);
+ _tcsncpy(fontId.group, FONTSERV_GROUP, _countof(fontId.group) - 1);
+ strncpy(fontId.dbSettingsGroup, MODULENAME, _countof(fontId.dbSettingsGroup) - 1);
fontId.flags = FIDF_DEFAULTVALID;
fontId.deffontsettings.colour = DEF_SETTING_TXTCOLOR;
fontId.deffontsettings.size = -MulDiv(DEF_SETTING_FONT_SIZE, DEF_LOGPIXELSY, 72);
fontId.deffontsettings.style = DEF_SETTING_FONT_STYLE;
fontId.deffontsettings.charset = DEF_SETTING_FONT_CHARSET;
- _tcsncpy(fontId.deffontsettings.szFace, DEF_SETTING_FONT_FACE, _countof(fontId.deffontsettings.szFace)-1);
+ _tcsncpy(fontId.deffontsettings.szFace, DEF_SETTING_FONT_FACE, _countof(fontId.deffontsettings.szFace) - 1);
fontId.order = 0;
- _tcsncpy(fontId.backgroundGroup, FONTSERV_GROUP, _countof(fontId.backgroundGroup)-1);
+ _tcsncpy(fontId.backgroundGroup, FONTSERV_GROUP, _countof(fontId.backgroundGroup) - 1);
ColourIDT colorId = { sizeof(colorId) };
- _tcsncpy(colorId.group, FONTSERV_GROUP, _countof(colorId.group)-1);
- strncpy(colorId.dbSettingsGroup, MODULENAME, _countof(colorId.dbSettingsGroup)-1);
+ _tcsncpy(colorId.group, FONTSERV_GROUP, _countof(colorId.group) - 1);
+ strncpy(colorId.dbSettingsGroup, MODULENAME, _countof(colorId.dbSettingsGroup) - 1);
colorId.flags = 0;
colorId.defcolour = DEF_SETTING_BGCOLOR;
colorId.order = 0;
- for (int i=0; i<_countof(s_fontTable); i++) {
- _tcsncpy(fontId.name, s_fontTable[i].name, _countof(fontId.name)-1);
- strncpy(fontId.prefix, s_fontTable[i].fontPrefix, _countof(fontId.prefix)-1);
- _tcsncpy(fontId.backgroundName, s_fontTable[i].name, _countof(fontId.backgroundName)-1);
+ for (int i = 0; i < _countof(s_fontTable); i++) {
+ _tcsncpy(fontId.name, s_fontTable[i].name, _countof(fontId.name) - 1);
+ strncpy(fontId.prefix, s_fontTable[i].fontPrefix, _countof(fontId.prefix) - 1);
+ _tcsncpy(fontId.backgroundName, s_fontTable[i].name, _countof(fontId.backgroundName) - 1);
::FontRegisterT(&fontId);
- _tcsncpy(colorId.name, s_fontTable[i].name, _countof(colorId.name)-1);
- strncpy(colorId.setting, s_fontTable[i].clrPrefix, _countof(colorId.setting)-1);
+ _tcsncpy(colorId.name, s_fontTable[i].name, _countof(colorId.name) - 1);
+ strncpy(colorId.setting, s_fontTable[i].clrPrefix, _countof(colorId.setting) - 1);
::ColourRegisterT(&colorId);
}
}
@@ -106,24 +106,21 @@ void CTooltipNotify::RegisterFonts() void CTooltipNotify::GetFont(int iStatus, LOGFONT* lf, COLORREF* text, COLORREF* bg)
{
TCHAR* fontName = 0;
- for(int i=0; i<_countof(s_fontTable); i++)
- {
- if (s_fontTable[i].status == iStatus)
- {
+ for (int i = 0; i < _countof(s_fontTable); i++) {
+ if (s_fontTable[i].status == iStatus) {
fontName = s_fontTable[i].name;
}
}
- if (fontName == 0)
- {
- fontName = s_fontTable[_countof(s_fontTable)-1].name;
+ if (fontName == 0) {
+ fontName = s_fontTable[_countof(s_fontTable) - 1].name;
}
// name and group only
FontIDT fontId = { sizeof(fontId), FONTSERV_GROUP, 0 };
- _tcsncpy(fontId.name, fontName,_countof(fontId.name)-1);
+ _tcsncpy(fontId.name, fontName, _countof(fontId.name) - 1);
*text = (COLORREF)::CallService(MS_FONT_GETT, (WPARAM)&fontId, (LPARAM)lf);
ColourIDT colorId = { sizeof(colorId), FONTSERV_GROUP, 0 };
- _tcsncpy(colorId.name, fontName,_countof(colorId.name)-1);
+ _tcsncpy(colorId.name, fontName, _countof(colorId.name) - 1);
*bg = (COLORREF)::CallService(MS_COLOUR_GETT, (WPARAM)&colorId, 0);
}
@@ -133,20 +130,19 @@ int CTooltipNotify::ModulesLoaded(WPARAM, LPARAM) LoadSettings();
ValidateSettings();
- if (m_sOptions.bFirstRun)
- {
+ if (m_sOptions.bFirstRun) {
db_set_b(NULL, "SkinSoundsOff", SND_ONLINE, 1);
db_set_b(NULL, "SkinSoundsOff", SND_OFFLINE, 1);
db_set_b(NULL, "SkinSoundsOff", SND_OTHER, 1);
db_set_b(NULL, "SkinSoundsOff", SND_TYPING, 1);
db_set_b(NULL, MODULENAME, "firstrun", 0);
}
-
+
// register fonts
- SkinAddNewSound(SND_ONLINE, LPGEN("Tooltip Notify: Online"), "online.wav");
+ SkinAddNewSound(SND_ONLINE, LPGEN("Tooltip Notify: Online"), "online.wav");
SkinAddNewSound(SND_OFFLINE, LPGEN("Tooltip Notify: Offline"), "offline.wav");
- SkinAddNewSound(SND_OTHER, LPGEN("Tooltip Notify: Other"), "other.wav");
- SkinAddNewSound(SND_TYPING, LPGEN("Tooltip Notify: Typing"), "typing.wav");
+ SkinAddNewSound(SND_OTHER, LPGEN("Tooltip Notify: Other"), "other.wav");
+ SkinAddNewSound(SND_TYPING, LPGEN("Tooltip Notify: Typing"), "typing.wav");
RegisterFonts();
@@ -160,7 +156,7 @@ int CTooltipNotify::ProtoContactIsTyping(WPARAM hContact, LPARAM lParam) if (lParam > 0) {
STooltipData *pTooltipData = new STooltipData;
- pTooltipData->uiTimeout = lParam*1000;
+ pTooltipData->uiTimeout = lParam * 1000;
pTooltipData->hContact = hContact;
pTooltipData->iStatus = ID_TTNTF_STATUS_TYPING;
@@ -176,29 +172,26 @@ int CTooltipNotify::ProtoContactIsTyping(WPARAM hContact, LPARAM lParam) int CTooltipNotify::ProtoAck(WPARAM, LPARAM lParam)
{
- ACKDATA *ack=(ACKDATA*)lParam;
- if((ack == NULL) || (ack->type != ACKTYPE_STATUS)) return 0;
+ ACKDATA *ack = (ACKDATA*)lParam;
+ if ((ack == NULL) || (ack->type != ACKTYPE_STATUS)) return 0;
WORD wNewStatus = (WORD)ack->lParam;
WORD wOldStatus = (WORD)ack->hProcess;
if (wOldStatus == wNewStatus) return 0; //Useless message.
char *szProtocol = (char *)ack->szModule;
-
- if (wNewStatus == ID_STATUS_OFFLINE)
- {
- BYTE bProtoActive = db_get_b(NULL, MODULENAME, szProtocol, ProtoUserBit|ProtoIntBit);
+
+ if (wNewStatus == ID_STATUS_OFFLINE) {
+ BYTE bProtoActive = db_get_b(NULL, MODULENAME, szProtocol, ProtoUserBit | ProtoIntBit);
bProtoActive &= ~ProtoIntBit;
db_set_b(NULL, MODULENAME, szProtocol, bProtoActive);
}
- else
- {
- if (wOldStatus < ID_STATUS_ONLINE && wNewStatus > ID_STATUS_OFFLINE)
- {
- UINT_PTR idTimer = SetTimer(0, 0, m_sOptions.wStartupDelay*1000, ConnectionTimerProcWrapper);
+ else {
+ if (wOldStatus < ID_STATUS_ONLINE && wNewStatus > ID_STATUS_OFFLINE) {
+ UINT_PTR idTimer = SetTimer(0, 0, m_sOptions.wStartupDelay * 1000, ConnectionTimerProcWrapper);
ProtoData protoData = { _strdup(szProtocol), idTimer };
m_mapTimerIdProto.push_back(protoData);
- }
+ }
}
return 0;
@@ -209,19 +202,19 @@ int CTooltipNotify::ContactSettingChanged(WPARAM hContact, LPARAM lParam) DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam;
if (!hContact)
return 0;
-
+
bool idle = false;
- if (mir_strcmp(cws->szSetting,"Status")==0)
+ if (mir_strcmp(cws->szSetting, "Status") == 0)
idle = false;
- else if (mir_strcmp(cws->szSetting,"IdleTS")==0)
+ else if (mir_strcmp(cws->szSetting, "IdleTS") == 0)
idle = true;
else return 0;
-
- if(db_get_b(hContact, "CList", "Hidden", 0))
+
+ if (db_get_b(hContact, "CList", "Hidden", 0))
return 0;
-
+
const char *pszProto = cws->szModule;
- if (db_get_b(NULL, MODULENAME, pszProto, ProtoUserBit|ProtoIntBit) != (ProtoUserBit|ProtoIntBit))
+ if (db_get_b(NULL, MODULENAME, pszProto, ProtoUserBit | ProtoIntBit) != (ProtoUserBit | ProtoIntBit))
return 0;
if (db_get_b(hContact, "CList", "NotOnList", 0) && m_sOptions.bIgnoreUnknown)
@@ -233,41 +226,40 @@ int CTooltipNotify::ContactSettingChanged(WPARAM hContact, LPARAM lParam) if (idle && !m_sOptions.bIdle)
return 0;
- WORD wNewStatus = cws->value.wVal;
- switch(wNewStatus)
- {
- case ID_STATUS_OFFLINE:
- if (!m_sOptions.bOffline) return 0;
- SkinPlaySound(SND_OFFLINE);
- break;
-
- case ID_STATUS_ONLINE:
- if(CallService(MS_IGNORE_ISIGNORED,hContact,IGNOREEVENT_USERONLINE) && m_sOptions.bConjSOLN) return 0;
- if (!m_sOptions.bOnline) return 0;
- SkinPlaySound(SND_ONLINE);
- break;
-
- default:
- if (!m_sOptions.bOther) return 0;
- SkinPlaySound(SND_OTHER);
- break;
+ WORD wNewStatus = cws->value.wVal;
+ switch (wNewStatus) {
+ case ID_STATUS_OFFLINE:
+ if (!m_sOptions.bOffline) return 0;
+ SkinPlaySound(SND_OFFLINE);
+ break;
+
+ case ID_STATUS_ONLINE:
+ if (CallService(MS_IGNORE_ISIGNORED, hContact, IGNOREEVENT_USERONLINE) && m_sOptions.bConjSOLN) return 0;
+ if (!m_sOptions.bOnline) return 0;
+ SkinPlaySound(SND_ONLINE);
+ break;
+
+ default:
+ if (!m_sOptions.bOther) return 0;
+ SkinPlaySound(SND_OTHER);
+ break;
}
STooltipData *pTooltipData = new STooltipData;
- pTooltipData->uiTimeout = m_sOptions.wDuration * (wNewStatus==ID_STATUS_ONLINE ? (m_sOptions.bX2+1):1);
+ pTooltipData->uiTimeout = m_sOptions.wDuration * (wNewStatus == ID_STATUS_ONLINE ? (m_sOptions.bX2 + 1) : 1);
pTooltipData->hContact = hContact;
-
- if (idle) wNewStatus = (wNewStatus!=0 ? ID_TTNTF_STATUS_IDLE : ID_TTNTF_STATUS_NOT_IDLE);
+
+ if (idle) wNewStatus = (wNewStatus != 0 ? ID_TTNTF_STATUS_IDLE : ID_TTNTF_STATUS_NOT_IDLE);
pTooltipData->iStatus = wNewStatus;
EndNotifyAll();
BeginNotify(pTooltipData);
- return 0;
+ return 0;
}
-int CTooltipNotify::InitializeOptions(WPARAM wParam, LPARAM lParam)
+int CTooltipNotify::InitializeOptions(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
odp.position = 100000000;
@@ -284,10 +276,10 @@ int CTooltipNotify::InitializeOptions(WPARAM wParam, LPARAM lParam) CTooltip *CTooltipNotify::BeginNotify(STooltipData *pTooltipData)
{
- TCHAR szTooltipText[64] = {0};
+ TCHAR szTooltipText[64] = { 0 };
MakeTooltipString(pTooltipData->hContact, pTooltipData->iStatus, szTooltipText, 64);
- LOGFONT lf = {0};
+ LOGFONT lf = { 0 };
COLORREF textColor = 0;
COLORREF bgColor = 0;
GetFont(pTooltipData->iStatus, &lf, &textColor, &bgColor);
@@ -307,7 +299,7 @@ CTooltip *CTooltipNotify::BeginNotify(STooltipData *pTooltipData) pTooltip->get_Rect(&TooltipRect);
if (m_sOptions.bAutoPos || Utils_RestoreWindowPosition(pTooltip->GetHandle(), 0, MODULENAME, "toolwindow", RWPF_NOSIZE | RWPF_NOACTIVATE))
- pTooltip->set_Position(WorkAreaRect.right - 10 - (TooltipRect.right-TooltipRect.left), WorkAreaRect.bottom - 2 - (TooltipRect.bottom-TooltipRect.top));
+ pTooltip->set_Position(WorkAreaRect.right - 10 - (TooltipRect.right - TooltipRect.left), WorkAreaRect.bottom - 2 - (TooltipRect.bottom - TooltipRect.top));
UINT_PTR idTimer = SetTimer(0, 0, pTooltipData->uiTimeout, TooltipTimerProcWrapper);
pTooltipData->idTimer = idTimer;
@@ -344,15 +336,12 @@ void CTooltipNotify::EndNotifyAll() // iterate through active tooltips and
// remove one which do not have its timer suspended
TooltipsList::reverse_iterator mapRevIter = m_TooltipsList.rbegin();
- while (mapRevIter != m_TooltipsList.rend())
- {
+ while (mapRevIter != m_TooltipsList.rend()) {
STooltipData* pTooltipData = *mapRevIter;
- if (EndNotify(pTooltipData))
- {
+ if (EndNotify(pTooltipData)) {
mapRevIter = m_TooltipsList.rbegin();
}
- else
- {
+ else {
++mapRevIter;
}
}
@@ -361,12 +350,10 @@ void CTooltipNotify::EndNotifyAll() CTooltipNotify::MapTimerIdProtoIter CTooltipNotify::FindProtoByTimer(UINT idTimer)
{
for (
- MapTimerIdProtoIter iter = m_mapTimerIdProto.begin();
- iter != m_mapTimerIdProto.end();
- ++iter)
- {
- if (iter->timerId == idTimer)
- {
+ MapTimerIdProtoIter iter = m_mapTimerIdProto.begin();
+ iter != m_mapTimerIdProto.end();
+ ++iter) {
+ if (iter->timerId == idTimer) {
return iter;
}
}
@@ -374,15 +361,15 @@ CTooltipNotify::MapTimerIdProtoIter CTooltipNotify::FindProtoByTimer(UINT idTime return m_mapTimerIdProto.end();
}
-void CTooltipNotify::OnConnectionTimer(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
+void CTooltipNotify::OnConnectionTimer(HWND, UINT, UINT_PTR idEvent, DWORD)
{
BOOL bSuccess = KillTimer(0, idEvent);
assert(bSuccess);
MapTimerIdProtoIter iter = FindProtoByTimer(idEvent);
- assert(iter!=m_mapTimerIdProto.end());
-
- BYTE bProtoActive = db_get_b(NULL, MODULENAME, iter->proto, ProtoUserBit|ProtoIntBit);
+ assert(iter != m_mapTimerIdProto.end());
+
+ BYTE bProtoActive = db_get_b(NULL, MODULENAME, iter->proto, ProtoUserBit | ProtoIntBit);
bProtoActive |= ProtoIntBit;
db_set_b(NULL, MODULENAME, iter->proto, bProtoActive);
@@ -391,10 +378,10 @@ void CTooltipNotify::OnConnectionTimer(HWND hwnd, UINT uMsg, UINT_PTR idEvent, D }
-void CTooltipNotify::OnTooltipTimer(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
+void CTooltipNotify::OnTooltipTimer(HWND, UINT, UINT_PTR idEvent, DWORD)
{
TooltipsList::iterator iter = FindBy(&STooltipData::idTimer, idEvent);
- assert(iter!=m_TooltipsList.end());
+ assert(iter != m_TooltipsList.end());
STooltipData* pTooltipData = *iter;
EndNotify(pTooltipData);
@@ -406,7 +393,7 @@ struct {
const char *szOldSetting, *szNewSetting;
}
-static arSettings[] =
+static arSettings[] =
{
{ "xpos", "toolwindowx" },
{ "ypos", "toolwindowy" }
@@ -414,7 +401,7 @@ static arSettings[] = void CTooltipNotify::MigrateSettings()
{
- for (int i=0; i < _countof(arSettings); i++) {
+ for (int i = 0; i < _countof(arSettings); i++) {
int val = db_get_w(NULL, MODULENAME, arSettings[i].szOldSetting, -1);
if (val != -1) {
db_set_w(NULL, MODULENAME, arSettings[i].szNewSetting, val);
@@ -426,7 +413,7 @@ void CTooltipNotify::MigrateSettings() /////////////////////////////////////////////////////////////////////////////////////////
void CTooltipNotify::LoadSettings()
-{
+{
m_sOptions.bFirstRun = db_get_b(NULL, MODULENAME, "firstrun", DEF_SETTING_FIRSTRUN);
m_sOptions.bOffline = db_get_b(NULL, MODULENAME, "offline", DEF_SETTING_OFFLINE);
m_sOptions.bOnline = db_get_b(NULL, MODULENAME, "online", DEF_SETTING_ONLINE);
@@ -443,9 +430,9 @@ void CTooltipNotify::LoadSettings() m_sOptions.bPrefixProto = db_get_b(NULL, MODULENAME, "prfxproto", DEF_SETTING_PREFIX_PROTO);
m_sOptions.bLDblClick = db_get_b(NULL, MODULENAME, "ldblclick", DEF_SETTING_LDBLCLICK);
m_sOptions.wDuration = db_get_w(NULL, MODULENAME, "duration", DEF_SETTING_DURATION);
- m_sOptions.wStartupDelay = db_get_w(NULL, MODULENAME, "suprconndelay", DEF_SETTING_STARTUP_DELAY);
- m_sOptions.bIgnoreUnknown = db_get_b(NULL, MODULENAME, "ignoreunknown", DEF_SETTING_IGNORE_UNKNOWN);
- m_sOptions.bIgnoreNew = db_get_b(NULL, MODULENAME, "ignorenew", DEF_SETTING_IGNORE_NEW);
+ m_sOptions.wStartupDelay = db_get_w(NULL, MODULENAME, "suprconndelay", DEF_SETTING_STARTUP_DELAY);
+ m_sOptions.bIgnoreUnknown = db_get_b(NULL, MODULENAME, "ignoreunknown", DEF_SETTING_IGNORE_UNKNOWN);
+ m_sOptions.bIgnoreNew = db_get_b(NULL, MODULENAME, "ignorenew", DEF_SETTING_IGNORE_NEW);
}
void CTooltipNotify::SaveSettings()
@@ -473,27 +460,27 @@ void CTooltipNotify::SaveSettings() void CTooltipNotify::ReadSettingsFromDlg(HWND hDlg)
{
- m_sOptions.bOffline = (BYTE)(IsDlgButtonChecked(hDlg, IDC_OFFLINE) == BST_CHECKED ? 1:0);
- m_sOptions.bOnline = (BYTE)(IsDlgButtonChecked(hDlg, IDC_ONLINE) == BST_CHECKED ? 1:0);
- m_sOptions.bOther = (BYTE)(IsDlgButtonChecked(hDlg, IDC_OTHER) == BST_CHECKED ? 1:0);
- m_sOptions.bTyping = (BYTE)(IsDlgButtonChecked(hDlg, IDC_TYPING) == BST_CHECKED ? 1:0);
- m_sOptions.bIdle = (BYTE)(IsDlgButtonChecked(hDlg, IDC_IDLE) == BST_CHECKED ? 1:0);
- m_sOptions.bX2 = (BYTE)(IsDlgButtonChecked(hDlg, IDC_X2) == BST_CHECKED ? 1:0);
- m_sOptions.bConjSOLN = (BYTE)(IsDlgButtonChecked(hDlg, IDC_CONJSOLN) == BST_CHECKED ? 1:0);
- m_sOptions.bAutoPos = (BYTE)(IsDlgButtonChecked(hDlg, IDC_AUTOPOS) == BST_CHECKED ? 1:0);
- m_sOptions.bBallonTip = (BYTE)(IsDlgButtonChecked(hDlg, IDC_BALLONTIP) == BST_CHECKED ? 1:0);
- m_sOptions.bTransp = (BYTE)(IsDlgButtonChecked(hDlg, IDC_TRANSPARENCY) == BST_CHECKED ? 1:0);
- m_sOptions.bAlpha = (BYTE)SendDlgItemMessage(hDlg,IDC_TRANSPARENCY_SLIDER,TBM_GETPOS,0,0);
- m_sOptions.bTranspInput = (BYTE)(IsDlgButtonChecked(hDlg, IDC_TRANSP_INPUT) == BST_CHECKED ? 1:0);
- m_sOptions.bPrefixProto = (BYTE)(IsDlgButtonChecked(hDlg, IDC_PREFIX_PROTO) == BST_CHECKED ? 1:0);
- m_sOptions.bLDblClick = (BYTE)(IsDlgButtonChecked(hDlg, IDC_RB_CLIST) == BST_CHECKED) ? SHOW_HIDE_CLIST:OPEN_MSGDLG;
+ m_sOptions.bOffline = (BYTE)(IsDlgButtonChecked(hDlg, IDC_OFFLINE) == BST_CHECKED ? 1 : 0);
+ m_sOptions.bOnline = (BYTE)(IsDlgButtonChecked(hDlg, IDC_ONLINE) == BST_CHECKED ? 1 : 0);
+ m_sOptions.bOther = (BYTE)(IsDlgButtonChecked(hDlg, IDC_OTHER) == BST_CHECKED ? 1 : 0);
+ m_sOptions.bTyping = (BYTE)(IsDlgButtonChecked(hDlg, IDC_TYPING) == BST_CHECKED ? 1 : 0);
+ m_sOptions.bIdle = (BYTE)(IsDlgButtonChecked(hDlg, IDC_IDLE) == BST_CHECKED ? 1 : 0);
+ m_sOptions.bX2 = (BYTE)(IsDlgButtonChecked(hDlg, IDC_X2) == BST_CHECKED ? 1 : 0);
+ m_sOptions.bConjSOLN = (BYTE)(IsDlgButtonChecked(hDlg, IDC_CONJSOLN) == BST_CHECKED ? 1 : 0);
+ m_sOptions.bAutoPos = (BYTE)(IsDlgButtonChecked(hDlg, IDC_AUTOPOS) == BST_CHECKED ? 1 : 0);
+ m_sOptions.bBallonTip = (BYTE)(IsDlgButtonChecked(hDlg, IDC_BALLONTIP) == BST_CHECKED ? 1 : 0);
+ m_sOptions.bTransp = (BYTE)(IsDlgButtonChecked(hDlg, IDC_TRANSPARENCY) == BST_CHECKED ? 1 : 0);
+ m_sOptions.bAlpha = (BYTE)SendDlgItemMessage(hDlg, IDC_TRANSPARENCY_SLIDER, TBM_GETPOS, 0, 0);
+ m_sOptions.bTranspInput = (BYTE)(IsDlgButtonChecked(hDlg, IDC_TRANSP_INPUT) == BST_CHECKED ? 1 : 0);
+ m_sOptions.bPrefixProto = (BYTE)(IsDlgButtonChecked(hDlg, IDC_PREFIX_PROTO) == BST_CHECKED ? 1 : 0);
+ m_sOptions.bLDblClick = (BYTE)(IsDlgButtonChecked(hDlg, IDC_RB_CLIST) == BST_CHECKED) ? SHOW_HIDE_CLIST : OPEN_MSGDLG;
m_sOptions.wDuration = LOWORD(SendDlgItemMessage(hDlg, IDC_DURATIONSPIN, UDM_GETPOS, 0, 0));
- m_sOptions.wStartupDelay = LOWORD(SendDlgItemMessage(hDlg, IDC_DELAYONCONNSPIN, UDM_GETPOS, 0, 0));
+ m_sOptions.wStartupDelay = LOWORD(SendDlgItemMessage(hDlg, IDC_DELAYONCONNSPIN, UDM_GETPOS, 0, 0));
}
void CTooltipNotify::WriteSettingsToDlg(HWND hDlg)
{
- SendDlgItemMessage(hDlg, IDC_DURATIONSPIN, UDM_SETRANGE, 0, MAKELONG(550*36, 550));
+ SendDlgItemMessage(hDlg, IDC_DURATIONSPIN, UDM_SETRANGE, 0, MAKELONG(550 * 36, 550));
SendDlgItemMessage(hDlg, IDC_DURATIONSPIN, UDM_SETPOS, 0, MAKELONG(m_sOptions.wDuration, 0));
SendDlgItemMessage(hDlg, IDC_DELAYONCONNSPIN, UDM_SETRANGE, 0, MAKELONG(30, 0));
SendDlgItemMessage(hDlg, IDC_DELAYONCONNSPIN, UDM_SETPOS, 0, MAKELONG(m_sOptions.wStartupDelay, 0));
@@ -511,11 +498,10 @@ void CTooltipNotify::WriteSettingsToDlg(HWND hDlg) CheckDlgButton(hDlg, IDC_TRANSPARENCY, m_sOptions.bTransp ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hDlg, IDC_TRANSP_INPUT, m_sOptions.bTranspInput ? BST_CHECKED : BST_UNCHECKED);
- switch(m_sOptions.bLDblClick)
- {
- case SHOW_HIDE_CLIST: CheckDlgButton(hDlg, IDC_RB_CLIST, BST_CHECKED); break;
- case OPEN_MSGDLG: CheckDlgButton(hDlg, IDC_RB_MSGDLG, BST_CHECKED); break;
- default: CheckDlgButton(hDlg, IDC_RB_CLIST, BST_CHECKED); break;
+ switch (m_sOptions.bLDblClick) {
+ case SHOW_HIDE_CLIST: CheckDlgButton(hDlg, IDC_RB_CLIST, BST_CHECKED); break;
+ case OPEN_MSGDLG: CheckDlgButton(hDlg, IDC_RB_MSGDLG, BST_CHECKED); break;
+ default: CheckDlgButton(hDlg, IDC_RB_CLIST, BST_CHECKED); break;
}
EnableWindow(GetDlgItem(hDlg, IDC_GB_TRANSP), m_bNt50);
@@ -523,251 +509,214 @@ void CTooltipNotify::WriteSettingsToDlg(HWND hDlg) EnableWindow(GetDlgItem(hDlg, IDC_TRANSPARENCY_SLIDER), m_sOptions.bTransp && m_bNt50);
EnableWindow(GetDlgItem(hDlg, IDC_TRANSPERC), m_sOptions.bTransp && m_bNt50);
EnableWindow(GetDlgItem(hDlg, IDC_TRANSP_INPUT), m_sOptions.bTransp && m_bNt50);
- //EnableWindow(GetDlgItem(hDlg, IDC_GB_DBLCLICK), m_sOptions.bTranspInput);
EnableWindow(GetDlgItem(hDlg, IDC_RB_CLIST), !m_sOptions.bTranspInput);
EnableWindow(GetDlgItem(hDlg, IDC_RB_MSGDLG), !m_sOptions.bTranspInput);
- SendDlgItemMessage(hDlg, IDC_TRANSPARENCY_SLIDER, TBM_SETRANGE, FALSE, MAKELONG(1,255));
+ SendDlgItemMessage(hDlg, IDC_TRANSPARENCY_SLIDER, TBM_SETRANGE, FALSE, MAKELONG(1, 255));
SendDlgItemMessage(hDlg, IDC_TRANSPARENCY_SLIDER, TBM_SETPOS, TRUE, m_sOptions.bAlpha);
}
-
void CTooltipNotify::ValidateSettings()
{
- if (m_sOptions.wStartupDelay>30) m_sOptions.wStartupDelay=30;
- if (m_sOptions.wDuration>550*36) m_sOptions.wDuration=550*36;
- if (m_sOptions.wDuration<550*1) m_sOptions.wDuration=550*1;
- if (!m_sOptions.bTransp) m_sOptions.bTranspInput=0;
+ if (m_sOptions.wStartupDelay > 30) m_sOptions.wStartupDelay = 30;
+ if (m_sOptions.wDuration > 550 * 36) m_sOptions.wDuration = 550 * 36;
+ if (m_sOptions.wDuration < 550 * 1) m_sOptions.wDuration = 550 * 1;
+ if (!m_sOptions.bTransp) m_sOptions.bTranspInput = 0;
}
-
// main options dialog
BOOL CTooltipNotify::OptionsDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- switch (msg)
- {
- case WM_INITDIALOG:
- {
- TranslateDialogDefault(hDlg);
- WriteSettingsToDlg(hDlg);
- SendMessage(hDlg, WM_HSCROLL, 0x12345678, 0);
+{
+ switch (msg) {
+ case WM_INITDIALOG:
+ TranslateDialogDefault(hDlg);
+ WriteSettingsToDlg(hDlg);
+ SendMessage(hDlg, WM_HSCROLL, 0x12345678, 0);
+ return TRUE;
+
+ case WM_VSCROLL:
+ case WM_HSCROLL:
+ TCHAR str[10];
+ mir_sntprintf(str, _countof(str), _T("%d%%"), 100 * SendDlgItemMessage(hDlg, IDC_TRANSPARENCY_SLIDER, TBM_GETPOS, 0, 0) / 255);
+ SetDlgItemText(hDlg, IDC_TRANSPERC, str);
+ if (wParam != 0x12345678)
+ SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0);
+ return TRUE;
+
+ case WM_COMMAND:
+ switch (LOWORD(wParam)) {
+ case IDC_TRANSPARENCY:
+ EnableWindow(GetDlgItem(hDlg, IDC_TRANSPERC), IsDlgButtonChecked(hDlg, IDC_TRANSPARENCY) == BST_CHECKED);
+ EnableWindow(GetDlgItem(hDlg, IDC_TRANSPARENCY_SLIDER), IsDlgButtonChecked(hDlg, IDC_TRANSPARENCY) == BST_CHECKED);
+ EnableWindow(GetDlgItem(hDlg, IDC_TRANSP_INPUT), IsDlgButtonChecked(hDlg, IDC_TRANSPARENCY) == BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_TRANSP_INPUT, IsDlgButtonChecked(hDlg, IDC_TRANSPARENCY) == BST_CHECKED ? (m_sOptions.bTranspInput ? BST_CHECKED : BST_UNCHECKED) : BST_UNCHECKED);
+ SendMessage(hDlg, WM_COMMAND, MAKEWPARAM(IDC_TRANSP_INPUT, 0), 0);
+ SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0);
+ break;
- return TRUE;
- }
+ case IDC_TRANSP_INPUT:
+ //EnableWindow(GetDlgItem(hDlg,IDC_GB_DBLCLICK), IsDlgButtonChecked(hDlg, IDC_TRANSP_INPUT));
+ EnableWindow(GetDlgItem(hDlg, IDC_RB_CLIST), !(IsDlgButtonChecked(hDlg, IDC_TRANSP_INPUT) == BST_CHECKED));
+ EnableWindow(GetDlgItem(hDlg, IDC_RB_MSGDLG), !(IsDlgButtonChecked(hDlg, IDC_TRANSP_INPUT) == BST_CHECKED));
+ SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0);
+ break;
- case WM_VSCROLL:
- case WM_HSCROLL:
- {
- TCHAR str[10];
- mir_sntprintf(str, _countof(str), _T("%d%%"), 100 * SendDlgItemMessage(hDlg, IDC_TRANSPARENCY_SLIDER, TBM_GETPOS, 0, 0) / 255);
- SetDlgItemText(hDlg, IDC_TRANSPERC, str);
- if(wParam!=0x12345678) SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0);
- return TRUE;
- }
+ case IDC_BALLONTIP:
+ EnableWindow(GetDlgItem(hDlg, IDC_DURATION), !(IsDlgButtonChecked(hDlg, IDC_BALLONTIP) == BST_CHECKED));
+ EnableWindow(GetDlgItem(hDlg, IDC_X2), !(IsDlgButtonChecked(hDlg, IDC_BALLONTIP) == BST_CHECKED));
+ EnableWindow(GetDlgItem(hDlg, IDC_RB_CLIST), !(IsDlgButtonChecked(hDlg, IDC_BALLONTIP) == BST_CHECKED));
+ EnableWindow(GetDlgItem(hDlg, IDC_RB_MSGDLG), !(IsDlgButtonChecked(hDlg, IDC_BALLONTIP) == BST_CHECKED));
+ EnableWindow(GetDlgItem(hDlg, IDC_TRANSP_INPUT), !(IsDlgButtonChecked(hDlg, IDC_BALLONTIP) == BST_CHECKED));
+ EnableWindow(GetDlgItem(hDlg, IDC_AUTOPOS), !(IsDlgButtonChecked(hDlg, IDC_BALLONTIP) == BST_CHECKED));
+ SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0);
+ break;
- case WM_COMMAND:
- {
- switch (LOWORD(wParam))
- {
- case IDC_TRANSPARENCY:
- EnableWindow(GetDlgItem(hDlg, IDC_TRANSPERC), IsDlgButtonChecked(hDlg, IDC_TRANSPARENCY) == BST_CHECKED);
- EnableWindow(GetDlgItem(hDlg, IDC_TRANSPARENCY_SLIDER), IsDlgButtonChecked(hDlg, IDC_TRANSPARENCY) == BST_CHECKED);
- EnableWindow(GetDlgItem(hDlg, IDC_TRANSP_INPUT), IsDlgButtonChecked(hDlg, IDC_TRANSPARENCY) == BST_CHECKED);
- CheckDlgButton(hDlg, IDC_TRANSP_INPUT, IsDlgButtonChecked(hDlg, IDC_TRANSPARENCY) == BST_CHECKED ? (m_sOptions.bTranspInput ? BST_CHECKED : BST_UNCHECKED) : BST_UNCHECKED);
- SendMessage(hDlg, WM_COMMAND, MAKEWPARAM(IDC_TRANSP_INPUT, 0), 0);
- SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0);
- break;
-
- case IDC_TRANSP_INPUT:
- //EnableWindow(GetDlgItem(hDlg,IDC_GB_DBLCLICK), IsDlgButtonChecked(hDlg, IDC_TRANSP_INPUT));
- EnableWindow(GetDlgItem(hDlg,IDC_RB_CLIST), !(IsDlgButtonChecked(hDlg, IDC_TRANSP_INPUT) == BST_CHECKED));
- EnableWindow(GetDlgItem(hDlg,IDC_RB_MSGDLG), !(IsDlgButtonChecked(hDlg, IDC_TRANSP_INPUT) == BST_CHECKED));
- SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0);
- break;
-
- case IDC_BALLONTIP:
- EnableWindow(GetDlgItem(hDlg,IDC_DURATION),!(IsDlgButtonChecked(hDlg,IDC_BALLONTIP)==BST_CHECKED));
- EnableWindow(GetDlgItem(hDlg,IDC_X2),!(IsDlgButtonChecked(hDlg,IDC_BALLONTIP)==BST_CHECKED));
- EnableWindow(GetDlgItem(hDlg,IDC_RB_CLIST),!(IsDlgButtonChecked(hDlg,IDC_BALLONTIP)==BST_CHECKED));
- EnableWindow(GetDlgItem(hDlg,IDC_RB_MSGDLG),!(IsDlgButtonChecked(hDlg,IDC_BALLONTIP)==BST_CHECKED));
- EnableWindow(GetDlgItem(hDlg,IDC_TRANSP_INPUT),!(IsDlgButtonChecked(hDlg,IDC_BALLONTIP)==BST_CHECKED));
- EnableWindow(GetDlgItem(hDlg,IDC_AUTOPOS),!(IsDlgButtonChecked(hDlg,IDC_BALLONTIP)==BST_CHECKED));
- SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0);
- break;
-
- case IDC_DURATION:
- if (HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus()) return FALSE;
- SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0);
- break;
-
- case IDC_DELAYONCONN:
- if (HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus()) return FALSE;
- SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0);
- break;
-
- case IDC_PREVIEW:
- {
- STooltipData *pTooltipData = new STooltipData;
- pTooltipData->uiTimeout = m_sOptions.wDuration * (m_sOptions.bX2 ? (m_sOptions.bX2+1):1);
- pTooltipData->hContact = 0;
- pTooltipData->iStatus = ID_STATUS_ONLINE;
-
- EndNotifyAll();
- BeginNotify(pTooltipData);
- break;
- }
-
- case IDC_SEL_PROTO:
- DialogBox(g_hInstDLL, MAKEINTRESOURCE(IDD_PROTOS), hDlg, CTooltipNotify::ProtosDlgProcWrapper);
- break;
-
- case IDC_IGNORE:
- DialogBox(g_hInstDLL, MAKEINTRESOURCE(IDD_CONTACTS), hDlg, CTooltipNotify::ContactsDlgProcWrapper);
- break;
-
- default:
- // activate 'apply' button
- SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0);
- return TRUE;
- }
-
- return TRUE;
- }
-
- case WM_NOTIFY:
- {
- //Here we have pressed either the OK or the APPLY button.
- switch(((LPNMHDR)lParam)->idFrom)
+ case IDC_DURATION:
+ if (HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus()) return FALSE;
+ SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0);
+ break;
+
+ case IDC_DELAYONCONN:
+ if (HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus()) return FALSE;
+ SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0);
+ break;
+
+ case IDC_PREVIEW:
{
- case 0:
- switch (((LPNMHDR)lParam)->code)
- {
- case PSN_APPLY:
- ReadSettingsFromDlg(hDlg);
- SaveSettings();
- return TRUE;
-
- } // switch code
+ STooltipData *pTooltipData = new STooltipData;
+ pTooltipData->uiTimeout = m_sOptions.wDuration * (m_sOptions.bX2 ? (m_sOptions.bX2 + 1) : 1);
+ pTooltipData->hContact = 0;
+ pTooltipData->iStatus = ID_STATUS_ONLINE;
+
+ EndNotifyAll();
+ BeginNotify(pTooltipData);
break;
+ }
- } //switch idFrom
+ case IDC_SEL_PROTO:
+ DialogBox(g_hInstDLL, MAKEINTRESOURCE(IDD_PROTOS), hDlg, CTooltipNotify::ProtosDlgProcWrapper);
+ break;
+
+ case IDC_IGNORE:
+ DialogBox(g_hInstDLL, MAKEINTRESOURCE(IDD_CONTACTS), hDlg, CTooltipNotify::ContactsDlgProcWrapper);
+ break;
+ default:
+ // activate 'apply' button
+ SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0);
return TRUE;
}
-
- default:
+ return TRUE;
+
+ case WM_NOTIFY:
+ // Here we have pressed either the OK or the APPLY button.
+ switch (((LPNMHDR)lParam)->idFrom) {
+ case 0:
+ switch (((LPNMHDR)lParam)->code) {
+ case PSN_APPLY:
+ ReadSettingsFromDlg(hDlg);
+ SaveSettings();
+ return TRUE;
+
+ } // switch code
break;
+ } //switch idFrom
+
+ return TRUE;
}
return FALSE;
-
}
-
// dialog for protocols selecting
-BOOL CTooltipNotify::ProtosDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- switch (msg)
- {
-
- case WM_INITDIALOG:
- {
- TranslateDialogDefault(hDlg);
+BOOL CTooltipNotify::ProtosDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM)
+{
+ switch (msg) {
- ListView_SetExtendedListViewStyle(GetDlgItem(hDlg, IDC_PROTOS), LVS_EX_CHECKBOXES);
-
- // enum protocols currently running
- int iProtoCount = 0;
- PROTOACCOUNT **ppProtos = 0;
- Proto_EnumAccounts(&iProtoCount, &ppProtos);
+ case WM_INITDIALOG:
+ TranslateDialogDefault(hDlg);
+ {
+ ListView_SetExtendedListViewStyle(GetDlgItem(hDlg, IDC_PROTOS), LVS_EX_CHECKBOXES);
- // and fill in the list
- for (int i=0; i < iProtoCount; i++)
- {
- LV_ITEM lvi;
+ // enum protocols currently running
+ int iProtoCount = 0;
+ PROTOACCOUNT **ppProtos = 0;
+ Proto_EnumAccounts(&iProtoCount, &ppProtos);
- lvi.mask = LVIF_TEXT;
- lvi.iSubItem = 0;
- lvi.iItem = i;
- lvi.lParam = i;
+ // and fill in the list
+ for (int i = 0; i < iProtoCount; i++) {
+ LV_ITEM lvi;
- WCHAR wszProto[128];
- long lLen = MultiByteToWideChar(CP_ACP, 0, ppProtos[i]->szModuleName,
- (int)mir_strlen(ppProtos[i]->szModuleName), wszProto, _countof(wszProto));
- wszProto[lLen] = L'\0';
+ lvi.mask = LVIF_TEXT;
+ lvi.iSubItem = 0;
+ lvi.iItem = i;
+ lvi.lParam = i;
- lvi.pszText = wszProto;
+ WCHAR wszProto[128];
+ long lLen = MultiByteToWideChar(CP_ACP, 0, ppProtos[i]->szModuleName,
+ (int)mir_strlen(ppProtos[i]->szModuleName), wszProto, _countof(wszProto));
+ wszProto[lLen] = L'\0';
- int new_item = ListView_InsertItem(GetDlgItem(hDlg,IDC_PROTOS),&lvi);
+ lvi.pszText = wszProto;
- BYTE bProtoState = db_get_b(NULL, MODULENAME, ppProtos[i]->szModuleName, ProtoUserBit|ProtoIntBit);
- BOOL bProtoEnabled = (bProtoState & ProtoUserBit) != 0;
- ListView_SetCheckState(GetDlgItem(hDlg,IDC_PROTOS), i, bProtoEnabled);
- }
+ ListView_InsertItem(GetDlgItem(hDlg, IDC_PROTOS), &lvi);
- return TRUE;
+ BYTE bProtoState = db_get_b(NULL, MODULENAME, ppProtos[i]->szModuleName, ProtoUserBit | ProtoIntBit);
+ BOOL bProtoEnabled = (bProtoState & ProtoUserBit) != 0;
+ ListView_SetCheckState(GetDlgItem(hDlg, IDC_PROTOS), i, bProtoEnabled);
}
+ }
+ return TRUE;
-
- case WM_COMMAND:
- {
- if (LOWORD(wParam) == IDOK)
- {
- int proto_count = ListView_GetItemCount(GetDlgItem(hDlg,IDC_PROTOS));
-
- for (int i=0; i < proto_count; i++)
- {
- TCHAR szProto[64];
-
- ListView_GetItemText(GetDlgItem(hDlg,IDC_PROTOS), i, 0, szProto, _countof(szProto));
+ case WM_COMMAND:
+ if (LOWORD(wParam) == IDOK) {
+ int proto_count = ListView_GetItemCount(GetDlgItem(hDlg, IDC_PROTOS));
- char szMultiByteProto[128];
- long lLen = WideCharToMultiByte(CP_ACP, 0, szProto, (int)mir_tstrlen(szProto),
- szMultiByteProto, sizeof(szMultiByteProto), NULL, NULL);
- szMultiByteProto[lLen] = '\0';
+ for (int i = 0; i < proto_count; i++) {
+ TCHAR szProto[64];
- BYTE bProtoState = db_get_b(NULL, MODULENAME, szMultiByteProto, ProtoUserBit|ProtoIntBit);
+ ListView_GetItemText(GetDlgItem(hDlg, IDC_PROTOS), i, 0, szProto, _countof(szProto));
+ char szMultiByteProto[128];
+ long lLen = WideCharToMultiByte(CP_ACP, 0, szProto, (int)mir_tstrlen(szProto),
+ szMultiByteProto, sizeof(szMultiByteProto), NULL, NULL);
+ szMultiByteProto[lLen] = '\0';
- BOOL bProtoEnabled = ListView_GetCheckState(GetDlgItem(hDlg,IDC_PROTOS), i);
- bProtoState = bProtoEnabled ? bProtoState|ProtoUserBit : bProtoState&~ProtoUserBit;
+ BYTE bProtoState = db_get_b(NULL, MODULENAME, szMultiByteProto, ProtoUserBit | ProtoIntBit);
- db_set_b(NULL, MODULENAME, szMultiByteProto, bProtoState);
-
- }
- EndDialog(hDlg, LOWORD(wParam));
- return TRUE;
- }
+ BOOL bProtoEnabled = ListView_GetCheckState(GetDlgItem(hDlg, IDC_PROTOS), i);
+ bProtoState = bProtoEnabled ? bProtoState | ProtoUserBit : bProtoState&~ProtoUserBit;
- if (LOWORD(wParam) == IDCANCEL)
- {
- EndDialog(hDlg, LOWORD(wParam));
- return TRUE;
- }
+ db_set_b(NULL, MODULENAME, szMultiByteProto, bProtoState);
- return TRUE;
}
- case WM_CLOSE:
EndDialog(hDlg, LOWORD(wParam));
return TRUE;
-
- default:
- break;
+ }
+
+ if (LOWORD(wParam) == IDCANCEL) {
+ EndDialog(hDlg, LOWORD(wParam));
+ return TRUE;
+ }
- } // switch (msg)
+ return TRUE;
- return FALSE;
+ case WM_CLOSE:
+ EndDialog(hDlg, LOWORD(wParam));
+ return TRUE;
+ }
+ return FALSE;
}
void CTooltipNotify::ResetCList(HWND hwndDlg)
{
- BOOL b = (CallService(MS_CLUI_GETCAPS, 0, 0) & CLUIF_DISABLEGROUPS &&
- db_get_b(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT));
- SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETUSEGROUPS, (WPARAM) b, 0);
+ BOOL b = (CallService(MS_CLUI_GETCAPS, 0, 0) & CLUIF_DISABLEGROUPS &&
+ db_get_b(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT));
+ SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETUSEGROUPS, (WPARAM)b, 0);
SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETHIDEEMPTYGROUPS, 1, 0);
}
@@ -775,30 +724,30 @@ void CTooltipNotify::ResetCList(HWND hwndDlg) void CTooltipNotify::LoadList(HWND hwndDlg, HANDLE hItemNew, HANDLE hItemUnknown)
{
if (hItemNew && !m_sOptions.bIgnoreNew)
- SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM) hItemNew, 1);
+ SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM)hItemNew, 1);
if (hItemUnknown && !m_sOptions.bIgnoreUnknown)
- SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM) hItemUnknown, 1);
+ SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM)hItemUnknown, 1);
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
- HANDLE hItem = (HANDLE) SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, hContact, 0);
+ HANDLE hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, hContact, 0);
if (hItem && !db_get_b(hContact, MODULENAME, CONTACT_IGNORE_TTNOTIFY, m_sOptions.bIgnoreNew))
- SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM) hItem, 1);
+ SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM)hItem, 1);
}
}
void CTooltipNotify::SaveList(HWND hwndDlg, HANDLE hItemNew, HANDLE hItemUnknown)
{
if (hItemNew)
- m_sOptions.bIgnoreNew = (BYTE) (SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM) hItemNew, 0) ? 0 : 1);
+ m_sOptions.bIgnoreNew = (BYTE)(SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM)hItemNew, 0) ? 0 : 1);
if (hItemUnknown)
- m_sOptions.bIgnoreUnknown = (BYTE) (SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM) hItemUnknown, 0) ? 0 : 1);
+ m_sOptions.bIgnoreUnknown = (BYTE)(SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM)hItemUnknown, 0) ? 0 : 1);
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
- HANDLE hItem = (HANDLE) SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, hContact, 0);
+ HANDLE hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, hContact, 0);
if (hItem) {
- BYTE bChecked = (BYTE) (SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM) hItem, 0));
+ BYTE bChecked = (BYTE)(SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM)hItem, 0));
db_set_b(hContact, MODULENAME, CONTACT_IGNORE_TTNOTIFY, bChecked ? 0 : 1);
}
}
@@ -806,76 +755,65 @@ void CTooltipNotify::SaveList(HWND hwndDlg, HANDLE hItemNew, HANDLE hItemUnknown // dialog for ignore tooltip notifications
-BOOL CTooltipNotify::ContactsDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
-{
+BOOL CTooltipNotify::ContactsDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM)
+{
static HANDLE hItemNew, hItemUnknown;
- switch (msg)
- {
- case WM_INITDIALOG:
- {
- TranslateDialogDefault(hDlg);
-
- CLCINFOITEM cii = { 0 };
- cii.cbSize = sizeof(cii);
- cii.flags = CLCIIF_GROUPFONT | CLCIIF_CHECKBOX;
- cii.pszText = TranslateT("** New contacts **");
- hItemNew = (HANDLE) SendDlgItemMessage(hDlg, IDC_CLIST, CLM_ADDINFOITEM, 0, (LPARAM) & cii);
- cii.pszText = TranslateT("** Unknown contacts **");
- hItemUnknown = (HANDLE) SendDlgItemMessage(hDlg, IDC_CLIST, CLM_ADDINFOITEM, 0, (LPARAM) & cii);
-
- ResetCList(hDlg);
- LoadList(hDlg, hItemNew, hItemUnknown);
- return TRUE;
- }
-
-
- case WM_COMMAND:
- {
- if (LOWORD(wParam) == IDOK)
- {
- SaveList(hDlg, hItemNew, hItemUnknown);
- EndDialog(hDlg, LOWORD(wParam));
- return TRUE;
- }
-
- if (LOWORD(wParam) == IDCANCEL)
- {
- EndDialog(hDlg, LOWORD(wParam));
- return TRUE;
- }
+ switch (msg) {
+ case WM_INITDIALOG:
+ TranslateDialogDefault(hDlg);
+ {
+ CLCINFOITEM cii = { 0 };
+ cii.cbSize = sizeof(cii);
+ cii.flags = CLCIIF_GROUPFONT | CLCIIF_CHECKBOX;
+ cii.pszText = TranslateT("** New contacts **");
+ hItemNew = (HANDLE)SendDlgItemMessage(hDlg, IDC_CLIST, CLM_ADDINFOITEM, 0, (LPARAM)& cii);
+ cii.pszText = TranslateT("** Unknown contacts **");
+ hItemUnknown = (HANDLE)SendDlgItemMessage(hDlg, IDC_CLIST, CLM_ADDINFOITEM, 0, (LPARAM)& cii);
+
+ ResetCList(hDlg);
+ LoadList(hDlg, hItemNew, hItemUnknown);
+ }
+ return TRUE;
- return TRUE;
- }
+ case WM_COMMAND:
+ if (LOWORD(wParam) == IDOK) {
+ SaveList(hDlg, hItemNew, hItemUnknown);
+ EndDialog(hDlg, LOWORD(wParam));
+ return TRUE;
+ }
- case WM_CLOSE:
+ if (LOWORD(wParam) == IDCANCEL) {
EndDialog(hDlg, LOWORD(wParam));
return TRUE;
-
- default:
- break;
+ }
+
+ return TRUE;
- } // switch (msg)
+ case WM_CLOSE:
+ EndDialog(hDlg, LOWORD(wParam));
+ return TRUE;
+ }
return FALSE;
}
-TCHAR *CTooltipNotify::StatusToString(int iStatus, TCHAR *szStatus, int iBufSize)
+TCHAR* CTooltipNotify::StatusToString(int iStatus, TCHAR *szStatus, int iBufSize)
{
if (iStatus >= ID_STATUS_OFFLINE && iStatus <= ID_STATUS_OUTTOLUNCH)
mir_tstrncpy(szStatus, pcli->pfnGetStatusModeDescription(iStatus, 0), iBufSize);
else {
- switch(iStatus) {
- case ID_TTNTF_STATUS_TYPING:
+ switch (iStatus) {
+ case ID_TTNTF_STATUS_TYPING:
mir_tstrncpy(szStatus, TranslateT("Typing"), iBufSize);
break;
- case ID_TTNTF_STATUS_IDLE:
+ case ID_TTNTF_STATUS_IDLE:
mir_tstrncpy(szStatus, TranslateT("Idle"), iBufSize);
break;
- case ID_TTNTF_STATUS_NOT_IDLE:
+ case ID_TTNTF_STATUS_NOT_IDLE:
mir_tstrncpy(szStatus, TranslateT("Not Idle"), iBufSize);
break;
@@ -887,7 +825,7 @@ TCHAR *CTooltipNotify::StatusToString(int iStatus, TCHAR *szStatus, int iBufSize return szStatus;
}
-TCHAR *CTooltipNotify::MakeTooltipString(MCONTACT hContact, int iStatus, TCHAR *szString, int iBufSize)
+TCHAR* CTooltipNotify::MakeTooltipString(MCONTACT hContact, int iStatus, TCHAR *szString, int iBufSize)
{
TCHAR szStatus[32];
StatusToString(iStatus, szStatus, _countof(szStatus));
@@ -896,9 +834,9 @@ TCHAR *CTooltipNotify::MakeTooltipString(MCONTACT hContact, int iStatus, TCHAR * const TCHAR *szFormatString = m_sOptions.bPrefixProto ? _T("%s%s%s") : _T("%.0s%.0s%s");
const TCHAR* szIs = TranslateT("is");
- const char* szProto =
- hContact==0 ? "Proto" : (char*)::GetContactProto(hContact);
- const TCHAR* szContactName =
+ const char* szProto =
+ hContact == 0 ? "Proto" : (char*)::GetContactProto(hContact);
+ const TCHAR* szContactName =
(TCHAR *)::pcli->pfnGetContactDisplayName(hContact, 0);
memset(szString, 0, iBufSize*sizeof(TCHAR));
@@ -911,7 +849,7 @@ TCHAR *CTooltipNotify::MakeTooltipString(MCONTACT hContact, int iStatus, TCHAR * mir_sntprintf(szString, iBufSize - 1, szFormatString, wszProto, _T(": "), szContactName);
- TruncateWithDots(szString, iBufSize-1-mir_tstrlen(szStatus)-mir_tstrlen(szIs)-2); // 2 spaces around szIs
+ TruncateWithDots(szString, iBufSize - 1 - mir_tstrlen(szStatus) - mir_tstrlen(szIs) - 2); // 2 spaces around szIs
mir_sntprintf(szString + mir_tstrlen(szString), iBufSize - 1 - mir_tstrlen(szString), _T(" %s %s"), szIs, szStatus);
return szString;
@@ -920,13 +858,12 @@ TCHAR *CTooltipNotify::MakeTooltipString(MCONTACT hContact, int iStatus, TCHAR * void CTooltipNotify::OnTooltipDblClicked(CTooltip *pTooltip)
{
- switch(m_sOptions.bLDblClick)
- {
- case SHOW_HIDE_CLIST:
- ::CallService(MS_CLIST_SHOWHIDE,0,0);
- break;
+ switch (m_sOptions.bLDblClick) {
+ case SHOW_HIDE_CLIST:
+ ::CallService(MS_CLIST_SHOWHIDE, 0, 0);
+ break;
- case OPEN_MSGDLG:
+ case OPEN_MSGDLG:
{
TooltipsList::iterator iter = FindBy(&STooltipData::pTooltip, pTooltip);
STooltipData* pTooltipData = *iter;
@@ -935,10 +872,10 @@ void CTooltipNotify::OnTooltipDblClicked(CTooltip *pTooltip) break;
}
- default:
- ::CallService(MS_CLIST_SHOWHIDE,0,0);
- break;
- }
+ default:
+ ::CallService(MS_CLIST_SHOWHIDE, 0, 0);
+ break;
+ }
}
@@ -961,7 +898,7 @@ void CTooltipNotify::OnTooltipEndMove(CTooltip *pTooltip) void CTooltipNotify::SuspendTimer(CTooltip *pTooltip)
{
TooltipsList::iterator iter = FindBy(&STooltipData::pTooltip, pTooltip);
- assert(iter!=m_TooltipsList.end());
+ assert(iter != m_TooltipsList.end());
STooltipData* pTooltipData = *iter;
@@ -974,27 +911,21 @@ void CTooltipNotify::SuspendTimer(CTooltip *pTooltip) void CTooltipNotify::ResumeTimer(CTooltip *pTooltip)
{
TooltipsList::iterator iter = FindBy(&STooltipData::pTooltip, pTooltip);
- assert(iter!=m_TooltipsList.end());
+ assert(iter != m_TooltipsList.end());
STooltipData* pTooltipData = *iter;
- UINT_PTR idTimer = SetTimer(0, 0, pTooltipData->uiTimeout, TooltipTimerProcWrapper);
+ UINT_PTR idTimer = SetTimer(0, 0, pTooltipData->uiTimeout, TooltipTimerProcWrapper);
pTooltipData->idTimer = idTimer;
}
template<typename T>
CTooltipNotify::TooltipsList::iterator CTooltipNotify::FindBy(T STooltipData::* field, const T& value)
{
- for (
- TooltipsList::iterator iter = m_TooltipsList.begin();
- iter != m_TooltipsList.end();
- ++iter)
- {
+ for (TooltipsList::iterator iter = m_TooltipsList.begin(); iter != m_TooltipsList.end(); ++iter) {
STooltipData *pTooltipData = *iter;
if (pTooltipData->*field == value)
- {
return iter;
- }
}
return m_TooltipsList.end();
diff --git a/plugins/TooltipNotify/src/Utils.cpp b/plugins/TooltipNotify/src/Utils.cpp index 0142470143..c0d4a25fc8 100644 --- a/plugins/TooltipNotify/src/Utils.cpp +++ b/plugins/TooltipNotify/src/Utils.cpp @@ -8,8 +8,6 @@ BOOL IsNt50() {
WORD wOsVersion = LOWORD(GetVersion());
BYTE bMajorVer = LOBYTE(wOsVersion);
- BYTE bMinorVer = HIBYTE(wOsVersion);
-
return (bMajorVer>=5);
}
diff --git a/plugins/TooltipNotify/src/main.cpp b/plugins/TooltipNotify/src/main.cpp index 24c2e25929..e32673ce22 100644 --- a/plugins/TooltipNotify/src/main.cpp +++ b/plugins/TooltipNotify/src/main.cpp @@ -27,7 +27,7 @@ CLIST_INTERFACE *pcli; // plugin init/deinit routines
//================================================================================
-BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpvReserved)
+BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD, LPVOID)
{
g_hInstDLL = hInstDLL;
return TRUE;
@@ -48,7 +48,7 @@ static PLUGININFOEX sPluginInfo = {0x5906a545, 0xf31a, 0x4726, {0xb4, 0x8f, 0x3, 0xa0, 0x9f, 0x6, 0x3, 0x18}}
};
-extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &sPluginInfo;
}
diff --git a/plugins/TooltipNotify/ttnotify.vcxproj b/plugins/TooltipNotify/ttnotify.vcxproj index 0bfbcded39..f45cf0abf2 100644 --- a/plugins/TooltipNotify/ttnotify.vcxproj +++ b/plugins/TooltipNotify/ttnotify.vcxproj @@ -25,4 +25,9 @@ <ImportGroup Label="PropertySheets">
<Import Project="$(ProjectDir)..\..\build\vc.common\plugin.props" />
</ImportGroup>
+ <ItemDefinitionGroup>
+ <ClCompile>
+ <ExceptionHandling>Sync</ExceptionHandling>
+ </ClCompile>
+ </ItemDefinitionGroup>
</Project>
\ No newline at end of file diff --git a/plugins/TopToolBar/src/toolbar.cpp b/plugins/TopToolBar/src/toolbar.cpp index 3d9e737351..650e2d03d4 100644 --- a/plugins/TopToolBar/src/toolbar.cpp +++ b/plugins/TopToolBar/src/toolbar.cpp @@ -207,8 +207,8 @@ int ArrangeButtons() return 0;
int nLineCount = 0;
- int i, ypos = 1, xpos = g_ctrl->nButtonSpace, nextX = 0, y = 0;
- int newheight = g_ctrl->nButtonHeight + 1, nButtonCount = 0;
+ int i, nextX = 0, y = 0;
+ int nButtonCount = 0;
for (i = 0; i < Buttons.getCount(); i++)
if (Buttons[i]->hwnd)
@@ -243,8 +243,6 @@ int ArrangeButtons() bWasButttonBefore = !b->isSep();
}
- int nFreeSpace = nBarSize - nUsedWidth;
-
for (i = iFirstButtonId; i < iLastButtonId; i++) {
TopButtonInt *b = Buttons[i];
if (b->hwnd == NULL)
diff --git a/plugins/TopToolBar/src/toolbarwnd.cpp b/plugins/TopToolBar/src/toolbarwnd.cpp index bb3cc61918..88e2442851 100644 --- a/plugins/TopToolBar/src/toolbarwnd.cpp +++ b/plugins/TopToolBar/src/toolbarwnd.cpp @@ -22,7 +22,6 @@ static void PaintToolbar(HWND hwnd) GetClientRect(hwnd, &clRect);
int yScroll = 0;
- int y = -yScroll;
HDC hdcMem = CreateCompatibleDC(hdc);
HBITMAP hBmpOsb = CreateBitmap(clRect.right, clRect.bottom, 1, GetDeviceCaps(hdc, BITSPIXEL), NULL);
diff --git a/plugins/TrafficCounter/src/TrafficCounter.cpp b/plugins/TrafficCounter/src/TrafficCounter.cpp index 511e6d5266..9a61516f8c 100644 --- a/plugins/TrafficCounter/src/TrafficCounter.cpp +++ b/plugins/TrafficCounter/src/TrafficCounter.cpp @@ -114,12 +114,12 @@ PLUGININFOEX pluginInfoEx = {0x82181510, 0x5dfa, 0x49d7, {0xb4, 0x69, 0x33, 0x87, 0x1e, 0x2a, 0xe8, 0xb5}}
};
-extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD mirandaVersion)
+extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD)
{
return &pluginInfoEx;
}
-BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
+BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
{
hInst = hinstDLL;
DisableThreadLibraryCalls(hInst);
@@ -157,7 +157,7 @@ extern "C" int __declspec(dllexport) Unload(void) return 0;
}
-int TrafficCounterShutdown(WPARAM wParam, LPARAM lParam)
+int TrafficCounterShutdown(WPARAM, LPARAM)
{
KillTimer(TrafficHwnd, TIMER_REDRAW);
KillTimer(TrafficHwnd, TIMER_NOTIFY_TICK);
@@ -185,7 +185,7 @@ int TrafficCounterShutdown(WPARAM wParam, LPARAM lParam) return 0;
}
-int ModuleLoad(WPARAM wParam, LPARAM lParam)
+int ModuleLoad(WPARAM, LPARAM)
{
bPopupExists = ServiceExists(MS_POPUP_ADDPOPUPT);
bVariablesExists = ServiceExists(MS_VARS_FORMATSTRING) && ServiceExists(MS_VARS_REGISTERTOKEN);
@@ -193,7 +193,7 @@ int ModuleLoad(WPARAM wParam, LPARAM lParam) return 0;
}
-int TrafficCounterModulesLoaded(WPARAM wParam, LPARAM lParam)
+int TrafficCounterModulesLoaded(WPARAM, LPARAM)
{
DBVARIANT dbv;
@@ -370,7 +370,7 @@ int TrafficSend(WPARAM wParam, LPARAM lParam) return 0;
}
-int TrafficCounter_PaintCallbackProc(HWND hWnd, HDC hDC, RECT * rcPaint, HRGN rgn, DWORD dFlags, void * CallBackData)
+int TrafficCounter_PaintCallbackProc(HWND hWnd, HDC hDC, RECT*, HRGN, DWORD, void*)
{
return TrafficCounter_Draw(hWnd, hDC);
}
@@ -1033,7 +1033,7 @@ void CreateTrafficWindow(HWND hCluiWnd) UpdateNotifyTimer();
}
-INT_PTR MenuCommand_TrafficShowHide(WPARAM wParam, LPARAM lParam)
+INT_PTR MenuCommand_TrafficShowHide(WPARAM, LPARAM)
{
unOptions.FrameIsVisible = !unOptions.FrameIsVisible;
if (Traffic_FrameID == NULL)
@@ -1150,7 +1150,7 @@ void DestroyProtocolList(void) mir_free(ProtoList);
}
-int ProtocolAckHook(WPARAM wParam, LPARAM lParam)
+int ProtocolAckHook(WPARAM, LPARAM lParam)
{
ACKDATA* pAck = (ACKDATA*)lParam;
WORD i;
@@ -1178,7 +1178,7 @@ int ProtocolAckHook(WPARAM wParam, LPARAM lParam) return 0;
}
-int UpdateFonts(WPARAM wParam, LPARAM lParam)
+int UpdateFonts(WPARAM, LPARAM)
{
LOGFONT logfont;
//if no font service
@@ -1208,11 +1208,9 @@ void UpdateTrafficWindowSize(void) unsigned short int TrafficWindowHeight(void)
{
- BYTE HeightLineTime = (unOptions.DrawProtoIcon) ? 16 : TrafficFontHeight,
- i, ActProto;
- WORD MaxWndHeight;
+ int ActProto, MaxWndHeight;
- for (i = 0, ActProto = unOptions.ShowOverall + unOptions.ShowSummary; i < NumberOfAccounts; i++)
+ for (int i = 0, ActProto = unOptions.ShowOverall + unOptions.ShowSummary; i < NumberOfAccounts; i++)
ActProto += ProtoList[i].Visible && ProtoList[i].Enabled;
// Âûñîòà ñòðîêè ìèíèìóì 16 ïèêñåëåé (äëÿ èêîíêè).
diff --git a/plugins/TrafficCounter/src/options.cpp b/plugins/TrafficCounter/src/options.cpp index 449ef3b315..3a4c6e8532 100644 --- a/plugins/TrafficCounter/src/options.cpp +++ b/plugins/TrafficCounter/src/options.cpp @@ -339,7 +339,7 @@ static INT_PTR CALLBACK DlgProcTCOptions(HWND hwndDlg, UINT msg, WPARAM wParam, return 0;
}
-int TrafficCounterOptInitialise(WPARAM wParam,LPARAM lParam)
+int TrafficCounterOptInitialise(WPARAM wParam, LPARAM)
{
// Main options page
OPTIONSDIALOGPAGE odp = { 0 };
diff --git a/plugins/TrafficCounter/src/opttree.cpp b/plugins/TrafficCounter/src/opttree.cpp index 8189b5d7f5..09447b2c85 100644 --- a/plugins/TrafficCounter/src/opttree.cpp +++ b/plugins/TrafficCounter/src/opttree.cpp @@ -159,7 +159,7 @@ HTREEITEM OptTree_AddItem(HWND hwndTree, TCHAR *name, LPARAM lParam, int iconInd return result;
}
-BOOL OptTree_ProcessMessage(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, BOOL *result, int idcTree, OPTTREE_OPTION *options, int optionCount)
+BOOL OptTree_ProcessMessage(HWND hwnd, UINT msg, WPARAM, LPARAM lparam, BOOL*, int idcTree, OPTTREE_OPTION *options, int optionCount)
{
enum { IMG_GROUP, IMG_CHECK, IMG_NOCHECK, IMG_RCHECK, IMG_NORCHECK, IMG_GRPOPEN, IMG_GRPCLOSED };
diff --git a/plugins/TrafficCounter/src/statistics.cpp b/plugins/TrafficCounter/src/statistics.cpp index d8ef8fac80..511b6344b5 100644 --- a/plugins/TrafficCounter/src/statistics.cpp +++ b/plugins/TrafficCounter/src/statistics.cpp @@ -298,7 +298,7 @@ void Stat_ReadFile(BYTE n) LARGE_INTEGER Size;
DWORD BytesRead;
TCHAR FileName[MAX_PATH], *pszPath;
- SYSTEMTIME stNow, stLast = { 0 };
+ SYSTEMTIME stNow;
pszPath = Utils_ReplaceVarsT(_T("%miranda_userdata%\\statistics"));
CreateDirectoryTreeT(pszPath);
@@ -608,7 +608,8 @@ DWORD Stat_GetItemValue(WORD SelectedAccs, BYTE Interval, DWORD ItemNum, BYTE Su }
IndexM++; IndexP++; // Ïåðåõîäèì ê ñëåäóþùåé çàïèñè.
- if (IndexM == ProtoList[a].NumberOfRecords) break;
+ if (IndexM == ProtoList[a].NumberOfRecords)
+ break;
// Êîãäà îñòàíîâèòüñÿ?
switch (Interval) {
diff --git a/plugins/UserGuide/src/main.cpp b/plugins/UserGuide/src/main.cpp index d07a3fd80b..f881f93ead 100644 --- a/plugins/UserGuide/src/main.cpp +++ b/plugins/UserGuide/src/main.cpp @@ -66,15 +66,13 @@ static INT_PTR ShowGuideFile(WPARAM, LPARAM) return 0;
}
-
-BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
+BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
{
hInst = hinstDLL;
return TRUE;
}
-
-extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfo;
}
diff --git a/plugins/UserInfoEx/src/classPsTree.cpp b/plugins/UserInfoEx/src/classPsTree.cpp index b05f8961ab..2a1b12d2ea 100644 --- a/plugins/UserInfoEx/src/classPsTree.cpp +++ b/plugins/UserInfoEx/src/classPsTree.cpp @@ -790,22 +790,22 @@ void CPsTree::PopupMenu() switch (iItem) { // hide the item - case 32000: - HideItem(tvi.lParam); - break; + case 32000: + HideItem(tvi.lParam); + break; // rename the item - case 32001: - BeginLabelEdit(tvi.hItem); - break; + case 32001: + BeginLabelEdit(tvi.hItem); + break; // reset current tree - case 32004: - DBResetState(); - break; + case 32004: + DBResetState(); + break; // show a hidden item - default: - if ((iItem -= 100) >= 0 && ShowItem(iItem, NULL)) - AddFlags(PSTVF_STATE_CHANGED|PSTVF_POS_CHANGED); - break; + default: + if ((iItem -= 100) >= 0 && ShowItem(iItem, NULL)) + AddFlags(PSTVF_STATE_CHANGED | PSTVF_POS_CHANGED); + break; } } diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp index 61ff1f1521..ca7fdc4a25 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp @@ -159,9 +159,7 @@ size_t CLineBuffer::operator + (const CHAR *szVal) size_t CLineBuffer::operator + (const WCHAR *wszVal)
{
if (wszVal) {
- size_t cbLength = mir_wstrlen(wszVal);
CHAR* szVal = mir_u2a(wszVal);
-
if (szVal) {
size_t cbLength = mir_strlen(szVal);
diff --git a/plugins/UserInfoEx/src/mir_menuitems.cpp b/plugins/UserInfoEx/src/mir_menuitems.cpp index 3f87c2e539..2c96b97869 100644 --- a/plugins/UserInfoEx/src/mir_menuitems.cpp +++ b/plugins/UserInfoEx/src/mir_menuitems.cpp @@ -278,7 +278,6 @@ void RebuildGroup() {
int flag = 0;
BYTE item = 0;
- GroupMenuParam gmp = { 0 };
HGENMENU mhRoot = NULL;
HGENMENU mhExIm = NULL;
diff --git a/plugins/Utils/mir_options.cpp b/plugins/Utils/mir_options.cpp index b65b7645e6..90e5e65c30 100644 --- a/plugins/Utils/mir_options.cpp +++ b/plugins/Utils/mir_options.cpp @@ -190,51 +190,51 @@ INT_PTR CALLBACK SaveOptsDlgProc(OptPageControl *controls, int controlsSize, cha break;
case CONTROL_PROTOCOL_LIST:
- {
- // Fill list view
- HWND hwndProtocols = GetDlgItem(hwndDlg, ctrl->nID);
- LVCOLUMN lvc;
- LVITEM lvi;
+ {
+ // Fill list view
+ HWND hwndProtocols = GetDlgItem(hwndDlg, ctrl->nID);
+ LVCOLUMN lvc;
+ LVITEM lvi;
- ListView_SetExtendedListViewStyle(hwndProtocols, LVS_EX_CHECKBOXES);
+ ListView_SetExtendedListViewStyle(hwndProtocols, LVS_EX_CHECKBOXES);
- memset(&lvc, 0, sizeof(lvc));
- lvc.mask = LVCF_FMT;
- lvc.fmt = LVCFMT_IMAGE | LVCFMT_LEFT;
- ListView_InsertColumn(hwndProtocols, 0, &lvc);
+ memset(&lvc, 0, sizeof(lvc));
+ lvc.mask = LVCF_FMT;
+ lvc.fmt = LVCFMT_IMAGE | LVCFMT_LEFT;
+ ListView_InsertColumn(hwndProtocols, 0, &lvc);
- memset(&lvi, 0, sizeof(lvi));
- lvi.mask = LVIF_TEXT | LVIF_PARAM;
- lvi.iSubItem = 0;
- lvi.iItem = 1000;
+ memset(&lvi, 0, sizeof(lvi));
+ lvi.mask = LVIF_TEXT | LVIF_PARAM;
+ lvi.iSubItem = 0;
+ lvi.iItem = 1000;
- int count;
- PROTOACCOUNT **protos;
- Proto_EnumAccounts(&count, &protos);
+ int count;
+ PROTOACCOUNT **protos;
+ Proto_EnumAccounts(&count, &protos);
- for (int i = 0; i < count; i++) {
- PROTOACCOUNT *p = protos[i];
- if (p->szModuleName == NULL || p->szModuleName[0] == '\0')
- continue;
+ for (int i = 0; i < count; i++) {
+ PROTOACCOUNT *p = protos[i];
+ if (p->szModuleName == NULL || p->szModuleName[0] == '\0')
+ continue;
- if (ctrl->allowProtocol != NULL && !ctrl->allowProtocol(p->szModuleName))
- continue;
+ if (ctrl->allowProtocol != NULL && !ctrl->allowProtocol(p->szModuleName))
+ continue;
- char *setting = (char *)mir_alloc(128 * sizeof(char));
- mir_snprintf(setting, 128, ctrl->setting, p->szModuleName);
+ char *setting = (char *)mir_alloc(128 * sizeof(char));
+ mir_snprintf(setting, 128, ctrl->setting, p->szModuleName);
- BOOL show = (BOOL)db_get_b(NULL, module, setting, ctrl->dwDefValue);
+ BOOL show = (BOOL)db_get_b(NULL, module, setting, ctrl->dwDefValue);
- lvi.lParam = (LPARAM)setting;
- lvi.pszText = p->tszAccountName;
- lvi.iItem = ListView_InsertItem(hwndProtocols, &lvi);
- ListView_SetItemState(hwndProtocols, lvi.iItem, INDEXTOSTATEIMAGEMASK(show ? 2 : 1), LVIS_STATEIMAGEMASK);
- }
+ lvi.lParam = (LPARAM)setting;
+ lvi.pszText = p->tszAccountName;
+ lvi.iItem = ListView_InsertItem(hwndProtocols, &lvi);
+ ListView_SetItemState(hwndProtocols, lvi.iItem, INDEXTOSTATEIMAGEMASK(show ? 2 : 1), LVIS_STATEIMAGEMASK);
+ }
- ListView_SetColumnWidth(hwndProtocols, 0, LVSCW_AUTOSIZE);
- ListView_Arrange(hwndProtocols, LVA_ALIGNLEFT | LVA_ALIGNTOP);
- }
- break;
+ ListView_SetColumnWidth(hwndProtocols, 0, LVSCW_AUTOSIZE);
+ ListView_Arrange(hwndProtocols, LVA_ALIGNLEFT | LVA_ALIGNTOP);
+ }
+ break;
case CONTROL_TEXT:
SetDlgItemText(hwndDlg, ctrl->nID, MyDBGetContactSettingTString(NULL, module, ctrl->setting, tmp, 1024, ctrl->tszDefValue == NULL ? NULL : TranslateTS(ctrl->tszDefValue)));
@@ -308,122 +308,122 @@ INT_PTR CALLBACK SaveOptsDlgProc(OptPageControl *controls, int controlsSize, cha break;
case WM_NOTIFY:
- {
- LPNMHDR lpnmhdr = (LPNMHDR)lParam;
- if (lpnmhdr->idFrom == 0 && lpnmhdr->code == PSN_APPLY) {
- for (int i = 0; i < controlsSize; i++) {
- OptPageControl *ctrl = &controls[i];
-
- if (GetDlgItem(hwndDlg, ctrl->nID) == NULL)
- continue;
-
- switch (ctrl->type) {
- case CONTROL_CHECKBOX:
- db_set_b(NULL, module, ctrl->setting, (BYTE)IsDlgButtonChecked(hwndDlg, ctrl->nID));
- break;
-
- case CONTROL_SPIN:
- db_set_w(NULL, module, ctrl->setting, (WORD)SendDlgItemMessage(hwndDlg, ctrl->nIDSpin, UDM_GETPOS, 0, 0));
- break;
-
- case CONTROL_COLOR:
- db_set_dw(NULL, module, ctrl->setting, (DWORD)SendDlgItemMessage(hwndDlg, ctrl->nID, CPM_GETCOLOUR, 0, 0));
- break;
-
- case CONTROL_RADIO:
- if (IsDlgButtonChecked(hwndDlg, ctrl->nID))
- db_set_w(NULL, module, ctrl->setting, (BYTE)ctrl->value);
- break;
-
- case CONTROL_COMBO:
- db_set_w(NULL, module, ctrl->setting, (WORD)SendDlgItemMessage(hwndDlg, ctrl->nID, CB_GETCURSEL, 0, 0));
- break;
-
- case CONTROL_PROTOCOL_LIST:
- {
- LVITEM lvi = { 0 };
- HWND hwndProtocols = GetDlgItem(hwndDlg, ctrl->nID);
- int i;
-
- lvi.mask = (UINT)LVIF_PARAM;
+ {
+ LPNMHDR lpnmhdr = (LPNMHDR)lParam;
+ if (lpnmhdr->idFrom == 0 && lpnmhdr->code == PSN_APPLY) {
+ for (int i = 0; i < controlsSize; i++) {
+ OptPageControl *ctrl = &controls[i];
- for (i = 0; i < ListView_GetItemCount(hwndProtocols); i++) {
- lvi.iItem = i;
- ListView_GetItem(hwndProtocols, &lvi);
+ if (GetDlgItem(hwndDlg, ctrl->nID) == NULL)
+ continue;
- char *setting = (char *)lvi.lParam;
- db_set_b(NULL, module, setting, (BYTE)ListView_GetCheckState(hwndProtocols, i));
+ switch (ctrl->type) {
+ case CONTROL_CHECKBOX:
+ db_set_b(NULL, module, ctrl->setting, (BYTE)IsDlgButtonChecked(hwndDlg, ctrl->nID));
+ break;
+
+ case CONTROL_SPIN:
+ db_set_w(NULL, module, ctrl->setting, (WORD)SendDlgItemMessage(hwndDlg, ctrl->nIDSpin, UDM_GETPOS, 0, 0));
+ break;
+
+ case CONTROL_COLOR:
+ db_set_dw(NULL, module, ctrl->setting, (DWORD)SendDlgItemMessage(hwndDlg, ctrl->nID, CPM_GETCOLOUR, 0, 0));
+ break;
+
+ case CONTROL_RADIO:
+ if (IsDlgButtonChecked(hwndDlg, ctrl->nID))
+ db_set_w(NULL, module, ctrl->setting, (BYTE)ctrl->value);
+ break;
+
+ case CONTROL_COMBO:
+ db_set_w(NULL, module, ctrl->setting, (WORD)SendDlgItemMessage(hwndDlg, ctrl->nID, CB_GETCURSEL, 0, 0));
+ break;
+
+ case CONTROL_PROTOCOL_LIST:
+ {
+ LVITEM lvi = { 0 };
+ HWND hwndProtocols = GetDlgItem(hwndDlg, ctrl->nID);
+ int i;
+
+ lvi.mask = (UINT)LVIF_PARAM;
+
+ for (i = 0; i < ListView_GetItemCount(hwndProtocols); i++) {
+ lvi.iItem = i;
+ ListView_GetItem(hwndProtocols, &lvi);
+
+ char *setting = (char *)lvi.lParam;
+ db_set_b(NULL, module, setting, (BYTE)ListView_GetCheckState(hwndProtocols, i));
+ }
+ }
+ break;
+
+ case CONTROL_TEXT:
+ {
+ TCHAR tmp[1024];
+ GetDlgItemText(hwndDlg, ctrl->nID, tmp, _countof(tmp));
+ db_set_ts(NULL, module, ctrl->setting, tmp);
+ }
+ break;
+
+ case CONTROL_INT:
+ {
+ BOOL trans;
+ int val = GetDlgItemInt(hwndDlg, ctrl->nID, &trans, ctrl->min <= 0);
+ if (!trans)
+ val = ctrl->dwDefValue;
+ if (ctrl->max != 0)
+ val = min(val, ctrl->max);
+ if (ctrl->min != 0)
+ val = max(val, ctrl->min);
+ db_set_dw(NULL, module, ctrl->setting, val);
+ }
+ break;
+ case CONTROL_FILE:
+ {
+ TCHAR tmp[1024];
+ GetDlgItemText(hwndDlg, ctrl->nID, tmp, _countof(tmp));
+ TCHAR rel[1024];
+ PathToRelative(rel, 1024, tmp);
+ db_set_ts(NULL, module, ctrl->setting, rel);
+ }
+ break;
+ case CONTROL_COMBO_TEXT:
+ {
+ TCHAR tmp[1024];
+ GetDlgItemText(hwndDlg, ctrl->nID, tmp, _countof(tmp));
+ db_set_ts(NULL, module, ctrl->setting, tmp);
+ }
+ break;
+ case CONTROL_COMBO_ITEMDATA:
+ {
+ int sel = SendDlgItemMessage(hwndDlg, ctrl->nID, CB_GETCURSEL, 0, 0);
+ db_set_ts(NULL, module, ctrl->setting, (TCHAR *)SendDlgItemMessage(hwndDlg, ctrl->nID, CB_GETITEMDATA, (WPARAM)sel, 0));
+ }
+ break;
}
- }
- break;
- case CONTROL_TEXT:
- {
- TCHAR tmp[1024];
- GetDlgItemText(hwndDlg, ctrl->nID, tmp, _countof(tmp));
- db_set_ts(NULL, module, ctrl->setting, tmp);
+ LoadOpt(ctrl, module);
}
- break;
- case CONTROL_INT:
- {
- BOOL trans;
- int val = GetDlgItemInt(hwndDlg, ctrl->nID, &trans, ctrl->min <= 0);
- if (!trans)
- val = ctrl->dwDefValue;
- if (ctrl->max != 0)
- val = min(val, ctrl->max);
- if (ctrl->min != 0)
- val = max(val, ctrl->min);
- db_set_dw(NULL, module, ctrl->setting, val);
- }
- break;
- case CONTROL_FILE:
- {
- TCHAR tmp[1024];
- GetDlgItemText(hwndDlg, ctrl->nID, tmp, _countof(tmp));
- TCHAR rel[1024];
- PathToRelative(rel, 1024, tmp);
- db_set_ts(NULL, module, ctrl->setting, rel);
- }
- break;
- case CONTROL_COMBO_TEXT:
- {
- TCHAR tmp[1024];
- GetDlgItemText(hwndDlg, ctrl->nID, tmp, _countof(tmp));
- db_set_ts(NULL, module, ctrl->setting, tmp);
- }
- break;
- case CONTROL_COMBO_ITEMDATA:
- {
- int sel = SendDlgItemMessage(hwndDlg, ctrl->nID, CB_GETCURSEL, 0, 0);
- db_set_ts(NULL, module, ctrl->setting, (TCHAR *)SendDlgItemMessage(hwndDlg, ctrl->nID, CB_GETITEMDATA, (WPARAM)sel, 0));
- }
- break;
- }
-
- LoadOpt(ctrl, module);
+ return TRUE;
}
+ else if (lpnmhdr->idFrom != 0 && lpnmhdr->code == LVN_ITEMCHANGED) {
+ // Changed for protocols
+ for (int i = 0; i < controlsSize; i++) {
+ OptPageControl *ctrl = &controls[i];
- return TRUE;
- }
- else if (lpnmhdr->idFrom != 0 && lpnmhdr->code == LVN_ITEMCHANGED) {
- // Changed for protocols
- for (int i = 0; i < controlsSize; i++) {
- OptPageControl *ctrl = &controls[i];
-
- if (ctrl->type == CONTROL_PROTOCOL_LIST && ctrl->nID == lpnmhdr->idFrom) {
- NMLISTVIEW *nmlv = (NMLISTVIEW *)lParam;
+ if (ctrl->type == CONTROL_PROTOCOL_LIST && ctrl->nID == lpnmhdr->idFrom) {
+ NMLISTVIEW *nmlv = (NMLISTVIEW *)lParam;
- if (IsWindowVisible(GetDlgItem(hwndDlg, ctrl->nID)) && ((nmlv->uNewState ^ nmlv->uOldState) & LVIS_STATEIMAGEMASK))
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ if (IsWindowVisible(GetDlgItem(hwndDlg, ctrl->nID)) && ((nmlv->uNewState ^ nmlv->uOldState) & LVIS_STATEIMAGEMASK))
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- break;
+ break;
+ }
}
}
}
- }
- break;
+ break;
case WM_DESTROY:
for (int i = 0; i < controlsSize; i++) {
diff --git a/plugins/Watrack_MPD/src/init.cpp b/plugins/Watrack_MPD/src/init.cpp index 7f7a1f5f9c..d33cca945b 100755 --- a/plugins/Watrack_MPD/src/init.cpp +++ b/plugins/Watrack_MPD/src/init.cpp @@ -37,13 +37,13 @@ PLUGININFOEX pluginInfo={ {0x692e87d0, 0x6c71, 0x4cdc, {0x9e, 0x36, 0x2b, 0x2d, 0x69, 0xfb, 0xdc, 0x4c}}
};
-BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
+BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
{
hInst = hinstDLL;
return TRUE;
}
-extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfo;
}
diff --git a/plugins/Watrack_MPD/src/main.cpp b/plugins/Watrack_MPD/src/main.cpp index 4a157b7f5e..9fc1ca9c50 100755 --- a/plugins/Watrack_MPD/src/main.cpp +++ b/plugins/Watrack_MPD/src/main.cpp @@ -22,7 +22,7 @@ BOOL Connected; int gbState; SONGINFO SongInfo = {0}; -void Start(void* param) +void Start(void*) { NETLIBOPENCONNECTION nloc = { sizeof(nloc) }; char *tmp = (char*)mir_u2a(gbHost); @@ -36,7 +36,7 @@ void Start(void* param) ghPacketReciever = (HANDLE)CallService(MS_NETLIB_CREATEPACKETRECVER,(WPARAM)ghConnection,2048); } -void ReStart(void *param) +void ReStart(void*) { if(ghPacketReciever) Netlib_CloseHandle(ghPacketReciever); diff --git a/plugins/Watrack_MPD/src/options.cpp b/plugins/Watrack_MPD/src/options.cpp index 5ce485d475..6641d3ed30 100755 --- a/plugins/Watrack_MPD/src/options.cpp +++ b/plugins/Watrack_MPD/src/options.cpp @@ -16,7 +16,7 @@ #include "stdafx.h" -static INT_PTR CALLBACK DlgProcWaMpdOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) +static INT_PTR CALLBACK DlgProcWaMpdOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM lParam) { switch (msg) { diff --git a/plugins/WhenWasIt/src/WhenWasIt.cpp b/plugins/WhenWasIt/src/WhenWasIt.cpp index bb900196e6..a03cdba625 100644 --- a/plugins/WhenWasIt/src/WhenWasIt.cpp +++ b/plugins/WhenWasIt/src/WhenWasIt.cpp @@ -45,7 +45,7 @@ PLUGININFOEX pluginInfo = { { 0x2ff96c84, 0xb0b5, 0x470e, { 0xbb, 0xf9, 0x90, 0x7b, 0x9f, 0x3f, 0x5d, 0x2f } }
};
-extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD mirandaVersion)
+extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD)
{
return &pluginInfo;
}
@@ -154,7 +154,7 @@ extern "C" int __declspec(dllexport) Unload() return 0;
}
-bool WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
+bool WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
{
hInstance = hinstDLL;
return TRUE;
diff --git a/plugins/WhenWasIt/src/birthdays.cpp b/plugins/WhenWasIt/src/birthdays.cpp index 78e128130c..7f4a93ed3e 100644 --- a/plugins/WhenWasIt/src/birthdays.cpp +++ b/plugins/WhenWasIt/src/birthdays.cpp @@ -20,7 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h"
-CBirthdays &birthdays = CBirthdays();
+CBirthdays birthdays;
CBirthdays::CBirthdays(int initialSize)
{
diff --git a/plugins/WhenWasIt/src/birthdays.h b/plugins/WhenWasIt/src/birthdays.h index c1f8085fd6..10fdfa45fa 100644 --- a/plugins/WhenWasIt/src/birthdays.h +++ b/plugins/WhenWasIt/src/birthdays.h @@ -63,6 +63,6 @@ public: int Size() const;
};
-extern CBirthdays &birthdays;
+extern CBirthdays birthdays;
#endif //M_WWI_BIRTHDAYS_H
diff --git a/plugins/WhenWasIt/src/date_utils.cpp b/plugins/WhenWasIt/src/date_utils.cpp index cb2f47ebe2..d69a9b0dc3 100644 --- a/plugins/WhenWasIt/src/date_utils.cpp +++ b/plugins/WhenWasIt/src/date_utils.cpp @@ -28,7 +28,7 @@ time_t Today() return mktime(date);
}
-bool IsDOBValid(int year, int month, int day)
+bool IsDOBValid(int, int month, int day)
{
return (month != 0 && day != 0);
}
diff --git a/plugins/WhenWasIt/src/dlg_handlers.cpp b/plugins/WhenWasIt/src/dlg_handlers.cpp index 9e1209d1a1..1083287cc2 100644 --- a/plugins/WhenWasIt/src/dlg_handlers.cpp +++ b/plugins/WhenWasIt/src/dlg_handlers.cpp @@ -130,7 +130,7 @@ SIZE GetControlTextSize(HWND hCtrl) return size;
}
-int EnlargeControl(HWND hCtrl, HWND hGroup, SIZE oldSize)
+int EnlargeControl(HWND hCtrl, HWND, SIZE oldSize)
{
SIZE size = GetControlTextSize(hCtrl);
RECT rect;
@@ -162,76 +162,76 @@ INT_PTR CALLBACK DlgProcOptions(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara static int bInitializing = 0;
switch (msg) {
case WM_INITDIALOG:
- {
- bInitializing = 1;
+ {
+ bInitializing = 1;
- SIZE oldPopupsSize = GetControlTextSize(GetDlgItem(hWnd, IDC_USE_POPUPS));
- SIZE oldClistIconSize = GetControlTextSize(GetDlgItem(hWnd, IDC_USE_CLISTICON));
- SIZE oldDialogSize = GetControlTextSize(GetDlgItem(hWnd, IDC_USE_DIALOG));
+ SIZE oldPopupsSize = GetControlTextSize(GetDlgItem(hWnd, IDC_USE_POPUPS));
+ SIZE oldClistIconSize = GetControlTextSize(GetDlgItem(hWnd, IDC_USE_CLISTICON));
+ SIZE oldDialogSize = GetControlTextSize(GetDlgItem(hWnd, IDC_USE_DIALOG));
- TranslateDialogDefault(hWnd);
+ TranslateDialogDefault(hWnd);
- EnlargeControl(GetDlgItem(hWnd, IDC_USE_POPUPS), GetDlgItem(hWnd, IDC_POPUPS_STATIC), oldPopupsSize);
- EnlargeControl(GetDlgItem(hWnd, IDC_USE_CLISTICON), GetDlgItem(hWnd, IDC_CLIST_STATIC), oldClistIconSize);
- EnlargeControl(GetDlgItem(hWnd, IDC_USE_DIALOG), GetDlgItem(hWnd, IDC_DIALOG_STATIC), oldDialogSize);
+ EnlargeControl(GetDlgItem(hWnd, IDC_USE_POPUPS), GetDlgItem(hWnd, IDC_POPUPS_STATIC), oldPopupsSize);
+ EnlargeControl(GetDlgItem(hWnd, IDC_USE_CLISTICON), GetDlgItem(hWnd, IDC_CLIST_STATIC), oldClistIconSize);
+ EnlargeControl(GetDlgItem(hWnd, IDC_USE_DIALOG), GetDlgItem(hWnd, IDC_DIALOG_STATIC), oldDialogSize);
- AddInfoToComboBoxes(hWnd);
+ AddInfoToComboBoxes(hWnd);
- SendDlgItemMessage(hWnd, IDC_FOREGROUND, CPM_SETDEFAULTCOLOUR, 0, FOREGROUND_COLOR);
- SendDlgItemMessage(hWnd, IDC_BACKGROUND, CPM_SETDEFAULTCOLOUR, 0, BACKGROUND_COLOR);
+ SendDlgItemMessage(hWnd, IDC_FOREGROUND, CPM_SETDEFAULTCOLOUR, 0, FOREGROUND_COLOR);
+ SendDlgItemMessage(hWnd, IDC_BACKGROUND, CPM_SETDEFAULTCOLOUR, 0, BACKGROUND_COLOR);
- SendDlgItemMessage(hWnd, IDC_FOREGROUND, CPM_SETCOLOUR, 0, commonData.foreground);
- SendDlgItemMessage(hWnd, IDC_BACKGROUND, CPM_SETCOLOUR, 0, commonData.background);
+ SendDlgItemMessage(hWnd, IDC_FOREGROUND, CPM_SETCOLOUR, 0, commonData.foreground);
+ SendDlgItemMessage(hWnd, IDC_BACKGROUND, CPM_SETCOLOUR, 0, commonData.background);
- SendDlgItemMessage(hWnd, IDC_DEFAULT_MODULE, CB_SETCURSEL, commonData.cDefaultModule, 0);
- SendDlgItemMessage(hWnd, IDC_LEFT_CLICK, CB_SETCURSEL, commonData.lPopupClick, 0);
- SendDlgItemMessage(hWnd, IDC_RIGHT_CLICK, CB_SETCURSEL, commonData.rPopupClick, 0);
- SendDlgItemMessage(hWnd, IDC_NOTIFYFOR, CB_SETCURSEL, commonData.notifyFor, 0);
+ SendDlgItemMessage(hWnd, IDC_DEFAULT_MODULE, CB_SETCURSEL, commonData.cDefaultModule, 0);
+ SendDlgItemMessage(hWnd, IDC_LEFT_CLICK, CB_SETCURSEL, commonData.lPopupClick, 0);
+ SendDlgItemMessage(hWnd, IDC_RIGHT_CLICK, CB_SETCURSEL, commonData.rPopupClick, 0);
+ SendDlgItemMessage(hWnd, IDC_NOTIFYFOR, CB_SETCURSEL, commonData.notifyFor, 0);
- CreateToolTip(GetDlgItem(hWnd, IDC_POPUP_TIMEOUT), TranslateT("Set popup delay when notifying of upcoming birthdays.\nFormat: default delay [ | delay for birthdays occurring today]"), 400);
+ CreateToolTip(GetDlgItem(hWnd, IDC_POPUP_TIMEOUT), TranslateT("Set popup delay when notifying of upcoming birthdays.\nFormat: default delay [ | delay for birthdays occurring today]"), 400);
- TCHAR buffer[1024];
- _itot(commonData.daysInAdvance, buffer, 10);
- SetDlgItemText(hWnd, IDC_DAYS_IN_ADVANCE, buffer);
- _itot(commonData.checkInterval, buffer, 10);
- SetDlgItemText(hWnd, IDC_CHECK_INTERVAL, buffer);
- mir_sntprintf(buffer, _countof(buffer), _T("%d|%d"), commonData.popupTimeout, commonData.popupTimeoutToday);
- SetDlgItemText(hWnd, IDC_POPUP_TIMEOUT, buffer);
- _itot(commonData.cSoundNearDays, buffer, 10);
- SetDlgItemText(hWnd, IDC_SOUND_NEAR_DAYS_EDIT, buffer);
- _itot(commonData.cDlgTimeout, buffer, 10);
- SetDlgItemText(hWnd, IDC_DLG_TIMEOUT, buffer);
- _itot(commonData.daysAfter, buffer, 10);
- SetDlgItemText(hWnd, IDC_DAYS_AFTER, buffer);
+ TCHAR buffer[1024];
+ _itot(commonData.daysInAdvance, buffer, 10);
+ SetDlgItemText(hWnd, IDC_DAYS_IN_ADVANCE, buffer);
+ _itot(commonData.checkInterval, buffer, 10);
+ SetDlgItemText(hWnd, IDC_CHECK_INTERVAL, buffer);
+ mir_sntprintf(buffer, _countof(buffer), _T("%d|%d"), commonData.popupTimeout, commonData.popupTimeoutToday);
+ SetDlgItemText(hWnd, IDC_POPUP_TIMEOUT, buffer);
+ _itot(commonData.cSoundNearDays, buffer, 10);
+ SetDlgItemText(hWnd, IDC_SOUND_NEAR_DAYS_EDIT, buffer);
+ _itot(commonData.cDlgTimeout, buffer, 10);
+ SetDlgItemText(hWnd, IDC_DLG_TIMEOUT, buffer);
+ _itot(commonData.daysAfter, buffer, 10);
+ SetDlgItemText(hWnd, IDC_DAYS_AFTER, buffer);
- CheckDlgButton(hWnd, IDC_OPENINBACKGROUND, (commonData.bOpenInBackground) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hWnd, IDC_OPENINBACKGROUND, (commonData.bOpenInBackground) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hWnd, IDC_NOBIRTHDAYS_POPUP, (commonData.bNoBirthdaysPopup) ? BST_CHECKED : BST_UNCHECKED);
- SendDlgItemMessage(hWnd, IDC_AGE_COMBOBOX, CB_SETCURSEL, commonData.cShowAgeMode, 0);
+ CheckDlgButton(hWnd, IDC_NOBIRTHDAYS_POPUP, (commonData.bNoBirthdaysPopup) ? BST_CHECKED : BST_UNCHECKED);
+ SendDlgItemMessage(hWnd, IDC_AGE_COMBOBOX, CB_SETCURSEL, commonData.cShowAgeMode, 0);
- CheckDlgButton(hWnd, IDC_IGNORE_SUBCONTACTS, (commonData.bIgnoreSubcontacts) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hWnd, IDC_IGNORE_SUBCONTACTS, (commonData.bIgnoreSubcontacts) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hWnd, IDC_ONCE_PER_DAY, (commonData.bOncePerDay) ? BST_CHECKED : BST_UNCHECKED);
- EnableWindow(GetDlgItem(hWnd, IDC_CHECK_INTERVAL), !commonData.bOncePerDay);
+ CheckDlgButton(hWnd, IDC_ONCE_PER_DAY, (commonData.bOncePerDay) ? BST_CHECKED : BST_UNCHECKED);
+ EnableWindow(GetDlgItem(hWnd, IDC_CHECK_INTERVAL), !commonData.bOncePerDay);
- CheckDlgButton(hWnd, IDC_USE_DIALOG, (commonData.bUseDialog) ? BST_CHECKED : BST_UNCHECKED);
- EnableDialogGroup(hWnd, commonData.bUseDialog);
+ CheckDlgButton(hWnd, IDC_USE_DIALOG, (commonData.bUseDialog) ? BST_CHECKED : BST_UNCHECKED);
+ EnableDialogGroup(hWnd, commonData.bUseDialog);
- if (ServiceExists(MS_POPUP_ADDPOPUPT)) {
- CheckDlgButton(hWnd, IDC_USE_POPUPS, commonData.bUsePopups ? BST_CHECKED : BST_UNCHECKED);
- EnablePopupsGroup(hWnd, commonData.bUsePopups);
- }
- else {
- EnableWindow(GetDlgItem(hWnd, IDC_USE_POPUPS), FALSE);
- EnablePopupsGroup(hWnd, FALSE);
- }
+ if (ServiceExists(MS_POPUP_ADDPOPUPT)) {
+ CheckDlgButton(hWnd, IDC_USE_POPUPS, commonData.bUsePopups ? BST_CHECKED : BST_UNCHECKED);
+ EnablePopupsGroup(hWnd, commonData.bUsePopups);
+ }
+ else {
+ EnableWindow(GetDlgItem(hWnd, IDC_USE_POPUPS), FALSE);
+ EnablePopupsGroup(hWnd, FALSE);
+ }
- CheckDlgButton(hWnd, IDC_USE_CLISTICON, BST_CHECKED);
- EnableWindow(GetDlgItem(hWnd, IDC_USE_CLISTICON), FALSE);
- EnableClistGroup(hWnd, FALSE);
- }
- bInitializing = 0;
- return TRUE;
+ CheckDlgButton(hWnd, IDC_USE_CLISTICON, BST_CHECKED);
+ EnableWindow(GetDlgItem(hWnd, IDC_USE_CLISTICON), FALSE);
+ EnableClistGroup(hWnd, FALSE);
+ }
+ bInitializing = 0;
+ return TRUE;
case WM_COMMAND:
switch (LOWORD(wParam)) {
@@ -272,13 +272,13 @@ INT_PTR CALLBACK DlgProcOptions(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara break;
case IDC_PREVIEW:
- {
- MCONTACT hContact = db_find_first();
- int dtb = rand() % 11; //0..10
- int age = rand() % 50 + 1; //1..50
- PopupNotifyBirthday(hContact, dtb, age);
- break;
- }
+ {
+ MCONTACT hContact = db_find_first();
+ int dtb = rand() % 11; //0..10
+ int age = rand() % 50 + 1; //1..50
+ PopupNotifyBirthday(hContact, dtb, age);
+ break;
+ }
}
break;
@@ -413,65 +413,65 @@ INT_PTR CALLBACK DlgProcAddBirthday(HWND hWnd, UINT msg, WPARAM wParam, LPARAM l break;
case WM_SHOWWINDOW:
- {
- TCHAR *szTooltipText = TranslateT("Please select the module where you want the date of birth to be saved.\r\n\"UserInfo\" is the default location.\r\nUse \"Protocol module\" to make the data visible in User Details.\n\"mBirthday module\" uses the same module as mBirthday plugin.");
- TCHAR *szCurrentModuleTooltip = NULL;
- char *szProto = GetContactProto(hContact);
+ {
+ TCHAR *szTooltipText = TranslateT("Please select the module where you want the date of birth to be saved.\r\n\"UserInfo\" is the default location.\r\nUse \"Protocol module\" to make the data visible in User Details.\n\"mBirthday module\" uses the same module as mBirthday plugin.");
+ TCHAR *szCurrentModuleTooltip = NULL;
+ char *szProto = GetContactProto(hContact);
- TCHAR buffer[2048];
- mir_sntprintf(buffer, _countof(buffer), TranslateT("Set birthday for %s:"), pcli->pfnGetContactDisplayName(hContact, 0));
- SetWindowText(hWnd, buffer);
-
- HWND hDate = GetDlgItem(hWnd, IDC_DATE);
-
- int year, month, day;
- int loc = GetContactDOB(hContact, year, month, day);
- if (IsDOBValid(year, month, day)) {
- SYSTEMTIME st = { 0 };
- st.wDay = day;
- st.wMonth = month;
- st.wYear = year;
- DateTime_SetSystemtime(hDate, GDT_VALID, &st);
- }
- else DateTime_SetSystemtime(hDate, GDT_NONE, NULL);
+ TCHAR buffer[2048];
+ mir_sntprintf(buffer, _countof(buffer), TranslateT("Set birthday for %s:"), pcli->pfnGetContactDisplayName(hContact, 0));
+ SetWindowText(hWnd, buffer);
- switch (loc) {
- case DOB_MBIRTHDAY:
- DateTime_SetMonthCalColor(hDate, MCSC_TITLEBK, COLOR_MBIRTHDAY);
- szCurrentModuleTooltip = _T("mBirthday");
- break;
+ HWND hDate = GetDlgItem(hWnd, IDC_DATE);
- case DOB_PROTOCOL:
- DateTime_SetMonthCalColor(hDate, MCSC_TITLEBK, COLOR_PROTOCOL);
- mir_sntprintf(buffer, _countof(buffer), TranslateT("%S protocol"), szProto);
- szCurrentModuleTooltip = buffer;
- break;
+ int year, month, day;
+ int loc = GetContactDOB(hContact, year, month, day);
+ if (IsDOBValid(year, month, day)) {
+ SYSTEMTIME st = { 0 };
+ st.wDay = day;
+ st.wMonth = month;
+ st.wYear = year;
+ DateTime_SetSystemtime(hDate, GDT_VALID, &st);
+ }
+ else DateTime_SetSystemtime(hDate, GDT_NONE, NULL);
- case DOB_BIRTHDAYREMINDER:
- DateTime_SetMonthCalColor(hDate, MCSC_TITLEBK, COLOR_BIRTHDAYREMINDER);
- szCurrentModuleTooltip = _T("Birthday Reminder");
- break;
+ switch (loc) {
+ case DOB_MBIRTHDAY:
+ DateTime_SetMonthCalColor(hDate, MCSC_TITLEBK, COLOR_MBIRTHDAY);
+ szCurrentModuleTooltip = _T("mBirthday");
+ break;
- case DOB_USERINFO:
- DateTime_SetMonthCalColor(hDate, MCSC_TITLEBK, COLOR_USERINFO);
- szCurrentModuleTooltip = _T("UserInfo");
- break;
+ case DOB_PROTOCOL:
+ DateTime_SetMonthCalColor(hDate, MCSC_TITLEBK, COLOR_PROTOCOL);
+ mir_sntprintf(buffer, _countof(buffer), TranslateT("%S protocol"), szProto);
+ szCurrentModuleTooltip = buffer;
+ break;
- case DOB_MICQBIRTHDAY:
- DateTime_SetMonthCalColor(hDate, MCSC_TITLEBK, COLOR_MICQBIRTHDAY);
- szCurrentModuleTooltip = _T("mICQBirthday");
- break;
+ case DOB_BIRTHDAYREMINDER:
+ DateTime_SetMonthCalColor(hDate, MCSC_TITLEBK, COLOR_BIRTHDAYREMINDER);
+ szCurrentModuleTooltip = _T("Birthday Reminder");
+ break;
- default:
- szCurrentModuleTooltip = NULL;
- break;
- }
+ case DOB_USERINFO:
+ DateTime_SetMonthCalColor(hDate, MCSC_TITLEBK, COLOR_USERINFO);
+ szCurrentModuleTooltip = _T("UserInfo");
+ break;
- CreateToolTip(GetDlgItem(hWnd, IDC_COMPATIBILITY), szTooltipText, 500);
- if (szCurrentModuleTooltip)
- CreateToolTip(hDate, szCurrentModuleTooltip, 400);
- }
- break;
+ case DOB_MICQBIRTHDAY:
+ DateTime_SetMonthCalColor(hDate, MCSC_TITLEBK, COLOR_MICQBIRTHDAY);
+ szCurrentModuleTooltip = _T("mICQBirthday");
+ break;
+
+ default:
+ szCurrentModuleTooltip = NULL;
+ break;
+ }
+
+ CreateToolTip(GetDlgItem(hWnd, IDC_COMPATIBILITY), szTooltipText, 500);
+ if (szCurrentModuleTooltip)
+ CreateToolTip(hDate, szCurrentModuleTooltip, 400);
+ }
+ break;
case WM_DESTROY:
RefreshContactListIcons(hContact); //the birthday might be changed, refresh icon.
@@ -518,7 +518,7 @@ void AddAnchorWindowToDeferList(HDWP &hdWnds, HWND window, RECT *rParent, WINDOW #define NA TranslateT("N/A")
-TCHAR *GetBirthdayModule(int module, MCONTACT hContact)
+TCHAR* GetBirthdayModule(int module, MCONTACT)
{
switch (module) {
case DOB_MBIRTHDAY: return _T("mBirthday");
@@ -532,7 +532,8 @@ TCHAR *GetBirthdayModule(int module, MCONTACT hContact) static int lastColumn = -1;
-struct BirthdaysSortParams{
+struct BirthdaysSortParams
+{
HWND hList;
int column;
};
@@ -587,7 +588,7 @@ int UpdateBirthdayEntry(HWND hList, MCONTACT hContact, int entry, int bShowAll, int dtb = DaysToBirthday(Today(), year, month, day);
int age = GetContactAge(hContact);
if (bShowCurrentAge)
- if ((month > currentMonth) || ((month == currentMonth) && (day > currentDay))) //birthday still to come
+ if (month > currentMonth || (month == currentMonth) && (day > currentDay)) // birthday still to come
age--;
char *szProto = GetContactProto(hContact);
@@ -762,42 +763,42 @@ INT_PTR CALLBACK DlgProcBirthdays(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa break;
case WWIM_UPDATE_BIRTHDAY:
- {
- MCONTACT hContact = wParam;
- HWND hList = GetDlgItem(hWnd, IDC_BIRTHDAYS_LIST);
- LVFINDINFO fi = { 0 };
-
- fi.flags = LVFI_PARAM;
- fi.lParam = (LPARAM)hContact;
- int idx = ListView_FindItem(hList, -1, &fi);
- if (-1 == idx)
- UpdateBirthdayEntry(hList, hContact, ListView_GetItemCount(hList), IsDlgButtonChecked(hWnd, IDC_SHOW_ALL), commonData.cShowAgeMode, 1);
- else
- UpdateBirthdayEntry(hList, hContact, idx, IsDlgButtonChecked(hWnd, IDC_SHOW_ALL), commonData.cShowAgeMode, 0);
- SetBirthdaysCount(hWnd);
- }
- break;
+ {
+ MCONTACT hContact = wParam;
+ HWND hList = GetDlgItem(hWnd, IDC_BIRTHDAYS_LIST);
+ LVFINDINFO fi = { 0 };
+
+ fi.flags = LVFI_PARAM;
+ fi.lParam = (LPARAM)hContact;
+ int idx = ListView_FindItem(hList, -1, &fi);
+ if (-1 == idx)
+ UpdateBirthdayEntry(hList, hContact, ListView_GetItemCount(hList), IsDlgButtonChecked(hWnd, IDC_SHOW_ALL), commonData.cShowAgeMode, 1);
+ else
+ UpdateBirthdayEntry(hList, hContact, idx, IsDlgButtonChecked(hWnd, IDC_SHOW_ALL), commonData.cShowAgeMode, 0);
+ SetBirthdaysCount(hWnd);
+ }
+ break;
case WM_WINDOWPOSCHANGING:
- {
- HDWP hdWnds = BeginDeferWindowPos(2);
- RECT rParent;
- WINDOWPOS *wndPos = (WINDOWPOS *)lParam;
- GetWindowRect(hWnd, &rParent);
+ {
+ HDWP hdWnds = BeginDeferWindowPos(2);
+ RECT rParent;
+ WINDOWPOS *wndPos = (WINDOWPOS *)lParam;
+ GetWindowRect(hWnd, &rParent);
- if (wndPos->cx < MIN_BIRTHDAYS_WIDTH)
- wndPos->cx = MIN_BIRTHDAYS_WIDTH;
+ if (wndPos->cx < MIN_BIRTHDAYS_WIDTH)
+ wndPos->cx = MIN_BIRTHDAYS_WIDTH;
- if (wndPos->cy < MIN_BIRTHDAYS_HEIGHT)
- wndPos->cy = MIN_BIRTHDAYS_HEIGHT;
+ if (wndPos->cy < MIN_BIRTHDAYS_HEIGHT)
+ wndPos->cy = MIN_BIRTHDAYS_HEIGHT;
- AddAnchorWindowToDeferList(hdWnds, GetDlgItem(hWnd, IDC_CLOSE), &rParent, wndPos, ANCHOR_RIGHT | ANCHOR_BOTTOM);
- AddAnchorWindowToDeferList(hdWnds, GetDlgItem(hWnd, IDC_SHOW_ALL), &rParent, wndPos, ANCHOR_LEFT | ANCHOR_BOTTOM);
- AddAnchorWindowToDeferList(hdWnds, GetDlgItem(hWnd, IDC_BIRTHDAYS_LIST), &rParent, wndPos, ANCHOR_ALL);
+ AddAnchorWindowToDeferList(hdWnds, GetDlgItem(hWnd, IDC_CLOSE), &rParent, wndPos, ANCHOR_RIGHT | ANCHOR_BOTTOM);
+ AddAnchorWindowToDeferList(hdWnds, GetDlgItem(hWnd, IDC_SHOW_ALL), &rParent, wndPos, ANCHOR_LEFT | ANCHOR_BOTTOM);
+ AddAnchorWindowToDeferList(hdWnds, GetDlgItem(hWnd, IDC_BIRTHDAYS_LIST), &rParent, wndPos, ANCHOR_ALL);
- EndDeferWindowPos(hdWnds);
- }
- break;
+ EndDeferWindowPos(hdWnds);
+ }
+ break;
case WM_COMMAND:
switch (LOWORD(wParam)) {
@@ -847,84 +848,84 @@ INT_PTR CALLBACK DlgProcUpcoming(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar switch (msg) {
case WM_INITDIALOG:
- {
TranslateDialogDefault(hWnd);
- timeout = commonData.cDlgTimeout;
- SendMessage(hWnd, WM_SETICON, ICON_BIG, (LPARAM)IcoLib_GetIconByHandle(hListMenu));
- HWND hList = GetDlgItem(hWnd, IDC_UPCOMING_LIST);
-
- mir_subclassWindow(hList, BirthdaysListSubclassProc);
- ListView_SetExtendedListViewStyleEx(hList, LVS_EX_FULLROWSELECT, LVS_EX_FULLROWSELECT);
-
- LVCOLUMN col;
- col.mask = LVCF_TEXT | LVCF_WIDTH;
- col.pszText = TranslateT("Contact");
- col.cx = 300;
- ListView_InsertColumn(hList, 0, &col);
- col.pszText = TranslateT("Age");
- col.cx = 45;
- ListView_InsertColumn(hList, 1, &col);
- col.pszText = TranslateT("DTB");
- col.cx = 45;
- ListView_InsertColumn(hList, 2, &col);
-
- ListView_SetColumnWidth(hList, 0, LVSCW_AUTOSIZE);
-
- if (timeout > 0)
- SetTimer(hWnd, UPCOMING_TIMER_ID, 1000, NULL);
- Utils_RestoreWindowPosition(hWnd, NULL, ModuleName, "BirthdayListUpcoming");
- }
- return TRUE;
+ {
+ timeout = commonData.cDlgTimeout;
+ SendMessage(hWnd, WM_SETICON, ICON_BIG, (LPARAM)IcoLib_GetIconByHandle(hListMenu));
+ HWND hList = GetDlgItem(hWnd, IDC_UPCOMING_LIST);
+
+ mir_subclassWindow(hList, BirthdaysListSubclassProc);
+ ListView_SetExtendedListViewStyleEx(hList, LVS_EX_FULLROWSELECT, LVS_EX_FULLROWSELECT);
+
+ LVCOLUMN col;
+ col.mask = LVCF_TEXT | LVCF_WIDTH;
+ col.pszText = TranslateT("Contact");
+ col.cx = 300;
+ ListView_InsertColumn(hList, 0, &col);
+ col.pszText = TranslateT("Age");
+ col.cx = 45;
+ ListView_InsertColumn(hList, 1, &col);
+ col.pszText = TranslateT("DTB");
+ col.cx = 45;
+ ListView_InsertColumn(hList, 2, &col);
+
+ ListView_SetColumnWidth(hList, 0, LVSCW_AUTOSIZE);
+
+ if (timeout > 0)
+ SetTimer(hWnd, UPCOMING_TIMER_ID, 1000, NULL);
+ Utils_RestoreWindowPosition(hWnd, NULL, ModuleName, "BirthdayListUpcoming");
+ }
+ return TRUE;
case WM_TIMER:
- {
- const int MAX_SIZE = 512;
- TCHAR buffer[MAX_SIZE];
- timeout--;
- mir_sntprintf(buffer, _countof(buffer), (timeout != 2) ? TranslateT("Closing in %d seconds") : TranslateT("Closing in %d second"), timeout);
- SetDlgItemText(hWnd, IDC_CLOSE, buffer);
-
- if (timeout <= 0)
- SendMessage(hWnd, WM_CLOSE, 0, 0);
- }
- break;
+ {
+ const int MAX_SIZE = 512;
+ TCHAR buffer[MAX_SIZE];
+ timeout--;
+ mir_sntprintf(buffer, _countof(buffer), (timeout != 2) ? TranslateT("Closing in %d seconds") : TranslateT("Closing in %d second"), timeout);
+ SetDlgItemText(hWnd, IDC_CLOSE, buffer);
+
+ if (timeout <= 0)
+ SendMessage(hWnd, WM_CLOSE, 0, 0);
+ }
+ break;
case WM_CLOSE:
DestroyWindow(hWnd);
break;
case WWIM_ADD_UPCOMING_BIRTHDAY:
- {
- PUpcomingBirthday data = (PUpcomingBirthday)wParam;
+ {
+ PUpcomingBirthday data = (PUpcomingBirthday)wParam;
+
+ HWND hList = GetDlgItem(hWnd, IDC_UPCOMING_LIST);
+ LVITEM item = { 0 };
+ LVFINDINFO fi = { 0 };
+
+ fi.flags = LVFI_PARAM;
+ fi.lParam = (LPARAM)data->hContact;
+ if (-1 != ListView_FindItem(hList, -1, &fi))
+ return 0; /* Allready in list. */
+
+ int index = ListView_GetItemCount(hList);
+ item.iItem = index;
+ item.mask = LVIF_PARAM | LVIF_TEXT;
+ item.lParam = (LPARAM)data->hContact;
+ item.pszText = data->message;
+ ListView_InsertItem(hList, &item);
- HWND hList = GetDlgItem(hWnd, IDC_UPCOMING_LIST);
- LVITEM item = { 0 };
- LVFINDINFO fi = { 0 };
-
- fi.flags = LVFI_PARAM;
- fi.lParam = (LPARAM)data->hContact;
- if (-1 != ListView_FindItem(hList, -1, &fi))
- return 0; /* Allready in list. */
-
- int index = ListView_GetItemCount(hList);
- item.iItem = index;
- item.mask = LVIF_PARAM | LVIF_TEXT;
- item.lParam = (LPARAM)data->hContact;
- item.pszText = data->message;
- ListView_InsertItem(hList, &item);
-
- TCHAR buffer[512];
- mir_sntprintf(buffer, _countof(buffer), _T("%d"), data->age);
- ListView_SetItemText(hList, index, 1, buffer);
- mir_sntprintf(buffer, _countof(buffer), _T("%d"), data->dtb);
- ListView_SetItemText(hList, index, 2, buffer);
-
- BirthdaysSortParams params = { 0 };
- params.hList = hList;
- params.column = 2;
- ListView_SortItemsEx(hList, BirthdaysCompare, (LPARAM)¶ms);
- }
- break;
+ TCHAR buffer[512];
+ mir_sntprintf(buffer, _countof(buffer), _T("%d"), data->age);
+ ListView_SetItemText(hList, index, 1, buffer);
+ mir_sntprintf(buffer, _countof(buffer), _T("%d"), data->dtb);
+ ListView_SetItemText(hList, index, 2, buffer);
+
+ BirthdaysSortParams params = { 0 };
+ params.hList = hList;
+ params.column = 2;
+ ListView_SortItemsEx(hList, BirthdaysCompare, (LPARAM)¶ms);
+ }
+ break;
case WM_COMMAND:
switch (LOWORD(wParam)) {
@@ -942,20 +943,20 @@ INT_PTR CALLBACK DlgProcUpcoming(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar break;
case WM_SIZE:
- {
- int cx, cy;
- RECT rcWin;
- HWND hList = GetDlgItem(hWnd, IDC_UPCOMING_LIST);
- GetWindowRect(hWnd, &rcWin);
-
- cx = rcWin.right - rcWin.left;
- cy = rcWin.bottom - rcWin.top;
- SetWindowPos(hList, NULL, 0, 0, (cx - 30), (cy - 80), (SWP_NOZORDER | SWP_NOMOVE));
- ListView_SetColumnWidth(hList, 0, (cx - 150));
- SetWindowPos(GetDlgItem(hWnd, IDC_CLOSE), NULL, ((cx / 2) - 95), (cy - 67), 0, 0, SWP_NOSIZE);
- RedrawWindow(hWnd, NULL, NULL, (RDW_FRAME | RDW_INVALIDATE));
- }
- break;
+ {
+ HWND hList = GetDlgItem(hWnd, IDC_UPCOMING_LIST);
+
+ RECT rcWin;
+ GetWindowRect(hWnd, &rcWin);
+
+ int cx = rcWin.right - rcWin.left;
+ int cy = rcWin.bottom - rcWin.top;
+ SetWindowPos(hList, NULL, 0, 0, (cx - 30), (cy - 80), (SWP_NOZORDER | SWP_NOMOVE));
+ ListView_SetColumnWidth(hList, 0, (cx - 150));
+ SetWindowPos(GetDlgItem(hWnd, IDC_CLOSE), NULL, ((cx / 2) - 95), (cy - 67), 0, 0, SWP_NOSIZE);
+ RedrawWindow(hWnd, NULL, NULL, (RDW_FRAME | RDW_INVALIDATE));
+ }
+ break;
case WM_DESTROY:
hUpcomingDlg = NULL;
diff --git a/plugins/WhenWasIt/src/hooked_events.cpp b/plugins/WhenWasIt/src/hooked_events.cpp index 83d2904a90..c00b8c629e 100644 --- a/plugins/WhenWasIt/src/hooked_events.cpp +++ b/plugins/WhenWasIt/src/hooked_events.cpp @@ -24,8 +24,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define EXCLUDE_HIDDEN 1
#define EXCLUDE_IGNORED 2
-static UINT_PTR hCheckTimer = NULL;
-static UINT_PTR hDateChangeTimer = NULL;
+UINT_PTR hCheckTimer = NULL;
+UINT_PTR hDateChangeTimer = NULL;
static int currentDay = 0;
@@ -58,7 +58,6 @@ static int OnOptionsInitialise(WPARAM wParam, LPARAM) static int OnContactSettingChanged(WPARAM hContact, LPARAM lParam)
{
DBCONTACTWRITESETTING *dw = (DBCONTACTWRITESETTING *)lParam;
- DBVARIANT dv = dw->value;
if ((mir_strcmp(dw->szModule, DUMMY_MODULE) == 0) && (mir_strcmp(dw->szSetting, DUMMY_SETTING) == 0))
RefreshContactListIcons(hContact);
@@ -94,7 +93,6 @@ int RefreshContactListIcons(MCONTACT hContact) if (hContact == 0)
return 0;
- int count = CallService(MS_DB_CONTACT_GETCOUNT, 0, 0);
int hidden = db_get_b(hContact, "CList", "Hidden", 0);
int ignored = db_get_dw(hContact, "Ignore", "Mask1", 0);
ignored = ((ignored & 0x3f) != 0) ? 1 : 0;
@@ -165,12 +163,12 @@ int KillTimers() return 0;
}
-VOID CALLBACK OnCheckTimer(HWND hWnd, UINT msg, UINT_PTR idEvent, DWORD dwTime)
+VOID CALLBACK OnCheckTimer(HWND, UINT, UINT_PTR, DWORD)
{
CheckBirthdaysService(0, 1);
}
-VOID CALLBACK OnDateChangeTimer(HWND hWnd, UINT msg, UINT_PTR idEvent, DWORD dwTime)
+VOID CALLBACK OnDateChangeTimer(HWND, UINT, UINT_PTR, DWORD)
{
SYSTEMTIME now;
GetLocalTime(&now);
diff --git a/plugins/WhenWasIt/src/services.cpp b/plugins/WhenWasIt/src/services.cpp index f38ba2acd6..ecfe1bbfbe 100644 --- a/plugins/WhenWasIt/src/services.cpp +++ b/plugins/WhenWasIt/src/services.cpp @@ -119,7 +119,7 @@ int NotifyMissedContactBirthday(MCONTACT hContact, time_t now, int daysAfter) //the timer functions call this service with lParam = 1
//lParam = 0 - force check, lParam - 1 do not force it.
-INT_PTR CheckBirthdaysService(WPARAM wParam, LPARAM lParam)
+INT_PTR CheckBirthdaysService(WPARAM, LPARAM lParam)
{
bBirthdayFound = 0; //no birthdays have been found in the given interval
@@ -158,7 +158,7 @@ INT_PTR CheckBirthdaysService(WPARAM wParam, LPARAM lParam) return 0;
}
-INT_PTR ShowListService(WPARAM wParam, LPARAM lParam)
+INT_PTR ShowListService(WPARAM, LPARAM)
{
if (!hBirthdaysDlg)
hBirthdaysDlg = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_BIRTHDAYS), NULL, DlgProcBirthdays);
@@ -167,11 +167,11 @@ INT_PTR ShowListService(WPARAM wParam, LPARAM lParam) return 0;
}
-INT_PTR AddBirthdayService(WPARAM hContact, LPARAM lParam)
+INT_PTR AddBirthdayService(WPARAM hContact, LPARAM)
{
HWND hWnd = WindowList_Find(hAddBirthdayWndsList, hContact);
if (!hWnd)
- hWnd = CreateDialogParam(hInstance, MAKEINTRESOURCE(IDD_ADD_BIRTHDAY), NULL, DlgProcAddBirthday, (LPARAM)hContact);
+ hWnd = CreateDialogParam(hInstance, MAKEINTRESOURCE(IDD_ADD_BIRTHDAY), NULL, DlgProcAddBirthday, hContact);
return ShowWindow(hWnd, SW_SHOW);
}
@@ -187,7 +187,7 @@ void ShowPopupMessage(TCHAR *title, TCHAR *message, HANDLE icon) PUAddPopupT(&pd);
}
-void __cdecl RefreshUserDetailsWorkerThread(void *param)
+void __cdecl RefreshUserDetailsWorkerThread(void*)
{
ShowPopupMessage(TranslateT("WhenWasIt"), TranslateT("Starting to refresh user details"), hRefreshUserDetails);
int delay = db_get_w(NULL, ModuleName, "UpdateDelay", REFRESH_DETAILS_DELAY);
@@ -203,17 +203,13 @@ void __cdecl RefreshUserDetailsWorkerThread(void *param) ShowPopupMessage(TranslateT("WhenWasIt"), TranslateT("Done refreshing user details"), hRefreshUserDetails);
}
-INT_PTR RefreshUserDetailsService(WPARAM wParam, LPARAM lParam)
+INT_PTR RefreshUserDetailsService(WPARAM, LPARAM)
{
- HANDLE result = mir_forkthread(RefreshUserDetailsWorkerThread, 0);
-
- if ((result != NULL) && (result != INVALID_HANDLE_VALUE))
- CloseHandle(result);
-
+ mir_forkthread(RefreshUserDetailsWorkerThread, 0);
return 0;
}
-INT_PTR ImportBirthdaysService(WPARAM wParam, LPARAM lParam)
+INT_PTR ImportBirthdaysService(WPARAM, LPARAM)
{
TCHAR fileName[1024] = { 0 };
OPENFILENAME of = { 0 };
@@ -238,7 +234,7 @@ INT_PTR ImportBirthdaysService(WPARAM wParam, LPARAM lParam) return 0;
}
-INT_PTR ExportBirthdaysService(WPARAM wParam, LPARAM lParam)
+INT_PTR ExportBirthdaysService(WPARAM, LPARAM)
{
TCHAR fileName[1024] = { 0 };
OPENFILENAME of = { 0 };
@@ -288,7 +284,6 @@ int DoImport(TCHAR *fileName) delAccount[0] = _T('\0');
TCHAR *delProto = _tcsrchr(buffer, _T('@'));
if (delProto) {
- int tmp2 = delProto[0];
delProto[0] = _T('\0');
TCHAR *szHandle = buffer;
diff --git a/plugins/WhoUsesMyFiles/src/wumf.cpp b/plugins/WhoUsesMyFiles/src/wumf.cpp index de316fd2f9..5cd34db33e 100644 --- a/plugins/WhoUsesMyFiles/src/wumf.cpp +++ b/plugins/WhoUsesMyFiles/src/wumf.cpp @@ -11,7 +11,7 @@ static PWumf lst = NULL; HANDLE hLogger = NULL;
BOOL wumf();
-static int DlgResizer(HWND hwndDlg, LPARAM lParam, UTILRESIZECONTROL *urc)
+static int DlgResizer(HWND, LPARAM, UTILRESIZECONTROL *urc)
{
switch(urc->wId) {
case IDC_CONNLIST:
@@ -215,7 +215,7 @@ void printError(DWORD res) LocalFree( lpMsgBuf );
}
-VOID CALLBACK TimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
+VOID CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD)
{
if (!wumf())
KillTimer(NULL, 777);
diff --git a/plugins/WhoUsesMyFiles/src/wumfplug.cpp b/plugins/WhoUsesMyFiles/src/wumfplug.cpp index 8c023af4eb..d5f2df0051 100644 --- a/plugins/WhoUsesMyFiles/src/wumfplug.cpp +++ b/plugins/WhoUsesMyFiles/src/wumfplug.cpp @@ -185,7 +185,7 @@ void ShowThePreview() ShowThePopup(NULL, _T("Administrator"), _T("C:\\Distributives\\Win2k\\setup.exe"));
}
-BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
+BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
{
hInst = hinstDLL;
return TRUE;
@@ -220,9 +220,6 @@ static INT_PTR WumfShowConnections(WPARAM,LPARAM) static INT_PTR WumfMenuCommand(WPARAM,LPARAM)
{
- BOOL MajorTo0121 = FALSE;
- int iResult = 0;
-
if (WumfOptions.PopupsEnabled == TRUE) {
WumfOptions.PopupsEnabled = FALSE;
Menu_ModifyItem(hMenuItem, LPGENT("Enable WUMF popups"), LoadIcon(hInst,MAKEINTRESOURCE(IDI_NOPOPUP)));
diff --git a/plugins/YAPP/src/notify_imp.cpp b/plugins/YAPP/src/notify_imp.cpp index aad282b1b4..a1b020dd18 100644 --- a/plugins/YAPP/src/notify_imp.cpp +++ b/plugins/YAPP/src/notify_imp.cpp @@ -4,7 +4,8 @@ HANDLE hhkShow=0, hhkUpdate=0, hhkRemove=0; //struct
-int Popup2Show(WPARAM wParam, LPARAM lParam) {
+int Popup2Show(WPARAM, LPARAM lParam)
+{
HANDLE hNotify = (HANDLE)lParam;
@@ -16,49 +17,53 @@ int Popup2Show(WPARAM wParam, LPARAM lParam) { return 0;
}
-INT_PTR svcPopup2Show(WPARAM wParam, LPARAM lParam) {
- return Popup2Show(wParam, lParam);
+INT_PTR svcPopup2Show(WPARAM wParam, LPARAM lParam)
+{
+ return Popup2Show(wParam, lParam);
}
-int Popup2Update(WPARAM wParam, LPARAM lParam) {
+int Popup2Update(WPARAM, LPARAM lParam)
+{
HANDLE hNotify = (HANDLE)lParam;
PostMPMessage(MUM_NMUPDATE, (WPARAM)hNotify, 0);
return 0;
}
-int AvatarChanged(WPARAM wParam, LPARAM lParam) {
+int AvatarChanged(WPARAM, LPARAM)
+{
PostMPMessage(MUM_NMAVATAR, 0, 0);
return 0;
}
-
-INT_PTR svcPopup2Update(WPARAM wParam, LPARAM lParam) {
- return Popup2Update(wParam, lParam);
+INT_PTR svcPopup2Update(WPARAM wParam, LPARAM lParam)
+{
+ return Popup2Update(wParam, lParam);
}
-int Popup2Remove(WPARAM wParam, LPARAM lParam) {
+int Popup2Remove(WPARAM, LPARAM lParam)
+{
HANDLE hNotify = (HANDLE)lParam;
PostMPMessage(MUM_NMREMOVE, (WPARAM)hNotify, 0);
return 0;
}
-INT_PTR svcPopup2Remove(WPARAM wParam, LPARAM lParam) {
- return Popup2Remove(wParam, lParam);
+INT_PTR svcPopup2Remove(WPARAM wParam, LPARAM lParam)
+{
+ return Popup2Remove(wParam, lParam);
}
-INT_PTR svcPopup2DefaultActions(WPARAM wParam, LPARAM lParam)
+INT_PTR svcPopup2DefaultActions(WPARAM wParam, LPARAM)
{
//PopupWindow *wnd = (PopupWindow *)MNotifyGetDWord((HANDLE)lParam, "Popup2/data", (DWORD)NULL);
//if (!wnd) return 0;
- switch (wParam)
- {
- case 0:
+ switch (wParam) {
+ case 0:
{ // send message
//if (wnd->lchContact) CallServiceSync(MS_MSG_SENDMESSAGE, (WPARAM)wnd->lchContact, 0);
//SendMessage(wnd->lchMain, UM_DESTROYPOPUP, 0, 0);
break;
}
- case 1:
+ case 1:
{ // dismiss popup
//SendMessage(wnd->lchMain, UM_DESTROYPOPUP, 0, 0);
break;
@@ -67,13 +72,12 @@ INT_PTR svcPopup2DefaultActions(WPARAM wParam, LPARAM lParam) return 0;
}
-INT_PTR CALLBACK DlgProcPopups(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK DlgProcPopups(HWND hwnd, UINT msg, WPARAM, LPARAM lParam)
{
-/* To change options use MNotifySet*(hNotify, ....) Apply/Cancel is implemented in notify.dll */
+ /* To change options use MNotifySet*(hNotify, ....) Apply/Cancel is implemented in notify.dll */
HANDLE hNotify = (HANDLE)GetWindowLongPtr(hwnd, GWLP_USERDATA);
- switch (msg)
- {
- case WM_USER+100:
+ switch (msg) {
+ case WM_USER + 100:
{
// This will be extendet to handle array of handles for multiselect lParam
// will be HANDLE * and wParam wil; store amount of handles passed
@@ -82,21 +86,21 @@ INT_PTR CALLBACK DlgProcPopups(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam return TRUE;
}
- case WM_COMMAND:
- // This in different from Miranda options!
- SendMessage(GetParent(GetParent(hwnd)), PSM_CHANGED, 0, 0);
- break;
+ case WM_COMMAND:
+ // This in different from Miranda options!
+ SendMessage(GetParent(GetParent(hwnd)), PSM_CHANGED, 0, 0);
+ break;
}
return FALSE;
}
-int NotifyOptionsInitialize(WPARAM wParam,LPARAM lParam)
+int NotifyOptionsInitialize(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = hInst;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_NOTIFY);
odp.pszTitle = LPGEN("YAPP Popups");
- odp.flags=ODPF_BOLDGROUPS;
+ odp.flags = ODPF_BOLDGROUPS;
odp.pfnDlgProc = DlgProcPopups;
CallService(MS_NOTIFY_OPT_ADDPAGE, wParam, (LPARAM)&odp);
return 0;
@@ -105,7 +109,7 @@ int NotifyOptionsInitialize(WPARAM wParam,LPARAM lParam) HANDLE hEventNotifyOptInit, hEventNotifyModulesLoaded;
HANDLE hAvChangeEvent;
-int NotifyModulesLoaded(WPARAM wParam,LPARAM lParam)
+int NotifyModulesLoaded(WPARAM, LPARAM)
{
hEventNotifyOptInit = HookEvent(ME_NOTIFY_OPT_INITIALISE, NotifyOptionsInitialize);
hAvChangeEvent = HookEvent(ME_AV_AVATARCHANGED, AvatarChanged);
@@ -113,7 +117,8 @@ int NotifyModulesLoaded(WPARAM wParam,LPARAM lParam) }
HANDLE hServicesNotify[4];
-void InitNotify() {
+void InitNotify()
+{
hhkShow = HookEvent(ME_NOTIFY_SHOW, Popup2Show);
hhkUpdate = HookEvent(ME_NOTIFY_UPDATE, Popup2Update);
hhkRemove = HookEvent(ME_NOTIFY_REMOVE, Popup2Remove);
@@ -127,7 +132,8 @@ void InitNotify() { hEventNotifyModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, NotifyModulesLoaded);
}
-void DeinitNotify() {
+void DeinitNotify()
+{
UnhookEvent(hhkShow);
UnhookEvent(hhkUpdate);
UnhookEvent(hhkRemove);
diff --git a/plugins/YAPP/src/options.cpp b/plugins/YAPP/src/options.cpp index 90284668a1..ef7a83f2ee 100644 --- a/plugins/YAPP/src/options.cpp +++ b/plugins/YAPP/src/options.cpp @@ -471,7 +471,7 @@ static INT_PTR CALLBACK DlgProcOptsClasses(HWND hwndDlg, UINT msg, WPARAM wParam return 0;
}
-int OptInit(WPARAM wParam, LPARAM lParam)
+int OptInit(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
odp.flags = ODPF_BOLDGROUPS;
diff --git a/plugins/YAPP/src/services.cpp b/plugins/YAPP/src/services.cpp index 64363b252c..bcee759527 100644 --- a/plugins/YAPP/src/services.cpp +++ b/plugins/YAPP/src/services.cpp @@ -40,7 +40,7 @@ void StripBBCodesInPlace(wchar_t *text) }
}
-static INT_PTR CreatePopup(WPARAM wParam, LPARAM lParam)
+static INT_PTR CreatePopup(WPARAM wParam, LPARAM)
{
if (bShutdown)
return -1;
@@ -81,7 +81,7 @@ static INT_PTR CreatePopup(WPARAM wParam, LPARAM lParam) return 0;
}
-static INT_PTR CreatePopupW(WPARAM wParam, LPARAM lParam)
+static INT_PTR CreatePopupW(WPARAM wParam, LPARAM)
{
if (bShutdown)
return -1;
@@ -159,7 +159,7 @@ void ShowPopup(PopupData &pd_in) else PostMPMessage(MUM_CREATEPOPUP, 0, (LPARAM)pd_out);
}
-static INT_PTR GetContact(WPARAM wParam, LPARAM lParam)
+static INT_PTR GetContact(WPARAM wParam, LPARAM)
{
HWND hwndPop = (HWND)wParam;
MCONTACT hContact;
@@ -175,7 +175,7 @@ static INT_PTR GetContact(WPARAM wParam, LPARAM lParam) return (INT_PTR)hContact;
}
-static INT_PTR GetOpaque(WPARAM wParam, LPARAM lParam)
+static INT_PTR GetOpaque(WPARAM wParam, LPARAM)
{
HWND hwndPop = (HWND)wParam;
void *data = 0;
@@ -207,7 +207,7 @@ void UpdateMenu() CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)hTTButton, isEnabled ? TTBST_PUSHED : 0);
}
-INT_PTR PopupQuery(WPARAM wParam, LPARAM lParam)
+INT_PTR PopupQuery(WPARAM wParam, LPARAM)
{
switch(wParam) {
case PUQS_ENABLEPOPUPS:
@@ -235,7 +235,7 @@ INT_PTR PopupQuery(WPARAM wParam, LPARAM lParam) return 0;
}
-static INT_PTR TogglePopups(WPARAM wParam, LPARAM lParam)
+static INT_PTR TogglePopups(WPARAM, LPARAM)
{
BYTE val = db_get_b(0, "Popup", "ModuleIsEnabled", 1);
db_set_b(0, "Popup", "ModuleIsEnabled", !val);
@@ -314,7 +314,7 @@ static INT_PTR ShowMessageW(WPARAM wParam, LPARAM lParam) //=====Popup/ShowHistory
-INT_PTR Popup_ShowHistory(WPARAM wParam, LPARAM lParam)
+INT_PTR Popup_ShowHistory(WPARAM, LPARAM)
{
if (!hHistoryWindow)
hHistoryWindow = CreateDialog(hInst, MAKEINTRESOURCE(IDD_LST_HISTORY), NULL, DlgProcHistLst);
@@ -325,7 +325,7 @@ INT_PTR Popup_ShowHistory(WPARAM wParam, LPARAM lParam) LIST<POPUPCLASS> arClasses(3);
-static INT_PTR RegisterPopupClass(WPARAM wParam, LPARAM lParam)
+static INT_PTR RegisterPopupClass(WPARAM, LPARAM lParam)
{
POPUPCLASS *pc = (POPUPCLASS*)mir_alloc( sizeof(POPUPCLASS));
memcpy(pc, (PVOID)lParam, sizeof(POPUPCLASS));
@@ -356,7 +356,7 @@ static void FreePopupClass(POPUPCLASS *pc) mir_free(pc);
}
-static INT_PTR UnregisterPopupClass(WPARAM wParam, LPARAM lParam)
+static INT_PTR UnregisterPopupClass(WPARAM, LPARAM lParam)
{
POPUPCLASS *pc = (POPUPCLASS*)lParam;
if (pc == NULL)
diff --git a/plugins/YAPP/src/yapp.cpp b/plugins/YAPP/src/yapp.cpp index 5d20b88e62..a5e8575c6f 100644 --- a/plugins/YAPP/src/yapp.cpp +++ b/plugins/YAPP/src/yapp.cpp @@ -42,18 +42,18 @@ PLUGININFOEX pluginInfo={ {0xefd15f16, 0x7ae4, 0x40d7, {0xa8, 0xe3, 0xa4, 0x11, 0xed, 0x74, 0x7b, 0xd5}}
};
-BOOL WINAPI DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
+BOOL WINAPI DllMain(HMODULE hModule, DWORD, LPVOID)
{
hInst = hModule;
return TRUE;
}
-extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfo;
}
-int ReloadFont(WPARAM wParam, LPARAM lParam)
+int ReloadFont(WPARAM, LPARAM)
{
LOGFONT log_font;
if (hFontFirstLine) DeleteObject(hFontFirstLine);
@@ -185,7 +185,7 @@ void InitMenuItems(void) hMenuItem = Menu_AddMainMenuItem(&mi);
}
-int ModulesLoaded(WPARAM wParam, LPARAM lParam)
+int ModulesLoaded(WPARAM, LPARAM)
{
MNotifyGetLink();
@@ -203,7 +203,7 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) return 0;
}
-int PreShutdown(WPARAM wParam, LPARAM lParam)
+int PreShutdown(WPARAM, LPARAM)
{
bShutdown = true;
DeinitMessagePump();
diff --git a/plugins/YAPP/src/yapp_history_dlg.cpp b/plugins/YAPP/src/yapp_history_dlg.cpp index 640e5c5020..b8173a6f67 100644 --- a/plugins/YAPP/src/yapp_history_dlg.cpp +++ b/plugins/YAPP/src/yapp_history_dlg.cpp @@ -401,7 +401,7 @@ void AddEventsCustomControl(HWND hWnd, int renderer, TCHAR *filter, SIG_MATCHESF }
}
-void AddEventsDefault(HWND hWnd, int renderer, TCHAR *filter, SIG_MATCHESFILTER MatchesFilter)
+void AddEventsDefault(HWND hWnd, int, TCHAR *filter, SIG_MATCHESFILTER MatchesFilter)
{
HWND hHistoryList = GetDlgItem(hWnd, IDC_LST_HISTORY);
TCHAR buffer[1024];
diff --git a/plugins/YahooGroups/src/YahooGroups.cpp b/plugins/YahooGroups/src/YahooGroups.cpp index cf2d09b11c..1af56490b7 100644 --- a/plugins/YahooGroups/src/YahooGroups.cpp +++ b/plugins/YahooGroups/src/YahooGroups.cpp @@ -51,8 +51,6 @@ extern "C" int __declspec(dllexport) Load() mir_getLP(&pluginInfo);
mir_getCLI();
- LogInit();
-
currentCodePage = Langpack_GetDefaultCodePage();
InitServices();
diff --git a/plugins/YahooGroups/src/utils.cpp b/plugins/YahooGroups/src/utils.cpp index a811bc5e64..60034353ce 100644 --- a/plugins/YahooGroups/src/utils.cpp +++ b/plugins/YahooGroups/src/utils.cpp @@ -20,51 +20,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h"
-int LogInit()
-{
-#ifdef USE_LOG
- //FILE *fout = fopen(LOG_FILE, "wt");
- //fclose(fout);
- Log("********************** Miranda started **********************");
-#endif
- return 0;
-}
-
-int Log(char *format, ...)
-{
-#ifdef USE_LOG
- char str[4096];
- va_list vararg;
- int tBytes;
- FILE *fout = fopen(LOG_FILE, "at");
- if (!fout)
- {
-// MessageBox(0, "can't open file", NULL, MB_OK);
- return -1;
- }
- time_t tNow = time(NULL);
- struct tm *now = localtime(&tNow);
- strftime(str, sizeof(str), "%d %b %Y @ %H:%M:%S: ", now);
- fputs(str, fout);
- va_start(vararg, format);
-
- tBytes = mir_vsnprintf(str, sizeof(str), format, vararg);
- if (tBytes > 0)
- {
- str[tBytes] = 0;
- }
-
- va_end(vararg);
- if (str[mir_strlen(str) - 1] != '\n')
- {
- mir_strcat(str, "\n");
- }
- fputs(str, fout);
- fclose(fout);
-#endif
- return 0;
-}
-
int Info(char *title, char *format, ...)
{
char str[4096];
@@ -73,9 +28,8 @@ int Info(char *title, char *format, ...) va_start(vararg, format);
tBytes = mir_vsnprintf(str, sizeof(str), format, vararg);
if (tBytes > 0)
- {
- str[tBytes] = 0;
- }
+ str[tBytes] = 0;
+
va_end(vararg);
return MessageBoxA(0, str, title, MB_OK | MB_ICONINFORMATION);
}
diff --git a/plugins/YahooGroups/src/utils.h b/plugins/YahooGroups/src/utils.h index 3239217211..8269e2c61c 100644 --- a/plugins/YahooGroups/src/utils.h +++ b/plugins/YahooGroups/src/utils.h @@ -24,17 +24,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h"
-//#define USE_LOG
-#define LOG_FILE "yahoogroups.log"
-
#define ANCHOR_LEFT 0x000001
#define ANCHOR_RIGHT 0x000002
#define ANCHOR_TOP 0x000004
#define ANCHOR_BOTTOM 0x000008
#define ANCHOR_ALL ANCHOR_LEFT | ANCHOR_RIGHT | ANCHOR_TOP | ANCHOR_BOTTOM
-int LogInit();
-int Log(char *format, ...);
int Info(char *title, char *format, ...);
char *BinToHex(int size, PBYTE data);
diff --git a/plugins/ZeroNotification/src/main.cpp b/plugins/ZeroNotification/src/main.cpp index e4434913e4..d6950cb701 100644 --- a/plugins/ZeroNotification/src/main.cpp +++ b/plugins/ZeroNotification/src/main.cpp @@ -17,21 +17,22 @@ static HANDLE hEventSoundSettingChange, hEventStatusModeChange, hEventOptionsIni HGENMENU noSoundMenu;
int hLangpack;
-struct CheckBoxValues_t {
+struct CheckBoxValues_t
+{
DWORD style;
TCHAR *szDescr;
};
-static const struct CheckBoxValues_t statusValues[]={
- {PF2_ONLINE, TEXT("Online")},
- {PF2_SHORTAWAY, TEXT("Away")},
- {PF2_LONGAWAY, TEXT("NA")},
- {PF2_LIGHTDND, TEXT("Occupied")},
- {PF2_HEAVYDND, TEXT("DND")},
- {PF2_FREECHAT, TEXT("Free for chat")},
- {PF2_INVISIBLE, TEXT("Invisible")},
- {PF2_OUTTOLUNCH, TEXT("Out to lunch")},
- {PF2_ONTHEPHONE, TEXT("On the phone")}
+static const struct CheckBoxValues_t statusValues[] = {
+ { PF2_ONLINE, TEXT("Online") },
+ { PF2_SHORTAWAY, TEXT("Away") },
+ { PF2_LONGAWAY, TEXT("NA") },
+ { PF2_LIGHTDND, TEXT("Occupied") },
+ { PF2_HEAVYDND, TEXT("DND") },
+ { PF2_FREECHAT, TEXT("Free for chat") },
+ { PF2_INVISIBLE, TEXT("Invisible") },
+ { PF2_OUTTOLUNCH, TEXT("Out to lunch") },
+ { PF2_ONTHEPHONE, TEXT("On the phone") }
};
PLUGININFOEX pluginInfoEx = {
@@ -45,49 +46,49 @@ PLUGININFOEX pluginInfoEx = { __AUTHORWEB,
UNICODE_AWARE,
// {47D489D3-310D-4EF6-BD05-699FFFD5A4AA}
- {0x47d489d3, 0x310d, 0x4ef6, {0xbd, 0x5, 0x69, 0x9f, 0xff, 0xd5, 0xa4, 0xaa}}
+ { 0x47d489d3, 0x310d, 0x4ef6, { 0xbd, 0x5, 0x69, 0x9f, 0xff, 0xd5, 0xa4, 0xaa } }
};
-extern "C" __declspec(dllexport) PLUGININFOEX * MirandaPluginInfoEx(DWORD mirandaVersion)
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfoEx;
}
-BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
+BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
{
hInst = hinstDLL;
return TRUE;
}
-static void FillCheckBoxTree(HWND hwndTree,const struct CheckBoxValues_t *values,int nValues,DWORD style)
+static void FillCheckBoxTree(HWND hwndTree, const struct CheckBoxValues_t *values, int nValues, DWORD style)
{
TVINSERTSTRUCT tvis;
int i;
- tvis.hParent=NULL;
- tvis.hInsertAfter=TVI_LAST;
- tvis.item.mask=TVIF_PARAM|TVIF_TEXT|TVIF_STATE;
- for(i=0;i<nValues;i++) {
- tvis.item.lParam=values[i].style;
+ tvis.hParent = NULL;
+ tvis.hInsertAfter = TVI_LAST;
+ tvis.item.mask = TVIF_PARAM | TVIF_TEXT | TVIF_STATE;
+ for (i = 0; i < nValues; i++) {
+ tvis.item.lParam = values[i].style;
tvis.item.pszText = TranslateTS(values[i].szDescr);
- tvis.item.stateMask=TVIS_STATEIMAGEMASK;
- tvis.item.state=INDEXTOSTATEIMAGEMASK((style&tvis.item.lParam)!=0?2:1);
- TreeView_InsertItem(hwndTree,&tvis);
+ tvis.item.stateMask = TVIS_STATEIMAGEMASK;
+ tvis.item.state = INDEXTOSTATEIMAGEMASK((style&tvis.item.lParam) != 0 ? 2 : 1);
+ TreeView_InsertItem(hwndTree, &tvis);
}
}
static DWORD MakeCheckBoxTreeFlags(HWND hwndTree)
{
- DWORD flags=0;
+ DWORD flags = 0;
TVITEM tvi;
- tvi.mask=TVIF_HANDLE|TVIF_PARAM|TVIF_STATE;
- tvi.hItem=TreeView_GetRoot(hwndTree);
- while(tvi.hItem) {
- TreeView_GetItem(hwndTree,&tvi);
- if (((tvi.state & TVIS_STATEIMAGEMASK)>>12 == 2))
+ tvi.mask = TVIF_HANDLE | TVIF_PARAM | TVIF_STATE;
+ tvi.hItem = TreeView_GetRoot(hwndTree);
+ while (tvi.hItem) {
+ TreeView_GetItem(hwndTree, &tvi);
+ if (((tvi.state & TVIS_STATEIMAGEMASK) >> 12 == 2))
flags |= tvi.lParam;
- tvi.hItem = TreeView_GetNextSibling(hwndTree,tvi.hItem);
+ tvi.hItem = TreeView_GetNextSibling(hwndTree, tvi.hItem);
}
return flags;
}
@@ -99,10 +100,10 @@ static void UpdateMenuItem() }
//Called when the sound setting in the database is changed
-static int SoundSettingChanged(WPARAM hContact,LPARAM lParam)
+static int SoundSettingChanged(WPARAM, LPARAM lParam)
{
- DBCONTACTWRITESETTING *cws=(DBCONTACTWRITESETTING*)lParam;
- if(mir_strcmp(cws->szModule, "Skin") || mir_strcmp(cws->szSetting, "UseSound"))
+ DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam;
+ if (mir_strcmp(cws->szModule, "Skin") || mir_strcmp(cws->szSetting, "UseSound"))
return 0;
UpdateMenuItem();
@@ -111,27 +112,27 @@ static int SoundSettingChanged(WPARAM hContact,LPARAM lParam) static int SetNotify(const long status)
{
- db_set_b(NULL,"Skin","UseSound", (BYTE) !(db_get_dw(NULL, MODNAME, "NoSound",DEFAULT_NOSOUND) & status));
- db_set_b(NULL,"CList","DisableTrayFlash", (BYTE) (db_get_dw(NULL, MODNAME, "NoBlink",DEFAULT_NOBLINK) & status));
- db_set_b(NULL,"CList","NoIconBlink", (BYTE) (db_get_dw(NULL, MODNAME, "NoCLCBlink",DEFAULT_NOCLCBLINK) & status));
+ db_set_b(NULL, "Skin", "UseSound", (BYTE)!(db_get_dw(NULL, MODNAME, "NoSound", DEFAULT_NOSOUND) & status));
+ db_set_b(NULL, "CList", "DisableTrayFlash", (BYTE)(db_get_dw(NULL, MODNAME, "NoBlink", DEFAULT_NOBLINK) & status));
+ db_set_b(NULL, "CList", "NoIconBlink", (BYTE)(db_get_dw(NULL, MODNAME, "NoCLCBlink", DEFAULT_NOCLCBLINK) & status));
UpdateMenuItem();
return 0;
}
//Called whenever a change in status is detected
-static int ProtoAck(WPARAM wParam, LPARAM lParam)
+static int ProtoAck(WPARAM, LPARAM lParam)
{
- ACKDATA *ack=(ACKDATA*)lParam;
+ ACKDATA *ack = (ACKDATA*)lParam;
PROTOACCOUNT **protos;
//quit if not status event
- if ( ack->type == ACKTYPE_STATUS && ack->result == ACKRESULT_SUCCESS ) {
+ if (ack->type == ACKTYPE_STATUS && ack->result == ACKRESULT_SUCCESS) {
long status = 0;
int count;
Proto_EnumAccounts(&count, &protos);
- for (int i=0; i < count; i++)
+ for (int i = 0; i < count; i++)
status = status | Proto_Status2Flag(CallProtoService(protos[i]->szModuleName, PS_GETSTATUS, 0, 0));
SetNotify(status);
@@ -140,43 +141,42 @@ static int ProtoAck(WPARAM wParam, LPARAM lParam) return 0;
}
-static INT_PTR CALLBACK DlgProcNoSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+static INT_PTR CALLBACK DlgProcNoSoundOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM lParam)
{
DWORD test;
- switch (msg)
- {
+ switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- SetWindowLongPtr(GetDlgItem(hwndDlg,IDC_NOSOUND),GWL_STYLE,GetWindowLongPtr(GetDlgItem(hwndDlg,IDC_NOSOUND),GWL_STYLE)|TVS_NOHSCROLL|TVS_CHECKBOXES);
- SetWindowLongPtr(GetDlgItem(hwndDlg,IDC_NOBLINK),GWL_STYLE,GetWindowLongPtr(GetDlgItem(hwndDlg,IDC_NOBLINK),GWL_STYLE)|TVS_NOHSCROLL|TVS_CHECKBOXES);
- SetWindowLongPtr(GetDlgItem(hwndDlg,IDC_NOCLCBLINK),GWL_STYLE,GetWindowLongPtr(GetDlgItem(hwndDlg,IDC_NOCLCBLINK),GWL_STYLE)|TVS_NOHSCROLL|TVS_CHECKBOXES);
- CheckDlgButton(hwndDlg, IDC_HIDEMENU, db_get_b(NULL, MODNAME, "HideMenu",1) ? BST_CHECKED : BST_UNCHECKED);
-
- FillCheckBoxTree(GetDlgItem(hwndDlg,IDC_NOSOUND),statusValues,sizeof(statusValues)/sizeof(statusValues[0]),db_get_dw(NULL, MODNAME, "NoSound",DEFAULT_NOSOUND));
- FillCheckBoxTree(GetDlgItem(hwndDlg,IDC_NOBLINK),statusValues,sizeof(statusValues)/sizeof(statusValues[0]),db_get_dw(NULL, MODNAME, "NoBlink",DEFAULT_NOBLINK));
- FillCheckBoxTree(GetDlgItem(hwndDlg,IDC_NOCLCBLINK),statusValues,sizeof(statusValues)/sizeof(statusValues[0]),db_get_dw(NULL, MODNAME, "NoCLCBlink",DEFAULT_NOCLCBLINK));
+ SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_NOSOUND), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_NOSOUND), GWL_STYLE) | TVS_NOHSCROLL | TVS_CHECKBOXES);
+ SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_NOBLINK), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_NOBLINK), GWL_STYLE) | TVS_NOHSCROLL | TVS_CHECKBOXES);
+ SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_NOCLCBLINK), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_NOCLCBLINK), GWL_STYLE) | TVS_NOHSCROLL | TVS_CHECKBOXES);
+ CheckDlgButton(hwndDlg, IDC_HIDEMENU, db_get_b(NULL, MODNAME, "HideMenu", 1) ? BST_CHECKED : BST_UNCHECKED);
+
+ FillCheckBoxTree(GetDlgItem(hwndDlg, IDC_NOSOUND), statusValues, sizeof(statusValues) / sizeof(statusValues[0]), db_get_dw(NULL, MODNAME, "NoSound", DEFAULT_NOSOUND));
+ FillCheckBoxTree(GetDlgItem(hwndDlg, IDC_NOBLINK), statusValues, sizeof(statusValues) / sizeof(statusValues[0]), db_get_dw(NULL, MODNAME, "NoBlink", DEFAULT_NOBLINK));
+ FillCheckBoxTree(GetDlgItem(hwndDlg, IDC_NOCLCBLINK), statusValues, sizeof(statusValues) / sizeof(statusValues[0]), db_get_dw(NULL, MODNAME, "NoCLCBlink", DEFAULT_NOCLCBLINK));
return TRUE;
case WM_COMMAND:
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
case WM_NOTIFY:
- switch(((LPNMHDR)lParam)->idFrom) {
+ switch (((LPNMHDR)lParam)->idFrom) {
case IDC_NOSOUND:
case IDC_NOBLINK:
case IDC_NOCLCBLINK:
- if (((LPNMHDR)lParam)->code==NM_CLICK) {
+ if (((LPNMHDR)lParam)->code == NM_CLICK) {
TVHITTESTINFO hti;
- hti.pt.x=(short)LOWORD(GetMessagePos());
- hti.pt.y=(short)HIWORD(GetMessagePos());
- ScreenToClient(((LPNMHDR)lParam)->hwndFrom,&hti.pt);
- if(TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom,&hti)) {
- if(hti.flags&TVHT_ONITEMSTATEICON) {
+ hti.pt.x = (short)LOWORD(GetMessagePos());
+ hti.pt.y = (short)HIWORD(GetMessagePos());
+ ScreenToClient(((LPNMHDR)lParam)->hwndFrom, &hti.pt);
+ if (TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom, &hti)) {
+ if (hti.flags&TVHT_ONITEMSTATEICON) {
TVITEM tvi;
- tvi.mask=TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
- tvi.hItem=hti.hItem;
- TreeView_GetItem(((LPNMHDR)lParam)->hwndFrom,&tvi);
- tvi.iImage=tvi.iSelectedImage=tvi.iImage==1?2:1;
- TreeView_SetItem(((LPNMHDR)lParam)->hwndFrom,&tvi);
+ tvi.mask = TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
+ tvi.hItem = hti.hItem;
+ TreeView_GetItem(((LPNMHDR)lParam)->hwndFrom, &tvi);
+ tvi.iImage = tvi.iSelectedImage = tvi.iImage == 1 ? 2 : 1;
+ TreeView_SetItem(((LPNMHDR)lParam)->hwndFrom, &tvi);
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
}
}
@@ -185,14 +185,14 @@ static INT_PTR CALLBACK DlgProcNoSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- db_set_b(NULL, MODNAME, "HideMenu",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_HIDEMENU));
+ db_set_b(NULL, MODNAME, "HideMenu", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_HIDEMENU));
- db_set_dw(NULL, MODNAME, "NoSound",MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg,IDC_NOSOUND)));
- db_set_dw(NULL, MODNAME, "NoBlink",MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg,IDC_NOBLINK)));
- db_set_dw(NULL, MODNAME, "NoCLCBlink",MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg,IDC_NOCLCBLINK)));
+ db_set_dw(NULL, MODNAME, "NoSound", MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg, IDC_NOSOUND)));
+ db_set_dw(NULL, MODNAME, "NoBlink", MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg, IDC_NOBLINK)));
+ db_set_dw(NULL, MODNAME, "NoCLCBlink", MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg, IDC_NOCLCBLINK)));
- test = db_get_w(NULL,"CList","Status",0);
- SetNotify(Proto_Status2Flag(db_get_w(NULL,"CList","Status",0)));
+ test = db_get_w(NULL, "CList", "Status", 0);
+ SetNotify(Proto_Status2Flag(db_get_w(NULL, "CList", "Status", 0)));
return TRUE;
}
break;
@@ -201,7 +201,7 @@ static INT_PTR CALLBACK DlgProcNoSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam return FALSE;
}
//Called when the user opened the options dialog
-static int OptionsInitialize(WPARAM wParam,LPARAM lParam)
+static int OptionsInitialize(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
odp.position = 100000000;
@@ -216,12 +216,12 @@ static int OptionsInitialize(WPARAM wParam,LPARAM lParam) return 0;
}
-static INT_PTR NoSoundMenuCommand(WPARAM wParam,LPARAM lParam)
+static INT_PTR NoSoundMenuCommand(WPARAM, LPARAM)
{
- if (db_get_b(NULL,"Skin","UseSound",1))
- db_set_b(NULL,"Skin","UseSound",0);
-// else
-// db_set_b(NULL,"Skin","UseSound",1);
+ if (db_get_b(NULL, "Skin", "UseSound", 1))
+ db_set_b(NULL, "Skin", "UseSound", 0);
+ // else
+ // db_set_b(NULL,"Skin","UseSound",1);
return 0;
}
@@ -233,7 +233,7 @@ extern "C" __declspec(dllexport) int Load(void) //The menu item - begin
if (!db_get_b(NULL, MODNAME, "HideMenu", 1)) {
hSoundMenu = CreateServiceFunction(MODNAME "/MenuCommand", NoSoundMenuCommand);
-
+
CMenuItem mi;
mi.position = -0x7FFFFFFF;
mi.flags = CMIF_TCHAR;
|