diff options
Diffstat (limited to 'plugins')
43 files changed, 225 insertions, 258 deletions
diff --git a/plugins/AVS/src/options.cpp b/plugins/AVS/src/options.cpp index 7f52dc1a75..d6b94ba9a7 100644 --- a/plugins/AVS/src/options.cpp +++ b/plugins/AVS/src/options.cpp @@ -75,7 +75,7 @@ static void RemoveProtoPic(const char *szProto) if (p.szProtoname == NULL) continue; - PROTOACCOUNT* pdescr = (PROTOACCOUNT*)CallService(MS_PROTO_GETACCOUNT, 0, (LPARAM)p.szProtoname); + PROTOACCOUNT *pdescr = ProtoGetAccount(p.szProtoname); if (pdescr == NULL && lstrcmpA(p.szProtoname, szProto)) continue; diff --git a/plugins/AdvaImg/src/FreeImageToolkit/Background.cpp b/plugins/AdvaImg/src/FreeImageToolkit/Background.cpp index db481e7728..fc18667b21 100644 --- a/plugins/AdvaImg/src/FreeImageToolkit/Background.cpp +++ b/plugins/AdvaImg/src/FreeImageToolkit/Background.cpp @@ -222,6 +222,7 @@ FillBackgroundBitmap(FIBITMAP *dib, const RGBQUAD *color, int options) { return FALSE; } + RGBQUAD blend; const RGBQUAD *color_intl = color; unsigned bpp = FreeImage_GetBPP(dib); unsigned width = FreeImage_GetWidth(dib); @@ -264,7 +265,6 @@ FillBackgroundBitmap(FIBITMAP *dib, const RGBQUAD *color, int options) { bgcolor.rgbRed = src_bits[FI_RGBA_RED]; bgcolor.rgbReserved = 0xFF; } - RGBQUAD blend; GetAlphaBlendedColor(&bgcolor, color_intl, &blend); color_intl = &blend; } diff --git a/plugins/AvatarHistory/src/AvatarDlg.cpp b/plugins/AvatarHistory/src/AvatarDlg.cpp index 64ff1338c0..2c4f63afd4 100644 --- a/plugins/AvatarHistory/src/AvatarDlg.cpp +++ b/plugins/AvatarHistory/src/AvatarDlg.cpp @@ -557,9 +557,9 @@ int ShowSaveDialog(HWND hwnd, TCHAR* fn, MCONTACT hContact) ofn.lpstrFile = file;
TCHAR *displayName = (TCHAR*) CallService(MS_CLIST_GETCONTACTDISPLAYNAME,hContact,GCDNF_TCHAR);
+ TCHAR title[MAX_PATH];
if (displayName)
{
- TCHAR title[MAX_PATH];
mir_sntprintf(title,sizeof(title),TranslateT("Save Avatar for %s"),displayName);
ofn.lpstrTitle = title;
}
diff --git a/plugins/BossKeyPlus/src/BossKeyIdle.cpp b/plugins/BossKeyPlus/src/BossKeyIdle.cpp index bec29756f4..57a1044734 100644 --- a/plugins/BossKeyPlus/src/BossKeyIdle.cpp +++ b/plugins/BossKeyPlus/src/BossKeyIdle.cpp @@ -34,7 +34,7 @@ static bool IsUserIdle() {
DWORD dwTick;
if ( g_wMaskAdv & OPT_HIDEIFMIRIDLE ) {
- CallService(MS_SYSTEM_GETIDLE, 0, (DWORD)&dwTick);
+ CallService(MS_SYSTEM_GETIDLE, 0, (LPARAM)&dwTick);
return GetTickCount() - dwTick > (minutes * 60 * 1000);
}
diff --git a/plugins/ChangeKeyboardLayout/src/text_operations.cpp b/plugins/ChangeKeyboardLayout/src/text_operations.cpp index 0de0987572..b535100331 100644 --- a/plugins/ChangeKeyboardLayout/src/text_operations.cpp +++ b/plugins/ChangeKeyboardLayout/src/text_operations.cpp @@ -286,7 +286,7 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord) if (WindowType == WTYPE_RichEdit) {
EditStreamData esdData;
EDITSTREAM esStream = { 0 };
- esStream.dwCookie = (DWORD)&esdData;
+ esStream.dwCookie = (DWORD_PTR)&esdData;
esStream.pfnCallback = EditStreamOutRtf;
if (SendMessage(hTextWnd, EM_STREAMOUT, SF_TEXT | SF_UNICODE | SFF_SELECTION, (LPARAM)&esStream) > 0)
ptszInText = GeTStringFromStreamData(&esdData);
@@ -324,7 +324,7 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord) EditStreamData esdData;
EDITSTREAM esStream = { 0 };
- esStream.dwCookie = (DWORD)&esdData;
+ esStream.dwCookie = (DWORD_PTR)&esdData;
esStream.pfnCallback = EditStreamOutRtf;
if (SendMessage(hTextWnd, EM_STREAMOUT, SF_TEXT | SF_UNICODE | SFF_SELECTION, (LPARAM)&esStream) != 0)
ptszInText = GeTStringFromStreamData(&esdData);
@@ -363,7 +363,7 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord) EditStreamData esdData;
EDITSTREAM esStream = { 0 };
- esStream.dwCookie = (DWORD)&esdData;
+ esStream.dwCookie = (DWORD_PTR)&esdData;
esStream.pfnCallback = EditStreamOutRtf;
if (SendMessage(hTextWnd, EM_STREAMOUT, SF_TEXT | SF_UNICODE | SFF_SELECTION, (LPARAM)&esStream) != 0)
ptszInText = GeTStringFromStreamData(&esdData);
diff --git a/plugins/DbEditorPP/src/exportimport.cpp b/plugins/DbEditorPP/src/exportimport.cpp index 7bd1643e0c..2d452fac31 100644 --- a/plugins/DbEditorPP/src/exportimport.cpp +++ b/plugins/DbEditorPP/src/exportimport.cpp @@ -241,7 +241,8 @@ void exportDB(MCONTACT hContact, char *module) }
else
{
- if (module == "") module = NULL; // reset module for all contacts export
+ if (*module = '\0')
+ module = NULL; // reset module for all contacts export
}
hContact = db_find_first();
@@ -422,7 +423,7 @@ void importSettings(MCONTACT hContact, char *importstring ) else if (importstring[i] == '[' && !strchr(&importstring[i+1],'='))// get the module
{
if (end = strpbrk(&importstring[i+1], "]")) {
- if ((end+1) != '\0') *end = '\0';
+ if (*(end+1) != '\0') *end = '\0';
strcpy(module, &importstring[i+1]);
}
}
@@ -430,7 +431,7 @@ void importSettings(MCONTACT hContact, char *importstring ) !strchr(&importstring[i+2],'='))// get the module
{
if (end = strpbrk(&importstring[i+2], "]")) {
- if ((end+1) != '\0') *end = '\0';
+ if (*(end+1) != '\0') *end = '\0';
strcpy(module, &importstring[i+2]);
deleteModule(module, hContact, 1);
}
@@ -438,7 +439,7 @@ void importSettings(MCONTACT hContact, char *importstring ) else if (strstr(&importstring[i], "=") && module[0]) // get the setting
{
if (end = strpbrk(&importstring[i+1], "=")) {
- if ((end+1) != '\0') *end = '\0';
+ if (*(end+1) != '\0') *end = '\0';
strcpy(setting, &importstring[i]);
// get the type
diff --git a/plugins/DbEditorPP/src/settinglist.cpp b/plugins/DbEditorPP/src/settinglist.cpp index 1cb5f3975f..c9d655c698 100644 --- a/plugins/DbEditorPP/src/settinglist.cpp +++ b/plugins/DbEditorPP/src/settinglist.cpp @@ -659,8 +659,8 @@ INT_PTR CALLBACK SettingsCompare(LPARAM lParam1, LPARAM lParam2, LPARAM myParam) const int maxSize = 1024;
TCHAR text1[maxSize];
TCHAR text2[maxSize];
- ListView_GetItemText(params.hList, (int)lParam1, params.column, text1, maxSize);
- ListView_GetItemText(params.hList, (int)lParam2, params.column, text2, maxSize);
+ ListView_GetItemText(params.hList, lParam1, params.column, text1, maxSize);
+ ListView_GetItemText(params.hList, lParam2, params.column, text2, maxSize);
int res = _tcsicmp(text1, text2);
res = (params.column == lastColumn) ? -res : res;
diff --git a/plugins/HistoryStats/src/bandctrlimpl.cpp b/plugins/HistoryStats/src/bandctrlimpl.cpp index b68dadee1d..feeabb2eb1 100644 --- a/plugins/HistoryStats/src/bandctrlimpl.cpp +++ b/plugins/HistoryStats/src/bandctrlimpl.cpp @@ -124,7 +124,7 @@ LRESULT CALLBACK BandCtrlImpl::staticWndProc(HWND hWnd, UINT msg, WPARAM wParam, case BCM_SETBUTTONDATA:
assert(wParam >= 1 && wParam <= pCtrl->m_Items.size());
- pCtrl->m_Items[wParam - 1].dwData = static_cast<DWORD>(lParam);
+ pCtrl->m_Items[wParam - 1].dwData = static_cast<INT_PTR>(lParam);
return 0;
case BCM_ISBUTTONVISIBLE:
diff --git a/plugins/HistoryStats/src/dlgfilterwords.cpp b/plugins/HistoryStats/src/dlgfilterwords.cpp index cb5a0ff30d..be60d0bbf2 100644 --- a/plugins/HistoryStats/src/dlgfilterwords.cpp +++ b/plugins/HistoryStats/src/dlgfilterwords.cpp @@ -102,7 +102,7 @@ void DlgFilterWords::onWMInitDialog() {
const Filter* pFilter = *i;
- HANDLE hCheck = m_Sets.insertCheck(NULL, pFilter->getName().c_str(), 0, reinterpret_cast<DWORD>(pFilter));
+ HANDLE hCheck = m_Sets.insertCheck(NULL, pFilter->getName().c_str(), 0, reinterpret_cast<INT_PTR>(pFilter));
if (m_bColProvided && m_ColFilters.find(pFilter->getID()) != m_ColFilters.end())
m_Sets.checkItem(hCheck, true);
diff --git a/plugins/HistoryStats/src/dlgoption_subcolumns.cpp b/plugins/HistoryStats/src/dlgoption_subcolumns.cpp index 24cff27083..a11e1e0f52 100644 --- a/plugins/HistoryStats/src/dlgoption_subcolumns.cpp +++ b/plugins/HistoryStats/src/dlgoption_subcolumns.cpp @@ -238,7 +238,7 @@ void DlgOption::SubColumns::loadSettings() {
Column* pCol = localS.getCol(j);
ext::string colTitle = pCol->getTitleForOptions();
- OptionsCtrl::Check hColCheck = m_Columns.insertCheck(NULL, colTitle.c_str(), 0, reinterpret_cast<DWORD>(pCol));
+ OptionsCtrl::Check hColCheck = m_Columns.insertCheck(NULL, colTitle.c_str(), 0, reinterpret_cast<INT_PTR>(pCol));
m_Columns.checkItem(hColCheck, pCol->isEnabled());
@@ -332,7 +332,7 @@ void DlgOption::SubColumns::addCol(int nCol) getParent()->getLocalSettings().addCol(pCol);
- OptionsCtrl::Check hColCheck = m_Columns.insertCheck(NULL, pCol->getTitle(), 0, reinterpret_cast<DWORD>(pCol));
+ OptionsCtrl::Check hColCheck = m_Columns.insertCheck(NULL, pCol->getTitle(), 0, reinterpret_cast<INT_PTR>(pCol));
m_Columns.checkItem(hColCheck, pCol->isEnabled());
diff --git a/plugins/HistoryStats/src/dlgoption_subglobal.cpp b/plugins/HistoryStats/src/dlgoption_subglobal.cpp index b89a9e1e0f..6ea0d7944c 100644 --- a/plugins/HistoryStats/src/dlgoption_subglobal.cpp +++ b/plugins/HistoryStats/src/dlgoption_subglobal.cpp @@ -249,7 +249,7 @@ void DlgOption::SubGlobal::onWMInitDialog() m_hProtocols,
Protocol::getDisplayName(protoList[i]->szModuleName).c_str(),
0,
- reinterpret_cast<DWORD>(protoList[i]->szModuleName)));
+ reinterpret_cast<INT_PTR>(protoList[i]->szModuleName)));
}
}
diff --git a/plugins/HistoryStats/src/dlgoption_subinput.cpp b/plugins/HistoryStats/src/dlgoption_subinput.cpp index 7d61c56b63..d499f8d6de 100644 --- a/plugins/HistoryStats/src/dlgoption_subinput.cpp +++ b/plugins/HistoryStats/src/dlgoption_subinput.cpp @@ -111,7 +111,7 @@ void DlgOption::SubInput::onWMInitDialog() m_hProtocols,
Protocol::getDisplayName(protoList[i]->szModuleName).c_str(),
0,
- reinterpret_cast<DWORD>(protoList[i]->szModuleName)));
+ reinterpret_cast<INT_PTR>(protoList[i]->szModuleName)));
}
}
diff --git a/plugins/IEView/src/IEView.cpp b/plugins/IEView/src/IEView.cpp index 07f071e3eb..a2a7a13721 100644 --- a/plugins/IEView/src/IEView.cpp +++ b/plugins/IEView/src/IEView.cpp @@ -1103,7 +1103,7 @@ BSTR IEView::getHrefFromAnchor(IHTMLElement *element) if (SUCCEEDED(element->QueryInterface(IID_IHTMLAnchorElement, (void**)&pAnchor)) && (pAnchor!=NULL)) {
VARIANT variant;
BSTR url;
- if (SUCCEEDED(element->getAttribute(L"href", 2, &variant) && variant.vt == VT_BSTR)) {
+ if (SUCCEEDED(element->getAttribute(L"href", 2, &variant)) && (variant.vt == VT_BSTR)) {
url = mir_tstrdup(variant.bstrVal);
SysFreeString(variant.bstrVal);
}
diff --git a/plugins/KeyboardNotify/src/main.cpp b/plugins/KeyboardNotify/src/main.cpp index 29d448d822..73ea6cf54b 100644 --- a/plugins/KeyboardNotify/src/main.cpp +++ b/plugins/KeyboardNotify/src/main.cpp @@ -452,13 +452,13 @@ static VOID CALLBACK ReminderTimer(HWND hwnd, UINT message, UINT_PTR idEvent, DW // Support for third-party plugins and mBot's scripts -static INT_PTR EnableService(WPARAM wParam, LPARAM lParam) +static INT_PTR EnableService(WPARAM, LPARAM) { bFlashingEnabled = TRUE; return 0; } -static INT_PTR DisableService(WPARAM wParam, LPARAM lParam) +static INT_PTR DisableService(WPARAM, LPARAM) { bFlashingEnabled = FALSE; return 0; @@ -487,12 +487,12 @@ static INT_PTR EventsWereOpenedService(WPARAM wParam, LPARAM lParam) } -static INT_PTR IsFlashingActiveService(WPARAM wParam, LPARAM lParam) +static INT_PTR IsFlashingActiveService(WPARAM, LPARAM) { if (!bReminderDisabled) return 0; - return (int)getCurrentSequenceString(); + return (INT_PTR)getCurrentSequenceString(); } @@ -508,10 +508,11 @@ INT_PTR NormalizeSequenceService(WPARAM wParam, LPARAM lParam) // Support for Trigger plugin -static void ForceEventsWereOpenedThread(void *eventMaxSeconds) +static DWORD WINAPI ForceEventsWereOpenedThread(void *eventMaxSeconds) { Sleep(((WORD)eventMaxSeconds) * 1000); CallService(MS_KBDNOTIFY_EVENTSOPENED, 1, 0); + return 0; } @@ -520,7 +521,7 @@ void StartBlinkAction(char *flashSequence, WORD eventMaxSeconds) DWORD threadID = 0; if (eventMaxSeconds) - CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ForceEventsWereOpenedThread, (void *)eventMaxSeconds, 0, &threadID); + CreateThread(NULL, 0, ForceEventsWereOpenedThread, (void *)eventMaxSeconds, 0, &threadID); CallService(MS_KBDNOTIFY_STARTBLINK, 1, (LPARAM)flashSequence); } @@ -540,7 +541,7 @@ void createProcessList(void) if (db_get_ts(NULL, KEYBDMODULE, fmtDBSettingName("process%d", i), &dbv)) ProcessList.szFileName[i] = NULL; else { - ProcessList.szFileName[i] = (TCHAR *)malloc(wcslen(dbv.ptszVal) + 1); + ProcessList.szFileName[i] = (TCHAR *)malloc((wcslen(dbv.ptszVal) + 1)*sizeof(TCHAR)); if (ProcessList.szFileName[i]) wcscpy(ProcessList.szFileName[i], dbv.ptszVal); db_free(&dbv); @@ -586,9 +587,9 @@ void LoadSettings(void) bMirandaOrWindows = db_get_b(NULL, KEYBDMODULE, "mirorwin", DEF_SETTING_MIRORWIN); wStatusMap = db_get_w(NULL, KEYBDMODULE, "status", DEF_SETTING_STATUS); wReminderCheck = db_get_w(NULL, KEYBDMODULE, "remcheck", DEF_SETTING_CHECKTIME); - bFlashLed[0] = !!db_get_b(NULL, KEYBDMODULE, "fnum", DEF_SETTING_FLASHNUM); - bFlashLed[1] = !!db_get_b(NULL, KEYBDMODULE, "fcaps", DEF_SETTING_FLASHCAPS); - bFlashLed[2] = !!db_get_b(NULL, KEYBDMODULE, "fscroll", DEF_SETTING_FLASHSCROLL); + bFlashLed[0] = db_get_b(NULL, KEYBDMODULE, "fnum", DEF_SETTING_FLASHNUM); + bFlashLed[1] = db_get_b(NULL, KEYBDMODULE, "fcaps", DEF_SETTING_FLASHCAPS); + bFlashLed[2] = db_get_b(NULL, KEYBDMODULE, "fscroll", DEF_SETTING_FLASHSCROLL); bFlashEffect = db_get_b(NULL, KEYBDMODULE, "feffect", DEF_SETTING_FLASHEFFECT); bSequenceOrder = db_get_b(NULL, KEYBDMODULE, "order", DEF_SETTING_SEQORDER); wCustomTheme = db_get_w(NULL, KEYBDMODULE, "custom", DEF_SETTING_CUSTOMTHEME); @@ -729,7 +730,7 @@ static int OnMetaChanged(WPARAM wParam, LPARAM) return 0; } -static int ModulesLoaded(WPARAM wParam, LPARAM lParam) +static int ModulesLoaded(WPARAM, LPARAM) { TCHAR eventPrefix[MAX_PATH+1], eventName[MAX_PATH+1]; diff --git a/plugins/KeyboardNotify/src/options.cpp b/plugins/KeyboardNotify/src/options.cpp index 99c459e453..63df423bd6 100644 --- a/plugins/KeyboardNotify/src/options.cpp +++ b/plugins/KeyboardNotify/src/options.cpp @@ -87,7 +87,7 @@ BYTE trillianLedsMsg, trillianLedsURL, trillianLedsFile, trillianLedsOther; // ** // ** Initialize the Miranda options page // ** -int InitializeOptions(WPARAM wParam,LPARAM lParam) +int InitializeOptions(WPARAM wParam,LPARAM) { OPTIONSDIALOGPAGE odp = { sizeof(odp) }; odp.hInstance = hInst; @@ -654,17 +654,14 @@ INT_PTR CALLBACK DlgProcEffectOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPA if(IsDlgButtonChecked(hwndDlg, IDC_INTURN) == BST_CHECKED) db_set_b(NULL, KEYBDMODULE, "feffect", FLASH_INTURN); + else if (IsDlgButtonChecked(hwndDlg, IDC_INSEQUENCE) == BST_CHECKED) + db_set_b(NULL, KEYBDMODULE, "feffect", FLASH_INSEQUENCE); + else if (IsDlgButtonChecked(hwndDlg, IDC_CUSTOM) == BST_CHECKED) + db_set_b(NULL, KEYBDMODULE, "feffect", FLASH_CUSTOM); + else if (IsDlgButtonChecked(hwndDlg, IDC_TRILLIAN) == BST_CHECKED) + db_set_b(NULL, KEYBDMODULE, "feffect", FLASH_TRILLIAN); else - if (IsDlgButtonChecked(hwndDlg, IDC_INSEQUENCE) == BST_CHECKED) - db_set_b(NULL, KEYBDMODULE, "feffect", FLASH_INSEQUENCE); - else - if (IsDlgButtonChecked(hwndDlg, IDC_CUSTOM) == BST_CHECKED) - db_set_b(NULL, KEYBDMODULE, "feffect", FLASH_CUSTOM); - else - if (IsDlgButtonChecked(hwndDlg, IDC_TRILLIAN) == BST_CHECKED) - db_set_b(NULL, KEYBDMODULE, "feffect", FLASH_TRILLIAN); - else - db_set_b(NULL, KEYBDMODULE, "feffect", FLASH_SAMETIME); + db_set_b(NULL, KEYBDMODULE, "feffect", FLASH_SAMETIME); db_set_b(NULL, KEYBDMODULE, "order", (BYTE)SendDlgItemMessage(hwndDlg, IDC_SEQORDER, CB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_SEQORDER, CB_GETCURSEL, 0, 0), 0)); db_set_w(NULL, KEYBDMODULE, "custom", (WORD)SendDlgItemMessage(hwndDlg, IDC_SCUSTOM, CB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_SCUSTOM, CB_GETCURSEL, 0, 0), 0)); @@ -715,7 +712,7 @@ INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR int index = SendDlgItemMessage(hwndDlg, IDC_THEME, CB_INSERTSTRING, (WPARAM)-1, (LPARAM)dbv.ptszVal); db_free(&dbv); if (index != CB_ERR && index != CB_ERRSPACE) { - str = (TCHAR *)malloc(MAX_PATH+1); + str = (TCHAR *)malloc((MAX_PATH+1)*sizeof(TCHAR)); if (str) if (db_get_ts(NULL, KEYBDMODULE, fmtDBSettingName("custom%d", i), &dbv)) str[0] = _T('\0'); @@ -782,11 +779,11 @@ INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR return TRUE; case IDC_CUSTOMSTRING: if(HIWORD(wParam) == EN_CHANGE) { - int item; TCHAR theme[MAX_PATH+1], customAux[MAX_PATH+1]; GetDlgItemText(hwndDlg, IDC_THEME, theme, SIZEOF(theme)); - if ((item = SendDlgItemMessage(hwndDlg, IDC_THEME, CB_FINDSTRINGEXACT, -1, (LPARAM)theme)) == CB_ERR) + int item = SendDlgItemMessage(hwndDlg, IDC_THEME, CB_FINDSTRINGEXACT, -1, (LPARAM)theme); + if (item == CB_ERR) return TRUE; str = (TCHAR *)SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETITEMDATA, (WPARAM)item, 0); if (str) { @@ -809,14 +806,13 @@ INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR return TRUE; case IDC_ADD: { - int item; TCHAR theme[MAX_PATH+1]; GetDlgItemText(hwndDlg, IDC_THEME, theme, SIZEOF(theme)); if (!theme[0]) return TRUE; - item = SendDlgItemMessage(hwndDlg, IDC_THEME, CB_ADDSTRING, 0, (LPARAM)theme); - str = (TCHAR *)malloc(MAX_PATH+1); + int item = SendDlgItemMessage(hwndDlg, IDC_THEME, CB_ADDSTRING, 0, (LPARAM)theme); + str = (TCHAR *)malloc((MAX_PATH+1)*sizeof(TCHAR)); if (str) { GetDlgItemText(hwndDlg, IDC_CUSTOMSTRING, str, MAX_PATH); SetDlgItemText(hwndDlg, IDC_CUSTOMSTRING, normalizeCustomString(str)); @@ -830,11 +826,10 @@ INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR return TRUE; case IDC_UPDATE: { - int item; TCHAR theme[MAX_PATH+1]; GetDlgItemText(hwndDlg, IDC_THEME, theme, SIZEOF(theme)); - item = SendDlgItemMessage(hwndDlg, IDC_THEME, CB_FINDSTRINGEXACT, -1, (LPARAM)theme); + int item = SendDlgItemMessage(hwndDlg, IDC_THEME, CB_FINDSTRINGEXACT, -1, (LPARAM)theme); str = (TCHAR *)SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETITEMDATA, (WPARAM)item, 0); if (str) { GetDlgItemText(hwndDlg, IDC_CUSTOMSTRING, str, MAX_PATH); @@ -846,11 +841,10 @@ INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR return TRUE; case IDC_DELETE: { - int item; TCHAR theme[MAX_PATH+1]; GetDlgItemText(hwndDlg, IDC_THEME, theme, SIZEOF(theme)); - item = SendDlgItemMessage(hwndDlg, IDC_THEME, CB_FINDSTRINGEXACT, -1, (LPARAM)theme); + int item = SendDlgItemMessage(hwndDlg, IDC_THEME, CB_FINDSTRINGEXACT, -1, (LPARAM)theme); str = (TCHAR *)SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETITEMDATA, (WPARAM)item, 0); if (str) free(str); @@ -1033,14 +1027,14 @@ void exportThemes(const TCHAR *filename) void importThemes(const TCHAR *filename, BOOL overrideExisting) { - int status=0; - size_t i; FILE *fImport = _tfopen(filename, _T("rt")); - TCHAR buffer[MAX_PATH+1], theme[MAX_PATH+1], *str; - if (!fImport) return; + int status=0; + size_t i; + TCHAR buffer[MAX_PATH+1], theme[MAX_PATH+1], *str; + while (_fgetts(buffer, MAX_PATH, fImport) != NULL) { for (str=buffer; *str && isspace(*str); str++); //ltrim if (!*str || *str == ';') //empty line or comment @@ -1067,13 +1061,12 @@ void importThemes(const TCHAR *filename, BOOL overrideExisting) void writeThemeToCombo(const TCHAR *theme, const TCHAR *custom, BOOL overrideExisting) { - int item; TCHAR *str; - item = SendDlgItemMessage(hwndTheme, IDC_THEME, CB_FINDSTRINGEXACT, -1, (LPARAM)theme); + int item = SendDlgItemMessage(hwndTheme, IDC_THEME, CB_FINDSTRINGEXACT, -1, (LPARAM)theme); if (item == CB_ERR) { item = SendDlgItemMessage(hwndTheme, IDC_THEME, CB_ADDSTRING, 0, (LPARAM)theme); - str = (TCHAR *)malloc(MAX_PATH+1); + str = (TCHAR *)malloc((MAX_PATH+1)*sizeof(TCHAR)); if (str) _tcscpy(str, custom); SendDlgItemMessage(hwndTheme, IDC_THEME, CB_SETITEMDATA, (WPARAM)item, (LPARAM)str); @@ -1174,7 +1167,7 @@ INT_PTR CALLBACK DlgProcProcesses(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM TCHAR szFileNameAux[MAX_PATH+1]; SendDlgItemMessage(hwndDlg, IDC_PROGRAMS, CB_GETLBTEXT, (WPARAM)i, (LPARAM)szFileNameAux); - ProcessListAux.szFileName[i] = (TCHAR *)malloc(_tcslen(szFileNameAux) + 1); + ProcessListAux.szFileName[i] = (TCHAR *)malloc((_tcslen(szFileNameAux) + 1)*sizeof(TCHAR)); if (ProcessListAux.szFileName[i]) _tcscpy(ProcessListAux.szFileName[i], szFileNameAux); } @@ -1193,7 +1186,7 @@ INT_PTR CALLBACK DlgProcProcesses(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM void createProcessListAux(void) { ProcessListAux.count = ProcessList.count; - ProcessListAux.szFileName = (TCHAR **)malloc(ProcessListAux.count * sizeof(char *)); + ProcessListAux.szFileName = (TCHAR **)malloc(ProcessListAux.count * sizeof(TCHAR *)); if (!ProcessListAux.szFileName) ProcessListAux.count = 0; else @@ -1201,7 +1194,7 @@ void createProcessListAux(void) if (!ProcessList.szFileName[i]) ProcessListAux.szFileName[i] = NULL; else { - ProcessListAux.szFileName[i] = (TCHAR *)malloc(_tcslen(ProcessList.szFileName[i]) + 1); + ProcessListAux.szFileName[i] = (TCHAR *)malloc((_tcslen(ProcessList.szFileName[i]) + 1)*sizeof(TCHAR)); if (ProcessListAux.szFileName[i]) _tcscpy(ProcessListAux.szFileName[i], ProcessList.szFileName[i]); } @@ -1337,9 +1330,6 @@ INT_PTR CALLBACK DlgProcXstatusList(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA { WPARAM j; - int imageCount; - HICON hIconAux; - HIMAGELIST hImageList; TVINSERTSTRUCT tvis={0}; TVITEM tvi={0}; HTREEITEM hSectionItem, hItem; @@ -1351,16 +1341,19 @@ INT_PTR CALLBACK DlgProcXstatusList(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA if (!XstatusListAux) return TRUE; // Calculate hImageList size - imageCount=1; + int imageCount=1; for (int i = 0; i < ProtoList.protoCount; i++) if (ProtoList.protoInfo[i].enabled && XstatusListAux[i].count) imageCount += XstatusListAux[i].count; - hImageList = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, imageCount, imageCount); + HIMAGELIST hImageList = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, imageCount, imageCount); TreeView_SetImageList(hwndTree, hImageList, TVSIL_NORMAL); - ImageList_AddIcon(hImageList, hIconAux=(HICON)LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_BLANK), IMAGE_ICON, 0, 0, 0)); - if (hIconAux) DestroyIcon(hIconAux); + HICON hIconAux=(HICON)LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_BLANK), IMAGE_ICON, 0, 0, 0); + if (hIconAux) { + ImageList_AddIcon(hImageList, hIconAux); + DestroyIcon(hIconAux); + } TreeView_SelectItem(hwndTree, NULL); ShowWindow(hwndTree, SW_HIDE); @@ -1368,9 +1361,8 @@ INT_PTR CALLBACK DlgProcXstatusList(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA for (int i = 0; i < ProtoList.protoCount; i++) if (ProtoList.protoInfo[i].enabled && XstatusListAux[i].count) { - HTREEITEM hParent; - - int count; PROTOACCOUNT** protos; + int count; + PROTOACCOUNT **protos; ProtoEnumAccounts( &count, &protos ); tvis.hParent = NULL; @@ -1382,7 +1374,7 @@ INT_PTR CALLBACK DlgProcXstatusList(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA tvis.item.state = TVIS_BOLD|TVIS_EXPANDED; tvis.item.iImage = tvis.item.iSelectedImage = ImageList_AddIcon(hImageList, hIconAux=(HICON)CallProtoService(ProtoList.protoInfo[i].szProto, PS_LOADICON, PLI_PROTOCOL, 0)); if (hIconAux) DestroyIcon(hIconAux); - hParent = TreeView_InsertItem(hwndTree, &tvis); + HTREEITEM hParent = TreeView_InsertItem(hwndTree, &tvis); for (j = 0; j < XstatusListAux[i].count; j++) { tvis.hParent = hParent; tvis.item.mask = TVIF_TEXT|TVIF_PARAM|TVIF_IMAGE|TVIF_SELECTEDIMAGE; @@ -1426,10 +1418,8 @@ INT_PTR CALLBACK DlgProcXstatusList(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA case WM_DESTROY: { - HIMAGELIST hImageList; - // Destroy tree view imagelist since it does not get destroyed automatically (see msdn docs) - hImageList = TreeView_GetImageList(GetDlgItem(hwndDlg, IDC_TREE_XSTATUS), TVSIL_STATE); + HIMAGELIST hImageList = TreeView_GetImageList(GetDlgItem(hwndDlg, IDC_TREE_XSTATUS), TVSIL_STATE); if (hImageList) { TreeView_SetImageList(GetDlgItem(hwndDlg, IDC_TREE_XSTATUS), NULL, TVSIL_STATE); ImageList_Destroy(hImageList); diff --git a/plugins/LotusNotify/src/LotusNotify.cpp b/plugins/LotusNotify/src/LotusNotify.cpp index fd18559cf1..4898650d87 100644 --- a/plugins/LotusNotify/src/LotusNotify.cpp +++ b/plugins/LotusNotify/src/LotusNotify.cpp @@ -31,7 +31,7 @@ boolean volatile Plugin_Terminated = false; CRITICAL_SECTION checkthreadCS;
HANDLE hMenuService = NULL;
-HANDLE hMenuHandle = NULL;
+HGENMENU hMenuHandle = NULL;
HANDLE hCheckEvent = NULL;
HANDLE hCheckHook = NULL;
HANDLE hHookModulesLoaded = NULL;
@@ -127,8 +127,7 @@ STATUS LNPUBLIC __stdcall EMCallBack (EMRECORD * pData) //It don't work (don't know why), and Mirandas Load function is called with value 1 or 0 as parameter...
__declspec(dllexport)STATUS LNPUBLIC MainEntryPoint (void)
{
- STATUS rc;
- rc = EMRegister1 (EM_GETPASSWORD, EM_REG_BEFORE | EM_REG_AFTER, EMCallBack, 0, &hLotusRegister); //Extension Manager must know that we are here
+ STATUS rc = EMRegister1 (EM_GETPASSWORD, EM_REG_BEFORE | EM_REG_AFTER, EMCallBack, 0, &hLotusRegister); //Extension Manager must know that we are here
if(rc) {
//Extension magager don't know who we are :(
startuperror+=8;
@@ -227,12 +226,12 @@ void init_pluginname() {
char text[MAX_PATH], *p, *q;
WIN32_FIND_DATAA ffd;
- HANDLE hFind;
// Try to find name of the file having original letter sizes
GetModuleFileNameA(hInst, text, sizeof(text));
- if((hFind = FindFirstFileA(text, &ffd)) != INVALID_HANDLE_VALUE) {
+ HANDLE hFind = FindFirstFileA(text, &ffd);
+ if(hFind != INVALID_HANDLE_VALUE) {
strncpy_s(text, SIZEOF(text), ffd.cFileName, strlen(ffd.cFileName));
FindClose(hFind);
}
@@ -319,8 +318,7 @@ BOOL checkFilters(TCHAR* str, int field) //subfunction called from popup plugin callback function
void Click(HWND hWnd,BOOL execute)
{
- POPUPATT *pid=NULL;
- pid = (POPUPATT*)CallService(MS_POPUP_GETPLUGINDATA, (WPARAM)hWnd,(LPARAM)pid);
+ POPUPATT *pid = (POPUPATT*)PUGetPluginData(hWnd);
if(settingOnceOnly&&settingNonClickedOnly)
(getEl(pid->id))->clicked=TRUE;//add to msgs list
@@ -370,8 +368,7 @@ static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA case UM_INITPOPUP:
{
- POPUPATT *pid=NULL;
- pid = (POPUPATT*)CallService(MS_POPUP_GETPLUGINDATA, (WPARAM)hWnd,(LPARAM)pid);
+ POPUPATT *pid = (POPUPATT*)PUGetPluginData(hWnd);
addPopup(pid->id,hWnd);
//PUDeletePopUp(hWnd);
break;
@@ -379,8 +376,7 @@ static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA case UM_FREEPLUGINDATA:
{
- POPUPATT * mpd = NULL;
- mpd = (POPUPATT*)CallService(MS_POPUP_GETPLUGINDATA, (WPARAM)hWnd,(LPARAM)mpd);
+ POPUPATT *mpd = (POPUPATT*)PUGetPluginData(hWnd);
if (mpd > 0) free(mpd);
return TRUE; //TRUE or FALSE is the same, it gets ignored.
}
@@ -537,7 +533,7 @@ void ErMsgByLotusCode(STATUS erno) //set menu avainability
-static void LNEnableMenuItem(HANDLE hMenuItem, BOOL bEnable)
+static void LNEnableMenuItem(HGENMENU hMenuItem, BOOL bEnable)
{
log_p(L"LNEnableMenuItem: bEnable=%d", bEnable);
CLISTMENUITEM clmi = {0};
@@ -546,7 +542,7 @@ static void LNEnableMenuItem(HANDLE hMenuItem, BOOL bEnable) if ( !bEnable )
clmi.flags |= CMIF_GRAYED;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuItem, (LPARAM)&clmi);
+ Menu_ModifyItem(hMenuItem, &clmi);
}
@@ -755,10 +751,9 @@ void checkthread(void*) field_copy_UNICODE[field_len] = '\0';
- WCHAR msgFrom[512];
- WCHAR msgSubject[512];
- ZeroMemory(msgFrom,512);
- ZeroMemory(msgSubject,512);
+ WCHAR msgFrom[512], msgSubject[512];
+ ZeroMemory(msgFrom,sizeof(msgFrom));
+ ZeroMemory(msgSubject,sizeof(msgSubject));
if(wcslen(field_from_UNICODE) < 512 && wcslen(field_from_UNICODE) > 3 && wcsstr(field_from_UNICODE, L"CN=") == field_from_UNICODE)
_tcsncpy_s(msgFrom, &(field_from_UNICODE[3]), wcscspn(field_from_UNICODE, L"/")-3 );
@@ -857,7 +852,7 @@ errorblock: //hooked notification from service that listning to check lotus
-static int eventCheck(WPARAM wParam,LPARAM lParam)
+static int eventCheck(WPARAM,LPARAM)
{
log(L"check event...");
check();
@@ -874,7 +869,7 @@ INT_PTR PluginMenuCommand(WPARAM wParam, LPARAM lParam) //window timer callback function, called on timer event
-VOID CALLBACK atTime(HWND hWnd, UINT uMsg, UINT idEvent, DWORD dwTime)
+void CALLBACK atTime(HWND hWnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
{
log(L"atTime: start");
BOOL b = KillTimer(hTimerWnd, idEvent);
@@ -883,7 +878,7 @@ VOID CALLBACK atTime(HWND hWnd, UINT uMsg, UINT idEvent, DWORD dwTime) check();
if(settingInterval != 0){
log_p(L"atTime: SetTimer settingInterval=%d", settingInterval * 60000);
- SetTimer(hTimerWnd, TID, settingInterval * 60000, (TIMERPROC)atTime);
+ SetTimer(hTimerWnd, TID, settingInterval * 60000, atTime);
}
}
}
@@ -965,44 +960,49 @@ void lookupLotusDefaultSettings(HWND hwndDlg) //get variables values stored in db.
void LoadSettings()
{
- DBVARIANT dbv;
- char buff[128];
- int i=0;
-
settingInterval = (INT)db_get_dw(NULL, PLUGINNAME, "LNInterval", 15);
settingInterval1 = (INT)db_get_dw(NULL, PLUGINNAME, "LNInterval1", 0);
//if(!db_get(NULL, PLUGINNAME, "LNInterval1",&dbv))
// settingInterval1 = int(dbv.lVal);
//db_free(&dbv);
//settingInterval=dbv.lVal;
- if(!db_get_s(NULL, PLUGINNAME, "LNDatabase", &dbv))
+ if(!db_get_s(NULL, PLUGINNAME, "LNDatabase", &dbv)){
strncpy_s(settingDatabase, _countof(settingDatabase), dbv.pszVal, SIZEOF(settingDatabase));
- db_free(&dbv);
- if(!db_get_s(NULL, PLUGINNAME, "LNServer", &dbv))
+ db_free(&dbv);
+ }
+ if(!db_get_s(NULL, PLUGINNAME, "LNServer", &dbv)) {
strncpy_s(settingServer, _countof(settingServer), dbv.pszVal, SIZEOF(settingServer));
- db_free(&dbv);
- if(!db_get_s(NULL, PLUGINNAME, "LNServerSec", &dbv))
+ db_free(&dbv);
+ }
+ if(!db_get_s(NULL, PLUGINNAME, "LNServerSec", &dbv)) {
strncpy_s(settingServerSec, _countof(settingServerSec), dbv.pszVal, SIZEOF(settingServerSec));
- db_free(&dbv);
- if(!db_get(NULL, PLUGINNAME, "LNPassword", &dbv))
+ db_free(&dbv);
+ }
+ if(!db_get(NULL, PLUGINNAME, "LNPassword", &dbv)) {
strncpy_s(settingPassword, _countof(settingPassword), dbv.pszVal, SIZEOF(settingPassword));
- db_free(&dbv);
- if(!db_get_s(NULL, PLUGINNAME, "LNCommand", &dbv, DBVT_ASCIIZ))
+ db_free(&dbv);
+ }
+ if(!db_get_s(NULL, PLUGINNAME, "LNCommand", &dbv, DBVT_ASCIIZ)) {
strncpy_s(settingCommand, _countof(settingCommand), dbv.pszVal, SIZEOF(settingCommand));
- db_free(&dbv);
- if(!db_get_s(NULL, PLUGINNAME, "LNParameters", &dbv, DBVT_ASCIIZ))
+ db_free(&dbv);
+ }
+ if(!db_get_s(NULL, PLUGINNAME, "LNParameters", &dbv, DBVT_ASCIIZ)) {
strncpy_s(settingParameters, _countof(settingParameters), dbv.pszVal, SIZEOF(settingParameters));
- db_free(&dbv);
+ db_free(&dbv);
+ }
- if(!db_get_ts(NULL, PLUGINNAME, "LNFilterSender",&dbv))
+ if(!db_get_ts(NULL, PLUGINNAME, "LNFilterSender",&dbv)) {
_tcsncpy_s(settingFilterSender, dbv.ptszVal, _TRUNCATE);
- db_free(&dbv);
- if(!db_get_ts(NULL, PLUGINNAME, "LNFilterSubject",&dbv))
+ db_free(&dbv);
+ }
+ if(!db_get_ts(NULL, PLUGINNAME, "LNFilterSubject",&dbv)) {
_tcsncpy_s(settingFilterSubject, dbv.ptszVal, _TRUNCATE);
- db_free(&dbv);
- if(!db_get_ts(NULL, PLUGINNAME, "LNFilterTo",&dbv))
+ db_free(&dbv);
+ }
+ if(!db_get_ts(NULL, PLUGINNAME, "LNFilterTo",&dbv)) {
_tcsncpy_s(settingFilterTo, dbv.ptszVal, _TRUNCATE);
- db_free(&dbv);
+ db_free(&dbv);
+ }
settingOnceOnly = db_get_b (NULL, PLUGINNAME, "LNOnceOnly",0);
@@ -1015,8 +1015,10 @@ void LoadSettings() settingNewestID = (DWORD)db_get_dw(NULL, PLUGINNAME, "LNNewestID", 0);
settingIniAnswer = db_get_b(NULL, PLUGINNAME, "LNIniAnswer", 0);
settingIniCheck = db_get_b(NULL, PLUGINNAME, "LNIniCheck", 0);
-
- for(i = 0; i < STATUS_COUNT; i++) {
+
+ DBVARIANT dbv;
+ for(int i = 0; i < STATUS_COUNT; i++) {
+ char buff[128];
mir_snprintf(buff, SIZEOF(buff), "LNStatus%d", i);
settingStatus[i] = (db_get_b(0, PLUGINNAME, buff, 0) == 1);
}
@@ -1142,7 +1144,7 @@ INT_PTR CALLBACK DlgProcLotusNotifyOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L int i;
char text[MAXENVVALUE];
i=SendDlgItemMessage(hwndDlg,IDC_SERVER,CB_GETCURSEL,0,0);
- SendDlgItemMessageA(hwndDlg,IDC_SERVER,CB_GETLBTEXT,(WPARAM)i,(LONG)/* (LPSTR) */text);
+ SendDlgItemMessageA(hwndDlg,IDC_SERVER,CB_GETLBTEXT,(WPARAM)i,(LPARAM)text);
SetDlgItemTextA(hwndDlg,IDC_SERVER,text);
break;
}
@@ -1154,7 +1156,7 @@ INT_PTR CALLBACK DlgProcLotusNotifyOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L SendDlgItemMessage(hwndDlg, IDC_SERVER, CB_RESETCONTENT ,0, 0);
fillServersList(hwndDlg);
SendDlgItemMessageA(hwndDlg, IDC_SERVER, CB_ADDSTRING, 0, (LPARAM)settingServer);
- SendDlgItemMessageA(hwndDlg, IDC_SERVER, CB_SELECTSTRING , -1, (LPARAM)(LPCSTR)settingServer);
+ SendDlgItemMessageA(hwndDlg, IDC_SERVER, CB_SELECTSTRING , -1, (LPARAM)settingServer);
break;
}
}
@@ -1263,7 +1265,6 @@ INT_PTR CALLBACK DlgProcLotusNotifyOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L {
char buff[128];
- int i=0;
GetDlgItemTextA(hwndDlg, IDC_SERVER, settingServer, sizeof(settingServer));
db_set_s(NULL, PLUGINNAME, "LNServer", settingServer );
db_set_s(NULL, PLUGINNAME, "LNServerSec", settingServerSec);
@@ -1283,34 +1284,34 @@ INT_PTR CALLBACK DlgProcLotusNotifyOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L db_set_b(NULL, PLUGINNAME, "LNIniCheck", settingIniCheck);
db_set_b(NULL, PLUGINNAME, "LNIniAnswer", settingIniAnswer);
- for(i = 0; i < STATUS_COUNT ; i++){
+ for(int i = 0; i < STATUS_COUNT ; i++){
mir_snprintf(buff, SIZEOF(buff), "LNStatus%d", i);
settingStatus[i] = (ListView_GetCheckState(GetDlgItem(hwndDlg, IDC_STATUS), i) ? TRUE : FALSE);
db_set_b(0, PLUGINNAME, buff, settingStatus[i] ? 1 : 0);
}
settingFilterSender[0] = 0;
- for(i=0; i<SendDlgItemMessage(hwndDlg, IDC_FILTER_SENDER, CB_GETCOUNT, 0, (LONG)0); i++){
+ for(int i=0; i<SendDlgItemMessage(hwndDlg, IDC_FILTER_SENDER, CB_GETCOUNT, 0, 0); i++){
TCHAR text[512] = TEXT("");
- SendDlgItemMessage(hwndDlg,IDC_FILTER_SENDER ,CB_GETLBTEXT,(WPARAM)i,(LONG) (LPSTR)text);
+ SendDlgItemMessage(hwndDlg,IDC_FILTER_SENDER ,CB_GETLBTEXT,(WPARAM)i,(LPARAM)text);
_tcscat_s(settingFilterSender, SIZEOF(settingFilterSender), text);
_tcscat_s(settingFilterSender, SIZEOF(settingFilterSender), TEXT(";"));
}
db_set_ts(NULL, PLUGINNAME, "LNFilterSender", settingFilterSender);
settingFilterSubject[0] = 0;
- for(i=0; i<SendDlgItemMessage(hwndDlg, IDC_FILTER_SUBJECT, CB_GETCOUNT, 0, (LONG)0); i++){
+ for(int i=0; i<SendDlgItemMessage(hwndDlg, IDC_FILTER_SUBJECT, CB_GETCOUNT, 0, 0); i++){
TCHAR text[512] = TEXT("");
- SendDlgItemMessage(hwndDlg,IDC_FILTER_SUBJECT ,CB_GETLBTEXT,(WPARAM)i,(LONG) (LPSTR)text);
+ SendDlgItemMessage(hwndDlg,IDC_FILTER_SUBJECT ,CB_GETLBTEXT,(WPARAM)i,(LPARAM)text);
_tcscat_s(settingFilterSubject, SIZEOF(settingFilterSubject), text);
_tcscat_s(settingFilterSubject, SIZEOF(settingFilterSubject), TEXT(";"));
}
db_set_ts(NULL, PLUGINNAME, "LNFilterSubject", settingFilterSubject);
settingFilterTo[0] = 0;
- for(i=0; i<SendDlgItemMessage(hwndDlg, IDC_FILTER_TO, CB_GETCOUNT, 0, (LONG)0); i++){
+ for(int i=0; i<SendDlgItemMessage(hwndDlg, IDC_FILTER_TO, CB_GETCOUNT, 0, 0); i++){
TCHAR text[512] = TEXT("");
- SendDlgItemMessage(hwndDlg,IDC_FILTER_TO ,CB_GETLBTEXT,(WPARAM)i,(LONG) (LPSTR)text);
+ SendDlgItemMessage(hwndDlg,IDC_FILTER_TO ,CB_GETLBTEXT,(WPARAM)i,(LPARAM)text);
_tcscat_s(settingFilterTo, SIZEOF(settingFilterTo), text);
_tcscat_s(settingFilterTo, SIZEOF(settingFilterTo), TEXT(";"));
}
@@ -1354,7 +1355,7 @@ INT_PTR CALLBACK DlgProcLotusNotifyOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L //options page on miranda called
-int LotusNotifyOptInit(WPARAM wParam,LPARAM lParam)
+int LotusNotifyOptInit(WPARAM wParam,LPARAM)
{
OPTIONSDIALOGPAGE odp = { sizeof(odp) };
odp.hInstance = hInst;
@@ -1400,21 +1401,18 @@ INT_PTR TMLoadIcon(WPARAM wParam, LPARAM lParam) case PLI_OFFLINE: id=IDI_ICON2; break;
default: return 0;
}
- return (int)LoadImage(hInst, MAKEINTRESOURCE(id), IMAGE_ICON, GetSystemMetrics(wParam&PLIF_SMALL?SM_CXSMICON:SM_CXICON), GetSystemMetrics(wParam&PLIF_SMALL?SM_CYSMICON:SM_CYICON), 0);
+ return (INT_PTR)LoadImage(hInst, MAKEINTRESOURCE(id), IMAGE_ICON, GetSystemMetrics(wParam&PLIF_SMALL?SM_CXSMICON:SM_CXICON), GetSystemMetrics(wParam&PLIF_SMALL?SM_CYSMICON:SM_CYICON), 0);
}
INT_PTR SetStatus(WPARAM wParam, LPARAM lParam)
{
-
if (wParam == ID_STATUS_OFFLINE){
-
// the status has been changed to online (maybe run some more code)
LNEnableMenuItem(hMenuHandle, FALSE);
diffstat = 0;
} else if (wParam == ID_STATUS_ONLINE){
-
diffstat = 0;
//LNEnableMenuItem(hMenuHandle ,TRUE);
//NotifyEventHooks(hCheckEvent,wParam,lParam);
@@ -1430,7 +1428,7 @@ INT_PTR SetStatus(WPARAM wParam, LPARAM lParam) if(check() == 0){
if(settingInterval != 0)
- SetTimer(hTimerWnd, TID, settingInterval * 60000, (TIMERPROC)atTime);
+ SetTimer(hTimerWnd, TID, settingInterval * 60000, atTime);
LNEnableMenuItem(hMenuHandle, TRUE);
} else {
ProtoBroadcastAck(PLUGINNAME, NULL, ACKTYPE_STATUS, ACKRESULT_FAILED, (HANDLE)currentStatus, wParam);
@@ -1450,7 +1448,6 @@ INT_PTR SetStatus(WPARAM wParam, LPARAM lParam) // the status has been changed to unknown (maybe run some more code)
}
-
//broadcast the message
if(currentStatus != wParam)
ProtoBroadcastAck(PLUGINNAME,NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)currentStatus, wParam);
@@ -1493,7 +1490,7 @@ void checkEnvPath(TCHAR *path) //GetStatus
-INT_PTR GetStatus(WPARAM wParam, LPARAM lParam)
+INT_PTR GetStatus(WPARAM, LPARAM)
{
return currentStatus;
if (diffstat)
@@ -1505,7 +1502,7 @@ INT_PTR GetStatus(WPARAM wParam, LPARAM lParam) //called after all plugins loaded.
//all lotus staff will be called, that will not hang miranda on startup
-static int modulesloaded(WPARAM wParam, LPARAM lParam)
+static int modulesloaded(WPARAM, LPARAM)
{
int cnt;
TCHAR path[255] = {0};
@@ -1564,7 +1561,7 @@ static int modulesloaded(WPARAM wParam, LPARAM lParam) //function hooks before unload
-static int preshutdown(WPARAM wParam,LPARAM lParam)
+static int preshutdown(WPARAM,LPARAM)
{
Plugin_Terminated = true;
deleteElements();
@@ -1689,14 +1686,9 @@ extern "C" int __declspec(dllexport) Unload() extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD mirandaVersion)
{
#ifdef _WIN64
- MessageBox(NULL
- , TranslateT("LotusNotify.dll cannot work with 64bit Miranda. (Lotus client is 32bit only)")
- , TranslateT("LotusNotify")
- , MB_OK | MB_ICONWARNING );
- return NULL;
-#else
- return &pluginInfo;
+ #error LotusNotify.dll cannot work with 64bit Miranda. (Lotus client is 32bit only)
#endif
+ return &pluginInfo;
}
diff --git a/plugins/MenuItemEx/src/main.cpp b/plugins/MenuItemEx/src/main.cpp index edc4d54edd..b9ca2178c2 100644 --- a/plugins/MenuItemEx/src/main.cpp +++ b/plugins/MenuItemEx/src/main.cpp @@ -510,6 +510,7 @@ void ModifyCopyID(MCONTACT hContact, BOOL bShowID, BOOL bTrimID) DestroyIcon(hIconCID);
hIconCID = mi.hIcon;
+ TCHAR buffer[256];
char szID[256];
GetID(hContact, szProto, (LPSTR)&szID);
if (szID[0]) {
@@ -519,7 +520,6 @@ void ModifyCopyID(MCONTACT hContact, BOOL bShowID, BOOL bTrimID) szID[MAX_IDLEN + 1] = 0;
}
- TCHAR buffer[256];
mir_sntprintf(buffer, SIZEOF(buffer), _T("%s [%S]"), TranslateT("Copy ID"), szID);
mi.ptszName = buffer;
}
diff --git a/plugins/Msg_Export/src/FileViewer.cpp b/plugins/Msg_Export/src/FileViewer.cpp index dabb03e23d..34f8f3b677 100755 --- a/plugins/Msg_Export/src/FileViewer.cpp +++ b/plugins/Msg_Export/src/FileViewer.cpp @@ -697,7 +697,7 @@ bool bLoadFile( HWND hwndDlg, CLHistoryDlg * pclDlg ) SendMessage(hRichEdit, EM_EXLIMITTEXT, 0, 0x7FFFFFFF);
CLStreamRTFInfo clInfo( hFile);
- eds.dwCookie = (DWORD)&clInfo;
+ eds.dwCookie = (DWORD_PTR)&clInfo;
eds.pfnCallback = RichEditRTFStreamLoadFile;
SendMessage(hRichEdit, EM_STREAMIN, (WPARAM)SF_RTF, (LPARAM)&eds);
diff --git a/plugins/NewAwaySysMod/src/MsgTree.cpp b/plugins/NewAwaySysMod/src/MsgTree.cpp index f6758fb141..70d5849aae 100644 --- a/plugins/NewAwaySysMod/src/MsgTree.cpp +++ b/plugins/NewAwaySysMod/src/MsgTree.cpp @@ -674,7 +674,7 @@ CBaseTreeItem* CMsgTree::GetNextItem(int Flags, CBaseTreeItem* Item) // Item is default: _ASSERT(0);
}
int Order = TreeCtrl->hItemToOrder(TreeView_GetNextItem(hTreeView, TreeItem ? TreeItem->hItem : NULL, TVFlag));
- if (Order =- -1)
+ if (Order == -1)
return NULL;
return (Order <= TREECTRL_ROOTORDEROFFS) ? (CBaseTreeItem*)&TreeCtrl->RootItems[ROOT_ORDER_TO_INDEX(Order)] : (CBaseTreeItem*)&TreeCtrl->Value[Order];
diff --git a/plugins/NewAwaySysMod/src/SetAwayMsg.cpp b/plugins/NewAwaySysMod/src/SetAwayMsg.cpp index 8fbd79cd69..12cd708ddc 100644 --- a/plugins/NewAwaySysMod/src/SetAwayMsg.cpp +++ b/plugins/NewAwaySysMod/src/SetAwayMsg.cpp @@ -613,7 +613,7 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA ti.cbSize = sizeof(ti);
ti.uFlags = TTF_IDISHWND | TTF_SUBCLASS;
for (int i = 0; i < SIZEOF(Tooltips); i++) {
- ti.uId = (UINT)GetDlgItem(hwndDlg, Tooltips[i].DlgItemID);
+ ti.uId = (UINT_PTR)GetDlgItem(hwndDlg, Tooltips[i].DlgItemID);
ti.lpszText = TranslateTS(Tooltips[i].Text);
SendMessage(hWndTooltips, TTM_ADDTOOL, 0, (LPARAM)&ti);
}
diff --git a/plugins/OpenFolder/src/openFolder.cpp b/plugins/OpenFolder/src/openFolder.cpp index 631102fd26..e8860cecd7 100644 --- a/plugins/OpenFolder/src/openFolder.cpp +++ b/plugins/OpenFolder/src/openFolder.cpp @@ -27,13 +27,13 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) return TRUE;
}
-static INT_PTR MenuCommand_OpenFolder(WPARAM wParam, LPARAM lParam)
+static INT_PTR MenuCommand_OpenFolder(WPARAM, LPARAM)
{
TCHAR szMirandaPath[MAX_PATH];
GetModuleFileName( GetModuleHandle(NULL), szMirandaPath, SIZEOF(szMirandaPath));
TCHAR* p = _tcsrchr( szMirandaPath, '\\' );
- if ( p && p + 1 )
- *( p + 1 ) = 0;
+ if ( p && *(++p))
+ *p = 0;
if ( GetAsyncKeyState( VK_CONTROL ) & 0x8000 )
ShellExecute(0, _T("explore"), szMirandaPath, 0, 0, SW_SHOWNORMAL);
@@ -44,7 +44,7 @@ static INT_PTR MenuCommand_OpenFolder(WPARAM wParam, LPARAM lParam) }
// toptoolbar (if plugin is installed)
-static int ToptoolBarHook(WPARAM wParam, LPARAM lParam)
+static int ToptoolBarHook(WPARAM, LPARAM)
{
TTBButton ttb = { sizeof(ttb) };
ttb.hIconHandleUp = icon.hIcolib;
@@ -55,28 +55,9 @@ static int ToptoolBarHook(WPARAM wParam, LPARAM lParam) return 0;
}
-static int ModulesLoaded(WPARAM wParam, LPARAM lParam)
+static int ModulesLoaded(WPARAM, LPARAM)
{
HookEvent(ME_TTB_MODULELOADED, ToptoolBarHook);
-
- // hotkeys service (0.8+)
- HOTKEYDESC hotkey = { 0 };
- hotkey.cbSize = sizeof(hotkey);
- hotkey.dwFlags = HKD_TCHAR;
- hotkey.pszName = "Open Folder";
- hotkey.ptszDescription = LPGENT("Open Folder");
- hotkey.ptszSection = LPGENT("Main");
- hotkey.pszService = MS_OPENFOLDER_OPEN;
- hotkey.DefHotKey = MAKEWORD( 'O', HOTKEYF_SHIFT | HOTKEYF_ALT );
- Hotkey_Register(&hotkey);
-
- CLISTMENUITEM mi = { sizeof(mi) };
- mi.position = 0x7FFFFFFF;
- mi.flags = CMIF_TCHAR;
- mi.icolibItem = icon.hIcolib;
- mi.ptszName = LPGENT("Open Folder");
- mi.pszService = MS_OPENFOLDER_OPEN;
- Menu_AddMainMenuItem(&mi);
return 0;
}
@@ -104,6 +85,25 @@ extern "C" int __declspec( dllexport ) Load() // icolib (0.7+)
Icon_Register(hInst, LPGEN("Open Folder"), &icon, 1, OPENFOLDER_MODULE_NAME);
+
+ // hotkeys service (0.8+)
+ HOTKEYDESC hotkey = { 0 };
+ hotkey.cbSize = sizeof(hotkey);
+ hotkey.dwFlags = HKD_TCHAR;
+ hotkey.pszName = "Open Folder";
+ hotkey.ptszDescription = LPGENT("Open Folder");
+ hotkey.ptszSection = LPGENT("Main");
+ hotkey.pszService = MS_OPENFOLDER_OPEN;
+ hotkey.DefHotKey = MAKEWORD( 'O', HOTKEYF_SHIFT | HOTKEYF_ALT );
+ Hotkey_Register(&hotkey);
+
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.position = 0x7FFFFFFF;
+ mi.flags = CMIF_TCHAR;
+ mi.icolibItem = icon.hIcolib;
+ mi.ptszName = LPGENT("Open Folder");
+ mi.pszService = MS_OPENFOLDER_OPEN;
+ Menu_AddMainMenuItem(&mi);
return 0;
}
diff --git a/plugins/PluginUpdater/src/DlgUpdate.cpp b/plugins/PluginUpdater/src/DlgUpdate.cpp index 30423de1e8..61332335ae 100644 --- a/plugins/PluginUpdater/src/DlgUpdate.cpp +++ b/plugins/PluginUpdater/src/DlgUpdate.cpp @@ -649,7 +649,6 @@ static int ScanFolder(const TCHAR *tszFolder, size_t cbBaseLen, int level, const }
__except (EXCEPTION_EXECUTE_HANDLER)
{
- ZeroMemory(szMyHash, 0);
// smth went wrong, reload a file from scratch
}
}
diff --git a/plugins/Popup/src/skin.cpp b/plugins/Popup/src/skin.cpp index 1d775b8d95..fe16ce2fb4 100644 --- a/plugins/Popup/src/skin.cpp +++ b/plugins/Popup/src/skin.cpp @@ -804,7 +804,6 @@ bool PopupSkin::load(LPCTSTR dir) HANDLE hFind = FindFirstFile(_T("*.popupskin"), &ffd);
while (hFind != INVALID_HANDLE_VALUE) {
loadSkin(ffd.cFileName);
- break;
if (!FindNextFile(hFind, &ffd))
break;
}
diff --git a/plugins/Scriver/src/input.cpp b/plugins/Scriver/src/input.cpp index a200330596..41e2227a7a 100644 --- a/plugins/Scriver/src/input.cpp +++ b/plugins/Scriver/src/input.cpp @@ -384,7 +384,7 @@ BOOL HandleLinkClick(HINSTANCE hInstance, HWND hwndDlg, HWND hwndFocus, ENLINK * tr.lpstrText = (LPWSTR)mir_alloc(sizeof(TCHAR)*(tr.chrg.cpMax - tr.chrg.cpMin + 8));
SendMessage(lParam->nmhdr.hwndFrom, EM_GETTEXTRANGE, 0, (LPARAM)&tr);
if (_tcschr(tr.lpstrText, _T('@')) != NULL && _tcschr(tr.lpstrText, _T(':')) == NULL && _tcschr(tr.lpstrText, _T('/')) == NULL) {
- MoveMemory(tr.lpstrText + sizeof(TCHAR)* 7, tr.lpstrText, sizeof(TCHAR)*(tr.chrg.cpMax - tr.chrg.cpMin + 1));
+ MoveMemory(tr.lpstrText + 7, tr.lpstrText, sizeof(TCHAR)*(tr.chrg.cpMax - tr.chrg.cpMin + 1));
CopyMemory(tr.lpstrText, _T("mailto:"), sizeof(TCHAR)* 7);
}
diff --git a/plugins/Scriver/src/msglog.cpp b/plugins/Scriver/src/msglog.cpp index 096e106ea1..e6a7d453d0 100644 --- a/plugins/Scriver/src/msglog.cpp +++ b/plugins/Scriver/src/msglog.cpp @@ -894,7 +894,6 @@ void StreamInEvents(HWND hwndDlg, HANDLE hDbEventFirst, int count, int fAppend) GETTEXTLENGTHEX gtxl = { 0 };
gtxl.flags = GTL_DEFAULT | GTL_PRECISE | GTL_NUMCHARS;
gtxl.codepage = 1200;
- gtxl.codepage = 1200;
fi.chrg.cpMin = SendDlgItemMessage(hwndDlg, IDC_LOG, EM_GETTEXTLENGTHEX, (WPARAM)>xl, 0);
sel.cpMin = sel.cpMax = GetRichTextLength(GetDlgItem(hwndDlg, IDC_LOG), dat->windowData.codePage, FALSE);
SendDlgItemMessage(hwndDlg, IDC_LOG, EM_EXSETSEL, 0, (LPARAM)&sel);
diff --git a/plugins/SimpleStatusMsg/src/main.cpp b/plugins/SimpleStatusMsg/src/main.cpp index cafd032c92..d514176267 100644 --- a/plugins/SimpleStatusMsg/src/main.cpp +++ b/plugins/SimpleStatusMsg/src/main.cpp @@ -1447,12 +1447,12 @@ static int ChangeStatusMsgPrebuild(WPARAM wParam, LPARAM lParam) log2file("ChangeStatusMsgPrebuild()");
#endif
PROTOACCOUNT **pa;
- int iStatusMenuItemCount = 0, count, i;
+ int iStatusMenuItemCount = 0, count;
DWORD iStatusMsgFlags = 0;
ProtoEnumAccounts(&count, &pa);
hProtoStatusMenuItem = (HANDLE *)mir_realloc(hProtoStatusMenuItem, sizeof(HANDLE) * count);
- for (i = 0; i < count; ++i)
+ for (int i = 0; i < count; ++i)
{
if (!IsAccountEnabled(pa[i]))
continue;
@@ -1482,11 +1482,8 @@ static int ChangeStatusMsgPrebuild(WPARAM wParam, LPARAM lParam) mi.popupPosition = 500084000;
mi.position = 2000040000;
- for (i = 0; i < count; ++i)
+ for (int i = 0; i < count; ++i)
{
- char szSetting[80];
- int iProtoFlags;
-
if (!IsAccountEnabled(pa[i]))
continue;
@@ -1499,18 +1496,20 @@ static int ChangeStatusMsgPrebuild(WPARAM wParam, LPARAM lParam) if (!pa[i]->bIsVisible)
continue;
+ char szSetting[80];
mir_snprintf(szSetting, SIZEOF(szSetting), "Proto%sFlags", pa[i]->szModuleName);
- iProtoFlags = db_get_b(NULL, "SimpleStatusMsg", szSetting, PROTO_DEFAULT);
+ int iProtoFlags = db_get_b(NULL, "SimpleStatusMsg", szSetting, PROTO_DEFAULT);
if (iProtoFlags & PROTO_NO_MSG || iProtoFlags & PROTO_THIS_MSG)
continue;
+ TCHAR szBuffer[256];
if (CallService(MS_PROTO_ISACCOUNTLOCKED,0,(LPARAM)pa[i]->szModuleName))
{
- TCHAR szBuffer[256];
mir_sntprintf(szBuffer, SIZEOF(szBuffer), TranslateT("%s (locked)"), pa[i]->tszAccountName);
mi.ptszPopupName = szBuffer;
}
- else mi.ptszPopupName = pa[i]->tszAccountName;
+ else
+ mi.ptszPopupName = pa[i]->tszAccountName;
hProtoStatusMenuItem[i] = Menu_AddStatusMenuItem(&mi);
}
@@ -1578,7 +1577,7 @@ static int OnIdleChanged(WPARAM, LPARAM lParam) static int CSStatusChange(WPARAM wParam, LPARAM lParam)
{
- PROTOCOLSETTINGEX** ps = *(PROTOCOLSETTINGEX***)wParam;
+ PROTOCOLSETTINGEX **ps = *(PROTOCOLSETTINGEX***)wParam;
int status_mode, CSProtoCount;
char szSetting[80];
TCHAR *msg = NULL;
@@ -1657,13 +1656,11 @@ static int CSStatusChange(WPARAM wParam, LPARAM lParam) static TCHAR *ParseWinampSong(ARGUMENTSINFO *ai)
{
- TCHAR *ptszWinampTitle;
-
if (ai->argc != 1)
return NULL;
ai->flags |= AIF_DONTPARSE;
- ptszWinampTitle = GetWinampSong();
+ TCHAR *ptszWinampTitle = GetWinampSong();
if (ptszWinampTitle != NULL) {
mir_free(g_ptszWinampSong);
@@ -1677,11 +1674,10 @@ static TCHAR *ParseWinampSong(ARGUMENTSINFO *ai) static TCHAR *ParseDate(ARGUMENTSINFO *ai)
{
- TCHAR szStr[128] = {0};
-
if (ai->argc != 1)
return NULL;
+ TCHAR szStr[128] = {0};
ai->flags |= AIF_DONTPARSE;
GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, NULL, NULL, szStr, SIZEOF(szStr));
@@ -1769,7 +1765,7 @@ static int OnAccListChanged(WPARAM wParam, LPARAM lParam) return 0;
}
-static int OnModulesLoaded(WPARAM wParam, LPARAM lParam)
+static int OnModulesLoaded(WPARAM, LPARAM)
{
#ifdef _DEBUG
log2file("### Session started ###");
@@ -1822,7 +1818,7 @@ static int OnModulesLoaded(WPARAM wParam, LPARAM lParam) g_ptszWinampSong = mir_tstrdup(_T("SimpleStatusMsg"));*/
if (db_get_b(NULL, "SimpleStatusMsg", "UpdateMsgOn", 1))
- g_uUpdateMsgTimer = SetTimer(NULL, 0, db_get_w(NULL, "SimpleStatusMsg", "UpdateMsgInt", 10) * 1000, (TIMERPROC)UpdateMsgTimerProc);
+ g_uUpdateMsgTimer = SetTimer(NULL, 0, db_get_w(NULL, "SimpleStatusMsg", "UpdateMsgInt", 10) * 1000, UpdateMsgTimerProc);
if (ServiceExists(MS_CS_SETSTATUSEX))
HookEvent(ME_CS_STATUSCHANGEEX, CSStatusChange);
@@ -1832,7 +1828,7 @@ static int OnModulesLoaded(WPARAM wParam, LPARAM lParam) if (!ServiceExists(MS_SS_GETPROFILECOUNT)) {
if (db_get_b(NULL, "SimpleStatusMsg", "GlobalStatusDelay", 1))
- SetTimer(NULL, 0, db_get_w(NULL, "SimpleStatusMsg", "SetStatusDelay", 300), (TIMERPROC)SetStartupStatusGlobal);
+ SetTimer(NULL, 0, db_get_w(NULL, "SimpleStatusMsg", "SetStatusDelay", 300), SetStartupStatusGlobal);
else {
g_uSetStatusTimer = (UINT_PTR *)mir_alloc(sizeof(UINT_PTR) * accounts->count);
for (int i = 0; i < accounts->count; ++i) {
@@ -1844,7 +1840,7 @@ static int OnModulesLoaded(WPARAM wParam, LPARAM lParam) char szSetting[80];
mir_snprintf(szSetting, SIZEOF(szSetting), "Set%sStatusDelay", accounts->pa[i]->szModuleName);
- g_uSetStatusTimer[i] = SetTimer(NULL, 0, db_get_w(NULL, "SimpleStatusMsg", szSetting, 300), (TIMERPROC)SetStartupStatusProc);
+ g_uSetStatusTimer[i] = SetTimer(NULL, 0, db_get_w(NULL, "SimpleStatusMsg", szSetting, 300), SetStartupStatusProc);
}
}
}
@@ -1852,7 +1848,7 @@ static int OnModulesLoaded(WPARAM wParam, LPARAM lParam) return 0;
}
-static int OnOkToExit(WPARAM wParam, LPARAM lParam)
+static int OnOkToExit(WPARAM, LPARAM)
{
if (accounts->statusCount) {
char szSetting[80];
@@ -1875,7 +1871,7 @@ static int OnOkToExit(WPARAM wParam, LPARAM lParam) return 0;
}
-static int OnPreShutdown(WPARAM wParam, LPARAM lParam)
+static int OnPreShutdown(WPARAM, LPARAM)
{
if (!accounts->statusMsgFlags)
return 0;
diff --git a/plugins/SimpleStatusMsg/src/msgbox.cpp b/plugins/SimpleStatusMsg/src/msgbox.cpp index d71d7aa763..dd2c06f3b1 100644 --- a/plugins/SimpleStatusMsg/src/msgbox.cpp +++ b/plugins/SimpleStatusMsg/src/msgbox.cpp @@ -244,7 +244,7 @@ HWND WINAPI CreateRecentComboBoxEx(HWND hwndDlg, struct MsgBoxData *data) mir_snprintf(buff, SIZEOF(buff), "SMsg%d", j); j--; if (!db_get_ts(NULL, "SimpleStatusMsg", buff, &dbv)) { - if (dbv.ptszVal != NULL && dbv.ptszVal != '\0') { + if (dbv.ptszVal != NULL && *dbv.ptszVal != '\0') { found = TRUE; cbei.iItem = -1; cbei.pszText = (LPTSTR)dbv.ptszVal; diff --git a/plugins/Spamotron/src/utils.cpp b/plugins/Spamotron/src/utils.cpp index ef78a9f29d..ce8730a7b9 100644 --- a/plugins/Spamotron/src/utils.cpp +++ b/plugins/Spamotron/src/utils.cpp @@ -206,25 +206,24 @@ int get_response_num(const TCHAR *str) return i;
}
-TCHAR* get_response(TCHAR* dst, unsigned int dstlen, int num)
+TCHAR* get_response(TCHAR *dst, unsigned int dstlen, int num)
{
- int i = 0;
- TCHAR *tmp, *src = NULL;
if (num < 0)
return dst;
- src = (TCHAR*)malloc(MAX_BUFFER_LENGTH * sizeof(TCHAR));
+ TCHAR *src = (TCHAR*)malloc(MAX_BUFFER_LENGTH * sizeof(TCHAR));
+ int i = 0;
if (src != NULL) {
_getOptS(src, MAX_BUFFER_LENGTH, "Response", defaultResponse);
- _tcscpy(src, src);
- tmp = _tcstok(src, L"\r\n");
+ _tcsncpy(dst, src, dstlen);
+ TCHAR *tmp = _tcstok(src, L"\r\n");
while (tmp) {
if (i == num) {
- _tcscpy(dst, tmp);
+ _tcsncpy(dst, tmp, dstlen);
free(src);
return dst;
}
i++;
- tmp = _tcstok(NULL, L"\r\n");
+ tmp = _tcstok(src, L"\r\n");
}
free(src);
}
diff --git a/plugins/TabSRMM/src/buttonsbar.cpp b/plugins/TabSRMM/src/buttonsbar.cpp index 3d46372ed1..2f21dfed4e 100644 --- a/plugins/TabSRMM/src/buttonsbar.cpp +++ b/plugins/TabSRMM/src/buttonsbar.cpp @@ -414,6 +414,11 @@ void BB_UpdateIcons(HWND hdlg, TWindowData *dat) void TSAPI BB_InitDlgButtons(TWindowData *dat) { + if (dat == 0) + return; + HWND hdlg = dat->hwnd; + if (hdlg == 0) + return; RECT rect; int i; int lwidth = 0, rwidth = 0; @@ -425,9 +430,7 @@ void TSAPI BB_InitDlgButtons(TWindowData *dat) int cx = 0, cy = 0; int lcount = LButtonsList.getCount(); int rcount = RButtonsList.getCount(); - HWND hdlg = dat->hwnd; - if (dat == 0 || hdlg == 0) { return; } if (CSkin::m_skinEnabled && !SkinItems[ID_EXTBKBUTTONSNPRESSED].IGNORED && !SkinItems[ID_EXTBKBUTTONSPRESSED].IGNORED && !SkinItems[ID_EXTBKBUTTONSMOUSEOVER].IGNORED) { isThemed = FALSE; diff --git a/plugins/TabSRMM/src/container.cpp b/plugins/TabSRMM/src/container.cpp index 1962c1b8e1..5f74bbd09c 100644 --- a/plugins/TabSRMM/src/container.cpp +++ b/plugins/TabSRMM/src/container.cpp @@ -619,7 +619,7 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam, LONG y_pad = M.GetByte("y-pad", 3) + ((pContainer->dwFlags & CNT_TABSBOTTOM) ? 1 : 0); if (pContainer->dwFlagsEx & TCF_FLAT) - y_pad += 1; //(pContainer->dwFlags & CNT_TABSBOTTOM ? 1 : 2); + y_pad++; //(pContainer->dwFlags & CNT_TABSBOTTOM ? 1 : 2); TabCtrl_SetPadding(GetDlgItem(hwndDlg, IDC_MSGTABS), x_pad, y_pad); @@ -838,14 +838,12 @@ panel_found: } else if (((LPNMHDR)lParam)->code == NM_RCLICK) { POINT pt; - MCONTACT hContact = 0; - HMENU hMenu; - GetCursorPos(&pt); + MCONTACT hContact = 0; SendMessage(pContainer->hwndActive, DM_QUERYHCONTACT, 0, (LPARAM)&hContact); if (hContact) { int iSel = 0; - hMenu = (HMENU) CallService(MS_CLIST_MENUBUILDCONTACT, hContact, 0); + HMENU hMenu = (HMENU) CallService(MS_CLIST_MENUBUILDCONTACT, hContact, 0); iSel = TrackPopupMenu(hMenu, TPM_RETURNCMD, pt.x, pt.y, 0, hwndDlg, NULL); if (iSel) CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(iSel), MPCF_CONTACTMENU), hContact); @@ -1000,9 +998,7 @@ panel_found: { RECT rc; LONG dwNewLeft; - BOOL skinnedMode = bSkinned; - - skinnedMode |= (IsThemeActive() ? 1 : 0); + BOOL skinnedMode = bSkinned | (IsThemeActive() ? 1 : 0); GetWindowRect(hwndDlg, &rc); diff --git a/plugins/TabSRMM/src/controls.cpp b/plugins/TabSRMM/src/controls.cpp index f26f1e3990..b09bfdc44b 100644 --- a/plugins/TabSRMM/src/controls.cpp +++ b/plugins/TabSRMM/src/controls.cpp @@ -448,7 +448,7 @@ void CMenuBar::updateState(const HMENU hMenu) const if (dat) { ::CheckMenuItem(hMenu, ID_VIEW_SHOWMENUBAR, MF_BYCOMMAND | m_pContainer->dwFlags & CNT_NOMENUBAR ? MF_UNCHECKED : MF_CHECKED); ::CheckMenuItem(hMenu, ID_VIEW_SHOWSTATUSBAR, MF_BYCOMMAND | m_pContainer->dwFlags & CNT_NOSTATUSBAR ? MF_UNCHECKED : MF_CHECKED); - ::CheckMenuItem(hMenu, ID_VIEW_SHOWAVATAR, MF_BYCOMMAND | dat->bShowAvatar ? MF_CHECKED : MF_UNCHECKED); + ::CheckMenuItem(hMenu, ID_VIEW_SHOWAVATAR, MF_BYCOMMAND | (dat->bShowAvatar ? MF_CHECKED : MF_UNCHECKED)); ::CheckMenuItem(hMenu, ID_VIEW_SHOWTITLEBAR, MF_BYCOMMAND | m_pContainer->dwFlags & CNT_NOTITLE ? MF_UNCHECKED : MF_CHECKED); ::EnableMenuItem(hMenu, ID_VIEW_SHOWTITLEBAR, CSkin::m_skinEnabled && CSkin::m_frameSkins ? MF_GRAYED : MF_ENABLED); diff --git a/plugins/TabSRMM/src/hotkeyhandler.cpp b/plugins/TabSRMM/src/hotkeyhandler.cpp index c5fd0dc581..adeaedb97e 100644 --- a/plugins/TabSRMM/src/hotkeyhandler.cpp +++ b/plugins/TabSRMM/src/hotkeyhandler.cpp @@ -520,7 +520,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP ack.type = ACKTYPE_MESSAGE;
ack.result = ACKRESULT_SUCCESS;
- if (job->hContact && job->iAcksNeeded && job->hContact && job->iStatus == SendQueue::SQ_INPROGRESS) {
+ if (job->hContact && job->iAcksNeeded && job->iStatus == SendQueue::SQ_INPROGRESS) {
if (IsWindow(job->hOwnerWnd))
::SendMessage(job->hOwnerWnd, HM_EVENTSENT, (WPARAM)MAKELONG(wParam, 0), (LPARAM)&ack);
else
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index ab677d6451..9b334fb22f 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -3231,7 +3231,7 @@ quote_from_last: } _dlgReturn(hwndDlg, TRUE); } - { + if(dat) { TContainerData *pContainer = dat->pContainer; if (dat->iOpenJobs > 0 && lParam != 2) { if (dat->dwFlags & MWF_ERRORSTATE) { diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp index a448be6be0..e5299a53da 100644 --- a/plugins/TabSRMM/src/msglog.cpp +++ b/plugins/TabSRMM/src/msglog.cpp @@ -126,13 +126,12 @@ static void TrimMessage(TCHAR *msg) void TSAPI CacheLogFonts()
{
- int i;
HDC hdc = GetDC(NULL);
logPixelSY = GetDeviceCaps(hdc, LOGPIXELSY);
ReleaseDC(NULL, hdc);
- ZeroMemory(logfonts, sizeof(LOGFONTA) * MSGDLGFONTCOUNT + 2);
- for (i = 0; i < MSGDLGFONTCOUNT; i++) {
+ ZeroMemory(logfonts, sizeof(LOGFONTA) * (MSGDLGFONTCOUNT + 2));
+ for (int i = 0; i < MSGDLGFONTCOUNT; i++) {
LoadLogfont(i, &logfonts[i], &fontcolors[i], FONTMODULE);
mir_snprintf(rtfFontsGlobal[i], SIZEOF(rtfFontsGlobal[i]), "\\f%u\\cf%u\\b%d\\i%d\\ul%d\\fs%u", i, i, logfonts[i].lfWeight >= FW_BOLD ? 1 : 0, logfonts[i].lfItalic, logfonts[i].lfUnderline, 2 * abs(logfonts[i].lfHeight) * 74 / logPixelSY);
}
@@ -149,7 +148,7 @@ void TSAPI CacheLogFonts() COLORREF clr;
LOGFONTA lf;
- for (i = 0; i < IPFONTCOUNT; i++) {
+ for (int i = 0; i < IPFONTCOUNT; i++) {
if (CInfoPanel::m_ipConfig.hFonts[i])
DeleteObject(CInfoPanel::m_ipConfig.hFonts[i]);
LoadLogfont(i + 100, &lf, &clr, FONTMODULE);
diff --git a/plugins/TabSRMM/src/sendqueue.cpp b/plugins/TabSRMM/src/sendqueue.cpp index fd5b0f1342..d9a47724af 100644 --- a/plugins/TabSRMM/src/sendqueue.cpp +++ b/plugins/TabSRMM/src/sendqueue.cpp @@ -580,7 +580,7 @@ void SendQueue::recallFailed(const TWindowData *dat, int iEntry) const void SendQueue::UpdateSaveAndSendButton(TWindowData *dat) { if (dat) { - HWND hwndDlg = dat->hwnd; + HWND hwndDlg = dat->hwnd; GETTEXTLENGTHEX gtxl = {0}; gtxl.codepage = CP_UTF8; @@ -829,7 +829,7 @@ int SendQueue::doSendLater(int iJobIndex, TWindowData *dat, MCONTACT hContact, b } if (iJobIndex >= 0 && iJobIndex < NR_SENDJOBS) { - SendJob* job = &m_jobs[iJobIndex]; + SendJob *job = &m_jobs[iJobIndex]; char szKeyName[20]; TCHAR tszHeader[150]; diff --git a/plugins/TabSRMM/src/templates.cpp b/plugins/TabSRMM/src/templates.cpp index 4bd8f52bae..d03e5c81f8 100644 --- a/plugins/TabSRMM/src/templates.cpp +++ b/plugins/TabSRMM/src/templates.cpp @@ -118,11 +118,10 @@ void LoadDefaultTemplates() INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { - TWindowData *dat; TemplateEditorInfo *teInfo = 0; TTemplateSet *tSet; int i; - dat = (TWindowData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); + TWindowData *dat = (TWindowData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); /* * since this dialog needs a MessageWindowData * but has no container, we can store * the extended info struct in pContainer *) diff --git a/plugins/TabSRMM/src/themes.cpp b/plugins/TabSRMM/src/themes.cpp index 44284695f3..7e2e4833ae 100644 --- a/plugins/TabSRMM/src/themes.cpp +++ b/plugins/TabSRMM/src/themes.cpp @@ -841,7 +841,6 @@ TCHAR* CImageItem::Read(const TCHAR *szFilename) m_dwFlags |= IMAGE_FLAG_DIVIDED;
m_bf.BlendFlags = 0;
m_bf.BlendOp = AC_SRC_OVER;
- m_bf.AlphaFormat = 0;
m_dwFlags |= IMAGE_PERPIXEL_ALPHA;
m_bf.AlphaFormat = AC_SRC_ALPHA;
if (m_inner_height <= 0 || m_inner_width <= 0) {
@@ -1371,7 +1370,6 @@ void CSkin::Load(void) if (!m_tszFileName[0] || !::PathFileExists(m_tszFileName))
return;
- TCHAR *p;
TCHAR *szSections = (TCHAR*)mir_alloc(6004);
int i = 1, j = 0;
UINT data;
@@ -1407,10 +1405,9 @@ void CSkin::Load(void) m_DisableScrollbars = M.GetByte("disableVScroll", 0) ? true : false;
ZeroMemory(szSections, 6000);
- p = szSections;
GetPrivateProfileSectionNames(szSections, 3000, m_tszFileName);
szSections[3001] = szSections[3000] = 0;
- p = szSections;
+ TCHAR *p = szSections;
while (lstrlen(p) > 1) {
if (p[0] != '%') {
p += (lstrlen(p) + 1);
@@ -1719,19 +1716,19 @@ void CSkin::setupAeroSkins() float fmax = max(max(fr, fg), fb);
if (fmax == fr) {
- fr *= (alphafactor / 100 * 2.2);
+ fr *= (alphafactor / 100.0 * 2.2);
fr = min(fr, 255);
fb = min(fb * alphafactor / 100, 255);
fg = min(fg * alphafactor / 100, 255);
}
else if (fmax == fg) {
- fg *= (alphafactor / 100 * 2.2);
+ fg *= (alphafactor / 100.0 * 2.2);
fg = min(fg, 255);
fr = min(fr * alphafactor / 100, 255);
fb = min(fb * alphafactor / 100, 255);
}
else {
- fb *= (alphafactor / 100 * 2.2);
+ fb *= (alphafactor / 100.0 * 2.2);
fb = min(fb, 255);
fr = min(fr * alphafactor / 100, 255);
fg = min(fg * alphafactor / 100, 255);
@@ -1838,11 +1835,9 @@ void CSkin::setupAeroSkins() void CSkin::SkinCalcFrameWidth()
{
- int xBorder, yBorder, yCaption;
-
- xBorder = GetSystemMetrics(SM_CXSIZEFRAME);
- yBorder = GetSystemMetrics(SM_CYSIZEFRAME);
- yCaption = GetSystemMetrics(SM_CYCAPTION);
+ int xBorder = GetSystemMetrics(SM_CXSIZEFRAME);
+ int yBorder = GetSystemMetrics(SM_CYSIZEFRAME);
+ int yCaption = GetSystemMetrics(SM_CYCAPTION);
m_realSkinnedFrame_left = m_SkinnedFrame_left - xBorder;
m_realSkinnedFrame_right = m_SkinnedFrame_right - xBorder;
diff --git a/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp b/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp index bf0329ece7..6255e8cbad 100644 --- a/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp +++ b/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp @@ -261,7 +261,6 @@ static INT_PTR ServiceCreateMergedFlagIcon(WPARAM wParam,LPARAM lParam) hrgn=CreatePolygonRgn(aptTriangle,SIZEOF(aptTriangle),WINDING);
if (hrgn!=NULL) {
SelectClipRgn(hdc,hrgn);
- DeleteObject(hrgn);
hbmPrev=(HBITMAP)SelectObject(hdc,icoi.hbmColor);
if (hbmPrev!=NULL) { /* error on select? */
if (DrawIconEx(hdc,0,0,hUpperIcon,bm.bmWidth,bm.bmHeight,0,NULL,DI_NOMIRROR|DI_IMAGE)) {
diff --git a/plugins/Watrack_MPD/src/main.cpp b/plugins/Watrack_MPD/src/main.cpp index 01496d9f06..171bcc853c 100755 --- a/plugins/Watrack_MPD/src/main.cpp +++ b/plugins/Watrack_MPD/src/main.cpp @@ -413,17 +413,17 @@ void RegisterPlayer() { PLAYERCELL player = {0}; player.Desc = "Music Player Daemon"; + player.Notes = _T("mpd is a nice music player for *nix which have not any gui, just daemon.\nuses very small amount of ram, cpu."); + player.URL = "http://www.musicpd.org"; player.Check = CheckPlayer; player.Init = Init; player.DeInit = DeInit; - player.GetStatus = GetStatus; player.Command = SendCommand; - player.flags = (WAT_OPT_HASURL|WAT_OPT_SINGLEINST|WAT_OPT_PLAYERINFO); + player.GetStatus = GetStatus; player.GetName = GetFileName; player.GetInfo = GetPlayerInfo; + player.flags = (WAT_OPT_HASURL|WAT_OPT_SINGLEINST|WAT_OPT_PLAYERINFO); // player.Icon = //TODO:implement icon support - player.Notes = _T("mpd is a nice music player for *nix which have not any gui, just daemon.\nuses very small amount of ram, cpu."); - player.URL = "http://www.musicpd.org"; CallService(MS_WAT_PLAYER, WAT_ACT_REGISTER, (LPARAM)&player); } }
\ No newline at end of file diff --git a/plugins/Weather/src/weather_ini.cpp b/plugins/Weather/src/weather_ini.cpp index 59c618382b..066861beed 100644 --- a/plugins/Weather/src/weather_ini.cpp +++ b/plugins/Weather/src/weather_ini.cpp @@ -247,7 +247,7 @@ void LoadStationData(TCHAR *pszFile, TCHAR *pszShortFile, WIDATA *Data) };
// clean up old stuff
- ZeroMemory(Data, sizeof(Data));
+ ZeroMemory(Data, sizeof(*Data));
Data->Enabled = FALSE;
// open the ini file
diff --git a/plugins/WebView/src/webview_alerts.cpp b/plugins/WebView/src/webview_alerts.cpp index d2aeef1329..35378816ba 100644 --- a/plugins/WebView/src/webview_alerts.cpp +++ b/plugins/WebView/src/webview_alerts.cpp @@ -132,15 +132,15 @@ int PopupAlert(WPARAM wParam, LPARAM lParam) if ( db_get_b(NULL, MODULENAME, POP_USECUSTCLRS_KEY, 0)) {
ppd.colorBack = db_get_dw(NULL, MODULENAME, POP_BG_CLR_KEY, Def_color_bg);
- ppd.colorBack = db_get_dw(NULL, MODULENAME, POP_TXT_CLR_KEY, Def_color_txt);
+ ppd.colorText = db_get_dw(NULL, MODULENAME, POP_TXT_CLR_KEY, Def_color_txt);
}
- if ( db_get_b(NULL, MODULENAME, POP_USEWINCLRS_KEY, 0)) {
+ else if ( db_get_b(NULL, MODULENAME, POP_USEWINCLRS_KEY, 0)) {
ppd.colorBack = GetSysColor(COLOR_BTNFACE);
- ppd.colorBack = GetSysColor(COLOR_WINDOWTEXT);
+ ppd.colorText = GetSysColor(COLOR_WINDOWTEXT);
}
- if ( db_get_b(NULL, MODULENAME, POP_USESAMECLRS_KEY, 1)) {
+ else if ( db_get_b(NULL, MODULENAME, POP_USESAMECLRS_KEY, 1)) {
ppd.colorBack = BackgoundClr;
- ppd.colorBack = TextClr;
+ ppd.colorText = TextClr;
}
ppd.PluginWindowProc = NULL;
diff --git a/plugins/WinterSpeak/src/DialogConfigEngine.cpp b/plugins/WinterSpeak/src/DialogConfigEngine.cpp index 2375dedcc7..9c5be8dfe9 100644 --- a/plugins/WinterSpeak/src/DialogConfigEngine.cpp +++ b/plugins/WinterSpeak/src/DialogConfigEngine.cpp @@ -109,7 +109,7 @@ void DialogConfigEngine::load(HWND window) std::vector<std::wstring> engines = si.getAvailableEngines();
for (unsigned int i = 0; i < engines.size(); ++i)
{
- SendDlgItemMessage(window, IDC_SELECT_ENGINE, CB_ADDSTRING, 0, (long)(engines[i].c_str()));
+ SendDlgItemMessage(window, IDC_SELECT_ENGINE, CB_ADDSTRING, 0, (LPARAM)(engines[i].c_str()));
}
VoiceDesc desc = m_db.getVoiceDesc();
@@ -120,7 +120,7 @@ void DialogConfigEngine::load(HWND window) SendDlgItemMessage(window, IDC_SLIDER_RATE, TBM_SETPOS, TRUE, desc.rate);
// select the speech engine
- SendDlgItemMessage(window, IDC_SELECT_ENGINE, CB_SELECTSTRING, 0, reinterpret_cast<long>(desc.engine.c_str()));
+ SendDlgItemMessage(window, IDC_SELECT_ENGINE, CB_SELECTSTRING, 0, reinterpret_cast<LPARAM>(desc.engine.c_str()));
// initialise the welcome message box
SetDlgItemText(window, IDC_WELCOME_MSG, m_db.getWelcomeMessage().c_str());
@@ -158,13 +158,13 @@ void DialogConfigEngine::updateVoices(HWND window) for (unsigned int i = 0; i < voices.size(); ++i)
{
SendDlgItemMessage(window, IDC_SELECT_VOICE, CB_ADDSTRING, 0,
- (long)voices[i].c_str());
+ (LPARAM)voices[i].c_str());
}
// get the voice saved in the database
std::wstring voice = m_db.getVoiceDesc().voice;
- if (FAILED(SendDlgItemMessage(window, IDC_SELECT_VOICE, CB_FINDSTRINGEXACT, 0, (long)voice.c_str())))
+ if (FAILED(SendDlgItemMessage(window, IDC_SELECT_VOICE, CB_FINDSTRINGEXACT, 0, (LPARAM)voice.c_str())))
{
// select the first one
SendDlgItemMessage(window, IDC_SELECT_VOICE, CB_SETCURSEL , 0, 0);
diff --git a/plugins/YARelay/src/main.cpp b/plugins/YARelay/src/main.cpp index e41a97859c..eac2d93b3f 100644 --- a/plugins/YARelay/src/main.cpp +++ b/plugins/YARelay/src/main.cpp @@ -156,7 +156,7 @@ static int MessageEventAdded(WPARAM wParam, LPARAM lParam) // get sender's uin
CONTACTINFO ci = { sizeof(ci) };
ci.dwFlag = CNF_UNIQUEID;
- if (CallService(MS_CONTACT_GETCONTACTINFO, 0, (long)&ci) == 0){
+ if (CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM)&ci) == 0){
if (ci.type == CNFT_ASCIIZ)
_tcsncpy_s(buf, ci.pszVal, _TRUNCATE);
else if (ci.type == CNFT_BYTE)
|