From e48bae4c6ccf1003916b3960f30816ce8aaa955b Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 31 May 2015 21:02:26 +0000 Subject: - additional operator LPARAM() for _A2T & _T2A; - we don't need StrConvA anymore; - code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@13952 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- include/m_core.h | 10 ++++------ plugins/AVS/src/image_utils.cpp | 2 +- plugins/AddContactPlus/src/addcontact.cpp | 2 +- plugins/Alarms/src/frame.cpp | 15 +++++++-------- plugins/AutoShutdown/src/shutdownsvc.cpp | 2 +- plugins/BASS_interface/src/Main.cpp | 2 +- plugins/Clist_modern/src/modern_clcutils.cpp | 4 ++-- plugins/Clist_nicer/src/clc.cpp | 6 +++--- plugins/Clist_nicer/src/clui.cpp | 2 +- plugins/ContactsPlus/src/send.cpp | 2 +- plugins/DbEditorPP/src/copymodule.cpp | 2 +- plugins/Db_autobackups/src/options.cpp | 2 +- plugins/HTTPServer/src/GuiElements.cpp | 2 +- plugins/HistoryLinkListPlus/src/linklist_dlg.cpp | 4 ++-- plugins/HistoryLinkListPlus/src/linklist_fct.cpp | 4 ++-- plugins/IgnoreState/src/options.cpp | 2 +- plugins/KeyboardNotify/src/options.cpp | 2 +- plugins/LotusNotify/src/LotusNotify.cpp | 5 +---- plugins/MirandaG15/src/CConfig.cpp | 2 +- plugins/MyDetails/src/frame.cpp | 8 ++++---- plugins/NotesAndReminders/src/notes.cpp | 4 ++-- plugins/NotesAndReminders/src/reminders.cpp | 14 +++++++------- plugins/PasteIt/src/PasteIt.cpp | 2 +- plugins/Popup/src/common.h | 5 ++--- plugins/Popup/src/services.cpp | 2 +- plugins/RecentContacts/src/RecentContacts.cpp | 4 ++-- plugins/Scriver/src/utils.cpp | 6 +++--- plugins/SecureIM/src/options.cpp | 6 +++--- plugins/SecureIM/src/svcs_proto.cpp | 8 ++++---- plugins/Sessions/Src/Utils.cpp | 4 ++-- plugins/ShellExt/src/shlcom.cpp | 2 +- plugins/SimpleStatusMsg/src/msgbox.cpp | 4 ++-- plugins/SimpleStatusMsg/src/options.cpp | 4 ++-- plugins/SmileyAdd/src/smileys.cpp | 4 ++-- plugins/StatusChange/src/main.cpp | 4 ++-- .../StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp | 2 +- plugins/TabSRMM/src/chat/options.cpp | 2 +- plugins/TabSRMM/src/generic_msghandlers.cpp | 2 +- plugins/TabSRMM/src/msgdialog.cpp | 2 +- plugins/TipperYM/src/bitmap_func.cpp | 2 +- plugins/WinterSpeak/src/DialogConfigEngine.cpp | 2 +- protocols/JabberG/src/jabber_adhoc.cpp | 2 +- protocols/JabberG/src/jabber_iqid_muc.cpp | 14 ++++++-------- protocols/JabberG/src/jabber_vcard.cpp | 12 ++++++------ protocols/Sametime/src/conference.cpp | 2 +- protocols/Sametime/src/messaging.cpp | 2 +- protocols/Tlen/src/tlen_svc.cpp | 2 +- protocols/Yahoo/src/proto.cpp | 2 +- protocols/Yahoo/src/search.cpp | 8 ++++---- src/core/miranda.h | 15 --------------- src/core/stdchat/src/window.cpp | 4 ++-- src/core/stdfile/src/filesenddlg.cpp | 2 +- src/core/stduserinfo/src/contactinfo.cpp | 16 ++++++++-------- src/modules/chat/clist.cpp | 2 +- src/modules/chat/tools.cpp | 2 +- src/modules/clist/genmenuopt.cpp | 2 +- src/modules/protocols/protoaccs.cpp | 2 +- src/modules/protocols/protoint.cpp | 8 ++++---- src/modules/protocols/protoopts.cpp | 2 +- 59 files changed, 120 insertions(+), 144 deletions(-) diff --git a/include/m_core.h b/include/m_core.h index 5e431808a7..efcde5e1c2 100644 --- a/include/m_core.h +++ b/include/m_core.h @@ -585,9 +585,8 @@ public: __forceinline _A2T(const char* s, int cp) : buf(mir_a2t_cp(s, cp)) {} ~_A2T() { mir_free(buf); } - __forceinline operator TCHAR*() const - { return buf; - } + __forceinline operator LPARAM() const { return (LPARAM)buf; } + __forceinline operator TCHAR*() const { return buf; } }; class _T2A @@ -599,9 +598,8 @@ public: __forceinline _T2A(const TCHAR* s, int cp) : buf(mir_t2a_cp(s, cp)) {} __forceinline ~_T2A() { mir_free(buf); } - __forceinline operator char*() const - { return buf; - } + __forceinline operator LPARAM() const { return (LPARAM)buf; } + __forceinline operator char*() const { return buf; } }; #endif diff --git a/plugins/AVS/src/image_utils.cpp b/plugins/AVS/src/image_utils.cpp index f546a252e2..9ab45c6516 100644 --- a/plugins/AVS/src/image_utils.cpp +++ b/plugins/AVS/src/image_utils.cpp @@ -555,7 +555,7 @@ int SaveAvatar(const char *protocol, const TCHAR *tszFileName) { INT_PTR result = CallProtoService(protocol, PS_SETMYAVATART, 0, (LPARAM)tszFileName); if (result == CALLSERVICE_NOTFOUND) - result = CallProtoService(protocol, PS_SETMYAVATAR, 0, (LPARAM)(char*)_T2A(tszFileName)); + result = CallProtoService(protocol, PS_SETMYAVATAR, 0, _T2A(tszFileName)); return result; } diff --git a/plugins/AddContactPlus/src/addcontact.cpp b/plugins/AddContactPlus/src/addcontact.cpp index 4e285068a1..b2e0741f56 100644 --- a/plugins/AddContactPlus/src/addcontact.cpp +++ b/plugins/AddContactPlus/src/addcontact.cpp @@ -304,7 +304,7 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM) } if (GetAsyncKeyState(VK_CONTROL)) - CallService(MS_MSG_SENDMESSAGE, hContact, (LPARAM)(const char*)NULL); + CallService(MS_MSG_SENDMESSAGE, hContact, NULL); } // fall through case IDCANCEL: diff --git a/plugins/Alarms/src/frame.cpp b/plugins/Alarms/src/frame.cpp index 18659fec9c..621ac75fd6 100644 --- a/plugins/Alarms/src/frame.cpp +++ b/plugins/Alarms/src/frame.cpp @@ -195,7 +195,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar if (GetUpdateRect(hwnd, &r, FALSE)) { PAINTSTRUCT ps; HDC hdc = BeginPaint(hwnd, &ps); - SendMessage(hwnd, WM_PRINTCLIENT, (WPARAM)hdc, (LPARAM)(PRF_CLIENT | PRF_CHILDREN)); + SendMessage(hwnd, WM_PRINTCLIENT, (WPARAM)hdc, PRF_CLIENT | PRF_CHILDREN); EndPaint(hwnd, &ps); } } @@ -209,10 +209,9 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar if (IsWindowVisible(hwnd)) { SendMessage(hwnd, WMU_SIZE_LIST, 0, 0); - if (frame_id != -1) { - //CallService(MS_CLIST_FRAMES_UPDATEFRAME, (WPARAM)frame_id, (LPARAM)(FU_TBREDRAW | FU_FMREDRAW)); - CallService(MS_CLIST_FRAMES_UPDATEFRAME, (WPARAM)frame_id, (LPARAM)FU_TBREDRAW); - } + if (frame_id != -1) + CallService(MS_CLIST_FRAMES_UPDATEFRAME, (WPARAM)frame_id, FU_TBREDRAW); + InvalidateRect(hwnd, 0, TRUE); } break; @@ -239,8 +238,8 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar SetWindowPos(GetParent(hwnd), 0, 0, 0, rp_window.right - rp_window.left, height, SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE); } else if (ServiceExists(MS_CLIST_FRAMES_ADDFRAME) && frame_id != -1) { - CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS, MAKEWPARAM(FO_HEIGHT, frame_id), (LPARAM)(count * itemheight)); - CallService(MS_CLIST_FRAMES_UPDATEFRAME, (WPARAM)frame_id, (LPARAM)(FU_TBREDRAW | FU_FMREDRAW | FU_FMPOS)); + CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS, MAKEWPARAM(FO_HEIGHT, frame_id), count * itemheight); + CallService(MS_CLIST_FRAMES_UPDATEFRAME, (WPARAM)frame_id, FU_TBREDRAW | FU_FMREDRAW | FU_FMPOS); } } @@ -267,7 +266,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar // we have reminders - show if not linked to clist or if clist is visible if ((!options.hide_with_clist && FrameIsFloating()) || IsWindowVisible((HWND)CallService(MS_CLUI_GETHWND, 0, 0))) { CallService(MS_CLIST_FRAMES_SHFRAME, (WPARAM)frame_id, 0); - CallService(MS_CLIST_FRAMES_UPDATEFRAME, (WPARAM)frame_id, (LPARAM)(FU_FMREDRAW | FU_FMPOS)); + CallService(MS_CLIST_FRAMES_UPDATEFRAME, (WPARAM)frame_id, FU_FMREDRAW | FU_FMPOS); } } } diff --git a/plugins/AutoShutdown/src/shutdownsvc.cpp b/plugins/AutoShutdown/src/shutdownsvc.cpp index 3de69ba4d2..a4aafa2763 100644 --- a/plugins/AutoShutdown/src/shutdownsvc.cpp +++ b/plugins/AutoShutdown/src/shutdownsvc.cpp @@ -425,7 +425,7 @@ INT_PTR ServiceShutdown(WPARAM wParam,LPARAM lParam) NotifyEventHooks(hEventShutdown,wParam,lParam); /* show dialog */ if (lParam && db_get_b(NULL,"AutoShutdown","ShowConfirmDlg",SETTING_SHOWCONFIRMDLG_DEFAULT)) - if (CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_SHUTDOWNNOW), NULL, ShutdownDlgProc, (LPARAM)(BYTE)wParam) != NULL) + if (CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_SHUTDOWNNOW), NULL, ShutdownDlgProc, (BYTE)wParam) != NULL) return 0; /* show error */ diff --git a/plugins/BASS_interface/src/Main.cpp b/plugins/BASS_interface/src/Main.cpp index e9adaf117d..79b6349ba5 100644 --- a/plugins/BASS_interface/src/Main.cpp +++ b/plugins/BASS_interface/src/Main.cpp @@ -194,7 +194,7 @@ INT_PTR CALLBACK OptionsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara SendDlgItemMessage(hwndDlg, IDC_OUTDEVICE, CB_SETCURSEL, 0, 0); db_get_ts(NULL, ModuleName, OPT_OUTDEVICE, &dbv); for (int i = 1; BASS_GetDeviceInfo(i + newBass, &info); i++) { - SendDlgItemMessage(hwndDlg, IDC_OUTDEVICE, CB_ADDSTRING, 0, (LPARAM)(TCHAR*)_A2T(info.name)); + SendDlgItemMessage(hwndDlg, IDC_OUTDEVICE, CB_ADDSTRING, 0, _A2T(info.name)); if (!mir_tstrcmp(dbv.ptszVal, _A2T(info.name))) SendDlgItemMessage(hwndDlg, IDC_OUTDEVICE, CB_SETCURSEL, i, 0); } diff --git a/plugins/Clist_modern/src/modern_clcutils.cpp b/plugins/Clist_modern/src/modern_clcutils.cpp index 6fd85d6d35..33734e5199 100644 --- a/plugins/Clist_modern/src/modern_clcutils.cpp +++ b/plugins/Clist_modern/src/modern_clcutils.cpp @@ -332,7 +332,7 @@ void cliBeginRenameSelection(HWND hwnd, ClcData *dat) mir_subclassWindow(dat->hwndRenameEdit, RenameEditSubclassProc); SendMessage(dat->hwndRenameEdit, WM_SETFONT, (WPARAM)(contact->type == CLCIT_GROUP ? dat->fontModernInfo[FONTID_OPENGROUPS].hFont : dat->fontModernInfo[FONTID_CONTACTS].hFont), 0); SendMessage(dat->hwndRenameEdit, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN | EC_USEFONTINFO, 0); - SendMessage(dat->hwndRenameEdit, EM_SETSEL, 0, (LPARAM)(-1)); + SendMessage(dat->hwndRenameEdit, EM_SETSEL, 0, -1); r.top = 1; r.bottom = h - 1; @@ -341,7 +341,7 @@ void cliBeginRenameSelection(HWND hwnd, ClcData *dat) //ES_MULTILINE - SendMessage(dat->hwndRenameEdit, EM_SETRECT, 0, (LPARAM)(&r)); + SendMessage(dat->hwndRenameEdit, EM_SETRECT, 0, (LPARAM)&r); CLUI_ShowWindowMod(dat->hwndRenameEdit, SW_SHOW); SetWindowPos(dat->hwndRenameEdit, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); diff --git a/plugins/Clist_nicer/src/clc.cpp b/plugins/Clist_nicer/src/clc.cpp index 3900e1770b..0316c8170c 100644 --- a/plugins/Clist_nicer/src/clc.cpp +++ b/plugins/Clist_nicer/src/clc.cpp @@ -377,7 +377,7 @@ LBL_Def: } dat->needsResort = TRUE; PostMessage(hwnd, INTM_SORTCLC, 0, recalcScrollBar); - PostMessage(hwnd, INTM_INVALIDATE, 0, (LPARAM)(contactRemoved ? 0 : wParam)); + PostMessage(hwnd, INTM_INVALIDATE, 0, contactRemoved ? 0 : wParam); if (recalcScrollBar) pcli->pfnRecalcScrollBar(hwnd, dat); } @@ -479,7 +479,7 @@ LBL_Def: szProto = contact->proto; } GetCachedStatusMsg(p, szProto); - PostMessage(hwnd, INTM_INVALIDATE, 0, (LPARAM)(contact ? contact->hContact : 0)); + PostMessage(hwnd, INTM_INVALIDATE, 0, contact ? contact->hContact : 0); } goto LBL_Def; @@ -591,7 +591,7 @@ LBL_Def: } GetCachedStatusMsg(p, szProto); - PostMessage(hwnd, INTM_INVALIDATE, 0, (LPARAM)(contact ? contact->hContact : 0)); + PostMessage(hwnd, INTM_INVALIDATE, 0, contact ? contact->hContact : 0); } goto LBL_Def; diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp index c066d54371..2b2fe4328b 100644 --- a/plugins/Clist_nicer/src/clui.cpp +++ b/plugins/Clist_nicer/src/clui.cpp @@ -1489,7 +1489,7 @@ skipbg: return 0; } } - else if (CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(wParam), MPCF_MAINMENU), (LPARAM)(HANDLE)NULL)) + else if (CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(wParam), MPCF_MAINMENU), NULL)) return 0; buttons_done: diff --git a/plugins/ContactsPlus/src/send.cpp b/plugins/ContactsPlus/src/send.cpp index 40c87bad81..ae074322ea 100644 --- a/plugins/ContactsPlus/src/send.cpp +++ b/plugins/ContactsPlus/src/send.cpp @@ -93,7 +93,7 @@ void TSendContactsData::ShowErrorDlg(HWND hwndDlg, char* szMsg, bool bAllowRetry ShowWindow(hwndDlg, SW_SHOWNORMAL); EnableWindow(hwndDlg, FALSE); if (!hError) { - hError = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_MSGSENDERROR), hwndDlg, ErrorDlgProc, (LPARAM)(LPTSTR)_A2T(szMsg)); + hError = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_MSGSENDERROR), hwndDlg, ErrorDlgProc, _A2T(szMsg)); if (!bAllowRetry) EnableDlgItem(hError, IDOK, FALSE); // do not allow again - fatal, could not be better } diff --git a/plugins/DbEditorPP/src/copymodule.cpp b/plugins/DbEditorPP/src/copymodule.cpp index 03630c496b..ed84119b4b 100644 --- a/plugins/DbEditorPP/src/copymodule.cpp +++ b/plugins/DbEditorPP/src/copymodule.cpp @@ -83,7 +83,7 @@ INT_PTR CALLBACK copyModDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara SendDlgItemMessageW(hwnd, IDC_CONTACTS, CB_SETITEMDATA, index, hContact); } - index = (int)SendDlgItemMessage(hwnd, IDC_CONTACTS, CB_INSERTSTRING, 0, (LPARAM)(char*)Translate("Settings")); + index = (int)SendDlgItemMessage(hwnd, IDC_CONTACTS, CB_INSERTSTRING, 0, (LPARAM)Translate("Settings")); SendDlgItemMessage(hwnd, IDC_CONTACTS, CB_SETITEMDATA, index, 0); SendDlgItemMessage(hwnd, IDC_CONTACTS, CB_SETCURSEL, index, 0); diff --git a/plugins/Db_autobackups/src/options.cpp b/plugins/Db_autobackups/src/options.cpp index 91cdbf8601..f274d346de 100644 --- a/plugins/Db_autobackups/src/options.cpp +++ b/plugins/Db_autobackups/src/options.cpp @@ -25,7 +25,7 @@ HWND CreateToolTip(HWND hwndParent, LPTSTR ptszText, LPTSTR ptszTitle) GetClientRect(hwndParent, &ti.rect); ti.rect.left = -80; - SendMessage(hwndTT, TTM_ADDTOOL, 0, (LPARAM)(LPTOOLINFO)&ti); + SendMessage(hwndTT, TTM_ADDTOOL, 0, (LPARAM)&ti); SendMessage(hwndTT, TTM_SETTITLE, 1, (LPARAM)ptszTitle); SendMessage(hwndTT, TTM_SETMAXTIPWIDTH, 0, (LPARAM)650); diff --git a/plugins/HTTPServer/src/GuiElements.cpp b/plugins/HTTPServer/src/GuiElements.cpp index b2b67837ee..ea28a2ba26 100644 --- a/plugins/HTTPServer/src/GuiElements.cpp +++ b/plugins/HTTPServer/src/GuiElements.cpp @@ -280,7 +280,7 @@ UINT_PTR CALLBACK ShareNewFileDialogHook( HWND hWndFileDlg = GetParent(hDlg); *szSelection = '/'; - CommDlg_OpenSave_GetSpec(hWndFileDlg, (LPARAM)(&szSelection[1]), _MAX_PATH); + CommDlg_OpenSave_GetSpec(hWndFileDlg, (LPARAM)&szSelection[1], _MAX_PATH); HWND hFileName = GetDlgItem(hWndFileDlg, edt1); char pszFileName[MAX_PATH]; diff --git a/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp b/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp index 07da9e4f59..cb9f69c8f3 100644 --- a/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp +++ b/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp @@ -121,7 +121,7 @@ INT_PTR CALLBACK MainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) link = (LPTSTR)mir_alloc((pENLink->chrg.cpMax - pENLink->chrg.cpMin + 2) * sizeof(TCHAR)); if (link == NULL) break; - SendDlgItemMessage(hDlg, IDC_MAIN, EM_EXSETSEL, 0, (LPARAM)(&pENLink->chrg)); + SendDlgItemMessage(hDlg, IDC_MAIN, EM_EXSETSEL, 0, (LPARAM)&pENLink->chrg); SendDlgItemMessage(hDlg, IDC_MAIN, EM_GETSELTEXT, 0, (LPARAM)link); if (_tcsstr(link, _T("mailto:")) != NULL) { ShellExecute(HWND_TOP, NULL, link, NULL, NULL, SW_SHOWNORMAL); @@ -150,7 +150,7 @@ INT_PTR CALLBACK MainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) link = (LPTSTR)mir_alloc((pENLink->chrg.cpMax - pENLink->chrg.cpMin + 2) * sizeof(TCHAR)); if (link == NULL) break; - SendDlgItemMessage(hDlg, IDC_MAIN, EM_EXSETSEL, 0, (LPARAM)(&(pENLink->chrg))); + SendDlgItemMessage(hDlg, IDC_MAIN, EM_EXSETSEL, 0, (LPARAM)&pENLink->chrg); SendDlgItemMessage(hDlg, IDC_MAIN, EM_GETSELTEXT, 0, (LPARAM)link); pt.x = (short)LOWORD(pENLink->lParam); diff --git a/plugins/HistoryLinkListPlus/src/linklist_fct.cpp b/plugins/HistoryLinkListPlus/src/linklist_fct.cpp index fb095b5346..67a1a47e7f 100644 --- a/plugins/HistoryLinkListPlus/src/linklist_fct.cpp +++ b/plugins/HistoryLinkListPlus/src/linklist_fct.cpp @@ -279,7 +279,7 @@ void WriteLinkList(HWND hDlg, BYTE params, LISTELEMENT *listStart, LPCTSTR searc if ( GetDlgItem(hDlg, IDC_MAIN) && GetDlgItem(hDlg, IDC_MESSAGE)) { - SendDlgItemMessage( hDlg, IDC_MAIN, EM_SETEVENTMASK, 0, (LPARAM)(ENM_LINK)); + SendDlgItemMessage( hDlg, IDC_MAIN, EM_SETEVENTMASK, 0, (LPARAM)ENM_LINK); SendDlgItemMessage( hDlg, IDC_MAIN, EM_AUTOURLDETECT, TRUE, 0 ); SendDlgItemMessage( hDlg, IDC_MAIN, EM_SETBKGNDCOLOR, FALSE, colourSet.background); @@ -524,7 +524,7 @@ int WriteOptionExample(HWND hDlg, DWORD InColourSel, DWORD OutColourSel, DWORD B pf.dwMask = PFM_ALIGNMENT; pf.wAlignment = PFA_LEFT; SendDlgItemMessage(hDlg, IDC_OPTIONS_RE, EM_SETPARAFORMAT, FALSE, (LPARAM)&pf); - SendDlgItemMessage(hDlg, IDC_OPTIONS_RE, EM_SETEVENTMASK, 0, (LPARAM)(ENM_LINK)); + SendDlgItemMessage(hDlg, IDC_OPTIONS_RE, EM_SETEVENTMASK, 0, (LPARAM)ENM_LINK); SendDlgItemMessage(hDlg, IDC_OPTIONS_RE, EM_AUTOURLDETECT, TRUE, 0); SendDlgItemMessage(hDlg, IDC_OPTIONS_RE, EM_SETBKGNDCOLOR, FALSE, BGColourSel); SetDlgItemText(hDlg, IDC_OPTIONS_RE, NULL); diff --git a/plugins/IgnoreState/src/options.cpp b/plugins/IgnoreState/src/options.cpp index bf8d5032ef..c22e2df46c 100644 --- a/plugins/IgnoreState/src/options.cpp +++ b/plugins/IgnoreState/src/options.cpp @@ -47,7 +47,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP tvis.hParent = NULL; tvis.hInsertAfter = TVI_LAST; tvis.item.mask = TVIF_PARAM | TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_STATE; - tvis.item.lParam = (LPARAM)(ii[i].type); + tvis.item.lParam = ii[i].type; tvis.item.pszText = TranslateTS(ii[i].name); tvis.item.iImage = tvis.item.iSelectedImage = index; HTREEITEM hti = TreeView_InsertItem(hTree, &tvis); diff --git a/plugins/KeyboardNotify/src/options.cpp b/plugins/KeyboardNotify/src/options.cpp index b21f7f8a3b..bacf145aa4 100644 --- a/plugins/KeyboardNotify/src/options.cpp +++ b/plugins/KeyboardNotify/src/options.cpp @@ -562,7 +562,7 @@ INT_PTR CALLBACK DlgProcEffectOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPA CheckDlgButton(hwndDlg, IDC_INTURN, bFlashEffect == FLASH_INTURN ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwndDlg, IDC_INSEQUENCE, bFlashEffect == FLASH_INSEQUENCE ? BST_CHECKED : BST_UNCHECKED); for (i=0; i < 3; i++) { - int index = SendDlgItemMessage(hwndDlg, IDC_SEQORDER, CB_INSERTSTRING, (WPARAM)-1, (LPARAM)(OrderName[i])); + int index = SendDlgItemMessage(hwndDlg, IDC_SEQORDER, CB_INSERTSTRING, -1, (LPARAM)OrderName[i]); if (index != CB_ERR && index != CB_ERRSPACE) SendDlgItemMessage(hwndDlg, IDC_SEQORDER, CB_SETITEMDATA, (WPARAM)index, (LPARAM)i); } diff --git a/plugins/LotusNotify/src/LotusNotify.cpp b/plugins/LotusNotify/src/LotusNotify.cpp index 177730bb9a..4faf246e76 100644 --- a/plugins/LotusNotify/src/LotusNotify.cpp +++ b/plugins/LotusNotify/src/LotusNotify.cpp @@ -1072,10 +1072,7 @@ INT_PTR CALLBACK DlgProcLotusNotifyOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L EnableWindow(GetDlgItem(hwndDlg, IDC_BGCOLOR), settingSetColours!=0); EnableWindow(GetDlgItem(hwndDlg, IDC_FGCOLOR), settingSetColours!=0); - - //SendDlgItemMessage(hwndDlg, IDC_SERVER, CB_SELECTSTRING ,-1,(LPARAM)(LPCSTR)settingServer); - - // initialise and fill listbox + // initialise and fill listbox hwndList = GetDlgItem(hwndDlg, IDC_STATUS); ListView_DeleteAllItems(hwndList); diff --git a/plugins/MirandaG15/src/CConfig.cpp b/plugins/MirandaG15/src/CConfig.cpp index 6309483209..64892272e5 100644 --- a/plugins/MirandaG15/src/CConfig.cpp +++ b/plugins/MirandaG15/src/CConfig.cpp @@ -939,7 +939,7 @@ void CConfig::FillTree(HWND hTree,bool bCList) vector::iterator iter = m_ProtoList.begin(); while(iter != m_ProtoList.end()) { - tvis.item.lParam=(LPARAM)(*iter); + tvis.item.lParam = (LPARAM)(*iter); tvis.item.pszText= (LPTSTR)(*iter)->strName.c_str(); if(!bCList) { diff --git a/plugins/MyDetails/src/frame.cpp b/plugins/MyDetails/src/frame.cpp index b7718e5048..29284ae3f9 100644 --- a/plugins/MyDetails/src/frame.cpp +++ b/plugins/MyDetails/src/frame.cpp @@ -542,8 +542,8 @@ HWND CreateTooltip(HWND hwnd, RECT &rect) ti.rect.bottom = rect.bottom; /* SEND AN ADDTOOL MESSAGE TO THE TOOLTIP CONTROL WINDOW */ - SendMessage(hwndTT, TTM_ADDTOOL, 0, (LPARAM)(LPTOOLINFO)&ti); - SendMessage(hwndTT, TTM_SETDELAYTIME, (WPARAM)(DWORD)TTDT_AUTOPOP, (LPARAM)MAKELONG(24 * 60 * 60 * 1000, 0)); + SendMessage(hwndTT, TTM_ADDTOOL, 0, (LPARAM)&ti); + SendMessage(hwndTT, TTM_SETDELAYTIME, TTDT_AUTOPOP, MAKELONG(24 * 60 * 60 * 1000, 0)); return hwndTT; } @@ -971,8 +971,8 @@ void CalcRectangles(HWND hwnd) else if (IsWindowVisible(hwnd)) { int flags = CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS, MAKEWPARAM(FO_FLAGS, frame_id), 0); if (flags & F_VISIBLE) { - CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS, MAKEWPARAM(FO_HEIGHT, frame_id), (LPARAM)(size)); - CallService(MS_CLIST_FRAMES_UPDATEFRAME, (WPARAM)frame_id, (LPARAM)(FU_TBREDRAW | FU_FMREDRAW | FU_FMPOS)); + CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS, MAKEWPARAM(FO_HEIGHT, frame_id), size); + CallService(MS_CLIST_FRAMES_UPDATEFRAME, (WPARAM)frame_id, FU_TBREDRAW | FU_FMREDRAW | FU_FMPOS); } } } diff --git a/plugins/NotesAndReminders/src/notes.cpp b/plugins/NotesAndReminders/src/notes.cpp index 9a250b56df..c01e247659 100644 --- a/plugins/NotesAndReminders/src/notes.cpp +++ b/plugins/NotesAndReminders/src/notes.cpp @@ -1463,7 +1463,7 @@ INT_PTR CALLBACK StickyNoteWndProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM l if (id >= IDM_COLORPRESET_BG && id <= IDM_COLORPRESET_BG+SIZEOF(clrPresets)) { SN->BgColor = clrPresets[id-IDM_COLORPRESET_BG].color | 0xff000000; - SendMessage(H, EM_SETBKGNDCOLOR, 0, (LPARAM)(SN->BgColor&0xffffff)); + SendMessage(H, EM_SETBKGNDCOLOR, 0, SN->BgColor & 0xffffff); RedrawWindow(SN->SNHwnd, NULL, NULL, RDW_INVALIDATE|RDW_FRAME|RDW_UPDATENOW); JustSaveNotes(); return FALSE; @@ -1502,7 +1502,7 @@ INT_PTR CALLBACK StickyNoteWndProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM l if (ChooseColor(&cc) && cc.rgbResult != orgclr) { SN->BgColor = cc.rgbResult | 0xff000000; - SendMessage(H, EM_SETBKGNDCOLOR, 0, (LPARAM)(SN->BgColor&0xffffff)); + SendMessage(H, EM_SETBKGNDCOLOR, 0, SN->BgColor&0xffffff); RedrawWindow(SN->SNHwnd, NULL, NULL, RDW_INVALIDATE|RDW_FRAME|RDW_UPDATENOW); JustSaveNotes(); } diff --git a/plugins/NotesAndReminders/src/reminders.cpp b/plugins/NotesAndReminders/src/reminders.cpp index 49a8530db7..719c25afec 100644 --- a/plugins/NotesAndReminders/src/reminders.cpp +++ b/plugins/NotesAndReminders/src/reminders.cpp @@ -1150,7 +1150,7 @@ static void PopulateTimeCombo(HWND Dialog, UINT nIDTime, BOOL bRelative, const S else mir_snprintf(s, SIZEOF(s), "%02d:%02d (%d.%d %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, dt/60, ((dt%60)*10)/60, lpszHours); n = SendDlgItemMessage(Dialog,nIDTime,CB_ADDSTRING,0,(LPARAM)s); - SendDlgItemMessage(Dialog,nIDTime,CB_SETITEMDATA,n, (LPARAM)(dt*60)); + SendDlgItemMessage(Dialog,nIDTime,CB_SETITEMDATA,n, dt*60); li.QuadPart += (ULONGLONG)30 * MinutesToFileTime; } @@ -1181,39 +1181,39 @@ static void PopulateTimeOffsetCombo(HWND Dialog, UINT nIDCombo) { mir_snprintf(s, SIZEOF(s), "%d %s", i*5, lpszMinutes); n = SendDlgItemMessage(Dialog,nIDCombo,CB_ADDSTRING,0,(LPARAM)s); - SendDlgItemMessage(Dialog,nIDCombo,CB_SETITEMDATA,n, (LPARAM)(i*5)); + SendDlgItemMessage(Dialog,nIDCombo,CB_SETITEMDATA,n, i*5); } // 1 hour mir_snprintf(s, SIZEOF(s), "1 %s", lpszHour); n = SendDlgItemMessage(Dialog,nIDCombo,CB_ADDSTRING,0,(LPARAM)s); - SendDlgItemMessage(Dialog,nIDCombo,CB_SETITEMDATA,n, (LPARAM)60); + SendDlgItemMessage(Dialog,nIDCombo,CB_SETITEMDATA, n, 60); // 2, 4, 8 hours for (i = 2; i <= 8; i+=2) { mir_snprintf(s, SIZEOF(s), "%d %s", i, lpszHours); n = SendDlgItemMessage(Dialog,nIDCombo,CB_ADDSTRING,0,(LPARAM)s); - SendDlgItemMessage(Dialog,nIDCombo,CB_SETITEMDATA,n, (LPARAM)(i*60)); + SendDlgItemMessage(Dialog,nIDCombo,CB_SETITEMDATA, n, i*60); } // 1 day mir_snprintf(s, SIZEOF(s), "1 %s", lpszDay); n = SendDlgItemMessage(Dialog,nIDCombo,CB_ADDSTRING,0,(LPARAM)s); - SendDlgItemMessage(Dialog,nIDCombo,CB_SETITEMDATA,n, (LPARAM)(24*60)); + SendDlgItemMessage(Dialog,nIDCombo,CB_SETITEMDATA, n, 24*60); // 2-4 days for (i = 2; i <= 4; i++) { mir_snprintf(s, SIZEOF(s), "%d %s", i, lpszDays); n = SendDlgItemMessage(Dialog,nIDCombo,CB_ADDSTRING,0,(LPARAM)s); - SendDlgItemMessage(Dialog,nIDCombo,CB_SETITEMDATA,n, (LPARAM)(i*24*60)); + SendDlgItemMessage(Dialog,nIDCombo,CB_SETITEMDATA, n, i*24*60); } // 1 week mir_snprintf(s, SIZEOF(s), "1 %s", lpszWeek); n = SendDlgItemMessage(Dialog,nIDCombo,CB_ADDSTRING,0,(LPARAM)s); - SendDlgItemMessage(Dialog,nIDCombo,CB_SETITEMDATA,n, (LPARAM)(7*24*60)); + SendDlgItemMessage(Dialog,nIDCombo,CB_SETITEMDATA, n, 7*24*60); } // returns non-zero if specified time was inside "missing" hour of daylight saving diff --git a/plugins/PasteIt/src/PasteIt.cpp b/plugins/PasteIt/src/PasteIt.cpp index 50a7f6f006..64d458b51b 100644 --- a/plugins/PasteIt/src/PasteIt.cpp +++ b/plugins/PasteIt/src/PasteIt.cpp @@ -164,7 +164,7 @@ void PasteIt(MCONTACT hContact, int mode) gce.dwFlags = GCEF_ADDTOLOG; gce.ptszText = mir_a2u_cp(pasteToWeb->szFileLink, CP_ACP); gce.time = time(NULL); - CallService(MS_GC_EVENT, 0, (LPARAM)(GCEVENT *)&gce); + CallService(MS_GC_EVENT, 0, (LPARAM)&gce); mir_free((void*)gce.ptszText); break; } diff --git a/plugins/Popup/src/common.h b/plugins/Popup/src/common.h index 819d9fabe0..df079a3c9d 100644 --- a/plugins/Popup/src/common.h +++ b/plugins/Popup/src/common.h @@ -82,13 +82,12 @@ inline INT_PTR DBGetContactSettingStringX(MCONTACT hContact, const char *ModuleN inline void AddTooltipTranslated(HWND hwndToolTip, HWND hwnd, int id, RECT rc, char *text) { - TOOLINFO ti = { 0 }; ti.cbSize = sizeof(TOOLINFO); ti.hwnd = hwnd; ti.uId = id; - SendMessage(hwndToolTip, TTM_DELTOOL, 0, (LPARAM)(LPTOOLINFO)&ti); + SendMessage(hwndToolTip, TTM_DELTOOL, 0, (LPARAM)&ti); LPTSTR wtext = mir_a2t(text); @@ -98,7 +97,7 @@ inline void AddTooltipTranslated(HWND hwndToolTip, HWND hwnd, int id, RECT rc, c ti.hinst = hInst; ti.lpszText = TranslateTS(wtext); ti.rect = rc; - SendMessage(hwndToolTip, TTM_ADDTOOL, 0, (LPARAM)(LPTOOLINFO)&ti); + SendMessage(hwndToolTip, TTM_ADDTOOL, 0, (LPARAM)&ti); mir_free(wtext); diff --git a/plugins/Popup/src/services.cpp b/plugins/Popup/src/services.cpp index c89388e586..1d54e21027 100644 --- a/plugins/Popup/src/services.cpp +++ b/plugins/Popup/src/services.cpp @@ -263,7 +263,7 @@ INT_PTR Popup_ShowMessageW(WPARAM wParam, LPARAM lParam) default: // No no no... you must give me a good value. return -1; } - return Popup_AddPopup2((WPARAM)&ppd2, (LPARAM)((lParam & 0x80000000) ? APF_NO_HISTORY : 0)); + return Popup_AddPopup2((WPARAM)&ppd2, (lParam & 0x80000000) ? APF_NO_HISTORY : 0); } INT_PTR Popup_ShowMessage(WPARAM wParam, LPARAM lParam) diff --git a/plugins/RecentContacts/src/RecentContacts.cpp b/plugins/RecentContacts/src/RecentContacts.cpp index d67dd92a36..a0251e344c 100644 --- a/plugins/RecentContacts/src/RecentContacts.cpp +++ b/plugins/RecentContacts/src/RecentContacts.cpp @@ -303,7 +303,7 @@ INT_PTR CALLBACK ShowListMainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM pos.szModule = dbLastUC_ModuleName; pos.szNamePrefix = dbLastUC_WindowPosPrefix; - CallService(MS_UTILS_RESTOREWINDOWPOSITION, 0, (LPARAM)(SAVEWINDOWPOS*)&pos); + CallService(MS_UTILS_RESTOREWINDOWPOSITION, 0, (LPARAM)&pos); } SendMessage(hDlg, WM_SIZE, 0, 0); @@ -392,7 +392,7 @@ INT_PTR CALLBACK ShowListMainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM pos.hwnd = hDlg; pos.szModule = dbLastUC_ModuleName; pos.szNamePrefix = dbLastUC_WindowPosPrefix; - CallService(MS_UTILS_SAVEWINDOWPOSITION, 0, (LPARAM)(SAVEWINDOWPOS*)&pos); + CallService(MS_UTILS_SAVEWINDOWPOSITION, 0, (LPARAM)&pos); delete DlgDat->Contacts; delete DlgDat; // Remove entry from Window list diff --git a/plugins/Scriver/src/utils.cpp b/plugins/Scriver/src/utils.cpp index 6d7ae724fe..9b292f7a20 100644 --- a/plugins/Scriver/src/utils.cpp +++ b/plugins/Scriver/src/utils.cpp @@ -455,7 +455,7 @@ HWND CreateToolTip(HWND hwndParent, LPTSTR ptszText, LPTSTR ptszTitle, RECT* rec ti.hinst = g_hInst; ti.lpszText = ptszText; ti.rect = *rect; - SendMessage(hwndTT, TTM_ADDTOOL, 0, (LPARAM)(LPTOOLINFO)&ti); + SendMessage(hwndTT, TTM_ADDTOOL, 0, (LPARAM)&ti); SendMessage(hwndTT, TTM_SETTITLE, TTI_NONE, (LPARAM)ptszTitle); return hwndTT; } @@ -466,7 +466,7 @@ void SetToolTipText(HWND hwndParent, HWND hwndTT, LPTSTR ptszText, LPTSTR ptszTi ti.hinst = g_hInst; ti.hwnd = hwndParent; ti.lpszText = ptszText; - SendMessage(hwndTT, TTM_UPDATETIPTEXT, 0, (LPARAM)(LPTOOLINFO)&ti); + SendMessage(hwndTT, TTM_UPDATETIPTEXT, 0, (LPARAM)&ti); SendMessage(hwndTT, TTM_SETTITLE, TTI_NONE, (LPARAM)ptszTitle); } @@ -476,7 +476,7 @@ void SetToolTipRect(HWND hwndParent, HWND hwndTT, RECT* rect) ti.hinst = g_hInst; ti.hwnd = hwndParent; ti.rect = *rect; - SendMessage(hwndTT, TTM_NEWTOOLRECT, 0, (LPARAM)(LPTOOLINFO)&ti); + SendMessage(hwndTT, TTM_NEWTOOLRECT, 0, (LPARAM)&ti); } /* toolbar-related stuff, to be moved to a separate file */ diff --git a/plugins/SecureIM/src/options.cpp b/plugins/SecureIM/src/options.cpp index 157ac96f8d..cadba31b28 100644 --- a/plugins/SecureIM/src/options.cpp +++ b/plugins/SecureIM/src/options.cpp @@ -471,7 +471,7 @@ INT_PTR CALLBACK DlgProcOptionsGeneral(HWND hDlg, UINT wMsg, WPARAM wParam, LPAR case LVN_COLUMNCLICK: bChangeSortOrder = true; - ListView_Sort(hLV, (LPARAM)(LPNMLISTVIEW(lParam)->iSubItem + 0x01)); + ListView_Sort(hLV, LPNMLISTVIEW(lParam)->iSubItem + 0x01); bChangeSortOrder = false; } break; @@ -735,7 +735,7 @@ INT_PTR CALLBACK DlgProcOptionsPGP(HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM l switch (((LPNMHDR)lParam)->code) { case LVN_COLUMNCLICK: bChangeSortOrder = true; - ListView_Sort(hLV, (LPARAM)(LPNMLISTVIEW(lParam)->iSubItem + 0x11)); + ListView_Sort(hLV, LPNMLISTVIEW(lParam)->iSubItem + 0x11); bChangeSortOrder = false; break; } @@ -858,7 +858,7 @@ INT_PTR CALLBACK DlgProcOptionsGPG(HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM l case LVN_COLUMNCLICK: bChangeSortOrder = true; - ListView_Sort(hLV, (LPARAM)(LPNMLISTVIEW(lParam)->iSubItem + 0x21)); + ListView_Sort(hLV, LPNMLISTVIEW(lParam)->iSubItem + 0x21); bChangeSortOrder = false; } } diff --git a/plugins/SecureIM/src/svcs_proto.cpp b/plugins/SecureIM/src/svcs_proto.cpp index e1b9d45e13..13a3ee9445 100644 --- a/plugins/SecureIM/src/svcs_proto.cpp +++ b/plugins/SecureIM/src/svcs_proto.cpp @@ -234,7 +234,7 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) CallService(MS_PROTO_CHAINSEND, wParam, lParam); // send back cipher message ptrA keyToSend(InitKeyA(ptr, 0)); // calculate public and private key - pccsd->lParam = (LPARAM)(char*)keyToSend; + pccsd->lParam = keyToSend; CallService(MS_PROTO_CHAINSEND, wParam, lParam); // send new key showPopup(sim005, NULL, g_hPOP[POP_PU_DIS], 0); @@ -394,7 +394,7 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) Sent_NetLog("onRecvMsg: Sending KEYB %s", keyToSend); pccsd->wParam |= PREF_METANODB; - pccsd->lParam = (LPARAM)keyToSend; + pccsd->lParam = keyToSend; pccsd->szProtoService = PSS_MESSAGE; CallService(MS_PROTO_CHAINSEND, wParam, lParam); } @@ -450,7 +450,7 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) // SendMsg handler INT_PTR __cdecl onSendMsg(WPARAM wParam, LPARAM lParam) { - CCSDATA *pccsd = (CCSDATA *)lParam; + CCSDATA *pccsd = (CCSDATA*)lParam; pUinKey ptr = getUinKey(pccsd->hContact); int ssig = getSecureSig((LPCSTR)pccsd->lParam); int stat = getContactStatus(pccsd->hContact); @@ -713,7 +713,7 @@ INT_PTR __cdecl onSendMsg(WPARAM wParam, LPARAM lParam) Sent_NetLog("onSend: encrypted msg '%s'", szNewMsg); pccsd->wParam |= PREF_METANODB; - pccsd->lParam = (LPARAM)(char*)szNewMsg; + pccsd->lParam = szNewMsg; pccsd->szProtoService = PSS_MESSAGE; int ret = CallService(MS_PROTO_CHAINSEND, wParam, lParam); diff --git a/plugins/Sessions/Src/Utils.cpp b/plugins/Sessions/Src/Utils.cpp index 87afd484ab..d0bb1134ea 100644 --- a/plugins/Sessions/Src/Utils.cpp +++ b/plugins/Sessions/Src/Utils.cpp @@ -302,11 +302,11 @@ int LoadSessionToCombobox(HWND hdlg, BOOL mode, int iLimit, char* pszSetting, in if (pszBuffer) { if (!IsMarkedUserDefSession(i + iFirstNum) || mode == 1) { index = SendDlgItemMessage(hdlg, IDC_LIST, CB_ADDSTRING, 0, (LPARAM)pszBuffer); - SendDlgItemMessage(hdlg, IDC_LIST, CB_SETITEMDATA, (WPARAM)index, (LPARAM)(i + iFirstNum)); + SendDlgItemMessage(hdlg, IDC_LIST, CB_SETITEMDATA, (WPARAM)index, i + iFirstNum); } else { SendDlgItemMessage(hdlg, IDC_LIST, CB_INSERTSTRING, 0, (LPARAM)pszBuffer); - SendDlgItemMessage(hdlg, IDC_LIST, CB_SETITEMDATA, 0, (LPARAM)(i + iFirstNum)); + SendDlgItemMessage(hdlg, IDC_LIST, CB_SETITEMDATA, 0, i + iFirstNum); } mir_free(pszBuffer); } diff --git a/plugins/ShellExt/src/shlcom.cpp b/plugins/ShellExt/src/shlcom.cpp index a4442d1460..498fc55d61 100644 --- a/plugins/ShellExt/src/shlcom.cpp +++ b/plugins/ShellExt/src/shlcom.cpp @@ -183,7 +183,7 @@ struct TSlotInfo int __cdecl SortContact(const void *Item1, const void *Item2) { - return CallService(MS_CLIST_CONTACTSCOMPARE, (WPARAM)((TSlotInfo*)Item1)->hContact, (LPARAM)((TSlotInfo*)Item2)->hContact); + return CallService(MS_CLIST_CONTACTSCOMPARE, ((TSlotInfo*)Item1)->hContact, ((TSlotInfo*)Item2)->hContact); } void ipcGetSkinIcons(THeaderIPC *ipch) diff --git a/plugins/SimpleStatusMsg/src/msgbox.cpp b/plugins/SimpleStatusMsg/src/msgbox.cpp index a601350247..87bac02d81 100644 --- a/plugins/SimpleStatusMsg/src/msgbox.cpp +++ b/plugins/SimpleStatusMsg/src/msgbox.cpp @@ -538,9 +538,9 @@ static LRESULT CALLBACK EditBoxSubProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L DWORD start, end; TCHAR *text; int textLen; - SendMessage(hwndDlg, EM_GETSEL, (WPARAM)&end, (LPARAM)(PDWORD)NULL); + SendMessage(hwndDlg, EM_GETSEL, (WPARAM)&end, NULL); SendMessage(hwndDlg, WM_KEYDOWN, VK_LEFT, 0); - SendMessage(hwndDlg, EM_GETSEL, (WPARAM)&start, (LPARAM)(PDWORD)NULL); + SendMessage(hwndDlg, EM_GETSEL, (WPARAM)&start, NULL); textLen = GetWindowTextLength(hwndDlg); text = (TCHAR *)mir_alloc(sizeof(TCHAR) * (textLen + 1)); GetWindowText(hwndDlg, text, textLen + 1); diff --git a/plugins/SimpleStatusMsg/src/options.cpp b/plugins/SimpleStatusMsg/src/options.cpp index deb034e440..99ca669461 100644 --- a/plugins/SimpleStatusMsg/src/options.cpp +++ b/plugins/SimpleStatusMsg/src/options.cpp @@ -63,9 +63,9 @@ static LRESULT CALLBACK OptEditBoxSubProc(HWND hwndDlg, UINT uMsg, WPARAM wParam DWORD start, end; TCHAR *text; int textLen; - SendMessage(hwndDlg, EM_GETSEL, (WPARAM)&end, (LPARAM)(PDWORD)NULL); + SendMessage(hwndDlg, EM_GETSEL, (WPARAM)&end, NULL); SendMessage(hwndDlg, WM_KEYDOWN, VK_LEFT, 0); - SendMessage(hwndDlg, EM_GETSEL, (WPARAM)&start, (LPARAM)(PDWORD)NULL); + SendMessage(hwndDlg, EM_GETSEL, (WPARAM)&start, NULL); textLen = GetWindowTextLength(hwndDlg); text = (TCHAR *)mir_alloc(sizeof(TCHAR) * (textLen + 1)); GetWindowText(hwndDlg, text, textLen + 1); diff --git a/plugins/SmileyAdd/src/smileys.cpp b/plugins/SmileyAdd/src/smileys.cpp index 70004c2454..559e0baa6a 100644 --- a/plugins/SmileyAdd/src/smileys.cpp +++ b/plugins/SmileyAdd/src/smileys.cpp @@ -474,7 +474,7 @@ bool SmileyPackType::LoadSmileyFileMSL(CMString& tbuf, bool onlyInfo, CMString& static const TCHAR errmsg[] = LPGENT("Smiley #%u in file %s for smiley pack %s not found."); TCHAR msgtxt[1024]; mir_sntprintf(msgtxt, SIZEOF(msgtxt), TranslateTS(errmsg), smnum, resname.c_str(), modpath.c_str()); - CallService(MS_NETLIB_LOG,(WPARAM) hNetlibUser, (LPARAM)(char*)T2A_SM(msgtxt)); + CallService(MS_NETLIB_LOG, (WPARAM)hNetlibUser, _T2A(msgtxt)); errorFound = true; } smnum++; @@ -1045,7 +1045,7 @@ SmileyLookup::SmileyLookup(const CMString& str, const bool regexs, const int ind } if (!m_valid) - CallService(MS_NETLIB_LOG, (WPARAM)hNetlibUser, (LPARAM)(char*)T2A_SM(msgtxt)); + CallService(MS_NETLIB_LOG, (WPARAM)hNetlibUser, _T2A(msgtxt)); } else { m_text = str; diff --git a/plugins/StatusChange/src/main.cpp b/plugins/StatusChange/src/main.cpp index 55d017c908..eab4b1bdf2 100644 --- a/plugins/StatusChange/src/main.cpp +++ b/plugins/StatusChange/src/main.cpp @@ -95,7 +95,7 @@ static int StatusChangeGetMessage(WPARAM wParam, LPARAM hDbEvent) if (((DWORD)(dbe.flags & ((DWORD)DBEF_SENT))) == ((DWORD)(DBEF_SENT))) { if (send) { // change status - CallProtoService(dbe.szModule, PS_SETSTATUS, (LPARAM)(Options.ChangeTo), 0); + CallProtoService(dbe.szModule, PS_SETSTATUS, (LPARAM)Options.ChangeTo, 0); } } @@ -103,7 +103,7 @@ static int StatusChangeGetMessage(WPARAM wParam, LPARAM hDbEvent) else { if (read) { // change status - CallProtoService(dbe.szModule, PS_SETSTATUS, (LPARAM)(Options.ChangeTo), 0); + CallProtoService(dbe.szModule, PS_SETSTATUS, (LPARAM)Options.ChangeTo, 0); } } diff --git a/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp b/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp index 761c3913f3..c96098bc38 100644 --- a/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp +++ b/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp @@ -231,7 +231,7 @@ static int changeState(TAAAProtoSetting &setting, STATES newState) log_debugA("%s state change: %s -> %s", setting.szName, status2descr(setting.oldState), status2descr(setting.curState)); - NotifyEventHooks(hStateChangedEvent, 0, (LPARAM)(AUTOAWAYSETTING*)&setting); + NotifyEventHooks(hStateChangedEvent, 0, (LPARAM)&setting); if (setting.curState != SET_ORGSTATUS && setting.curState != ACTIVE && setting.statusChanged) { /* change the awaymessage */ if (setting.szMsg != NULL) { diff --git a/plugins/TabSRMM/src/chat/options.cpp b/plugins/TabSRMM/src/chat/options.cpp index 5becbc5910..4c28234aa7 100644 --- a/plugins/TabSRMM/src/chat/options.cpp +++ b/plugins/TabSRMM/src/chat/options.cpp @@ -384,7 +384,7 @@ HWND CreateToolTip(HWND hwndParent, LPTSTR ptszText, LPTSTR ptszTitle) GetClientRect(hwndParent, &ti.rect); ti.rect.left = -65; - SendMessage(hwndTT, TTM_ADDTOOL, 0, (LPARAM)(LPTOOLINFO)&ti); + SendMessage(hwndTT, TTM_ADDTOOL, 0, (LPARAM)&ti); SendMessage(hwndTT, TTM_SETTITLE, 1, (LPARAM)ptszTitle); SendMessage(hwndTT, TTM_SETMAXTIPWIDTH, 0, (LPARAM)640); return hwndTT; diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp index 7536ab5c76..9bd323e24e 100644 --- a/plugins/TabSRMM/src/generic_msghandlers.cpp +++ b/plugins/TabSRMM/src/generic_msghandlers.cpp @@ -146,7 +146,7 @@ void TSAPI DM_InitTip(TWindowData *dat) LRESULT TSAPI DM_GenericHotkeysCheck(MSG *message, TWindowData *dat) { - LRESULT mim_hotkey_check = CallService(MS_HOTKEY_CHECK, (WPARAM)message, (LPARAM)(TABSRMM_HK_SECTION_GENERIC)); + LRESULT mim_hotkey_check = CallService(MS_HOTKEY_CHECK, (WPARAM)message, (LPARAM)TABSRMM_HK_SECTION_GENERIC); HWND hwndDlg = dat->hwnd; switch (mim_hotkey_check) { diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index 6472b31a61..a91e8b592d 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -1673,7 +1673,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP } if ((msg == WM_KEYDOWN || msg == WM_SYSKEYDOWN) && !(GetKeyState(VK_RMENU) & 0x8000)) { - LRESULT mim_hotkey_check = CallService(MS_HOTKEY_CHECK, (WPARAM)&message, (LPARAM)(TABSRMM_HK_SECTION_IM)); + LRESULT mim_hotkey_check = CallService(MS_HOTKEY_CHECK, (WPARAM)&message, (LPARAM)TABSRMM_HK_SECTION_IM); if (mim_hotkey_check) dat->fkeyProcessed = true; diff --git a/plugins/TipperYM/src/bitmap_func.cpp b/plugins/TipperYM/src/bitmap_func.cpp index d664f7420a..d6ac2631f2 100644 --- a/plugins/TipperYM/src/bitmap_func.cpp +++ b/plugins/TipperYM/src/bitmap_func.cpp @@ -154,7 +154,7 @@ void CreateFromBitmaps(bool bServiceTip) if (tszFileName && *tszFileName != 0) { FIBITMAP *fib = NULL; if (!skin.bCached) { - FIBITMAP *fibLoad = (FIBITMAP *)CallService(MS_IMG_LOAD, (WPARAM)tszFileName, (LPARAM)(IMGL_TCHAR | IMGL_RETURNDIB)); + FIBITMAP *fibLoad = (FIBITMAP *)CallService(MS_IMG_LOAD, (WPARAM)tszFileName, IMGL_TCHAR | IMGL_RETURNDIB); if (!fibLoad) continue; if (fii->FI_GetBPP(fibLoad) != 32) diff --git a/plugins/WinterSpeak/src/DialogConfigEngine.cpp b/plugins/WinterSpeak/src/DialogConfigEngine.cpp index 1350b4d90e..07a3018118 100644 --- a/plugins/WinterSpeak/src/DialogConfigEngine.cpp +++ b/plugins/WinterSpeak/src/DialogConfigEngine.cpp @@ -109,7 +109,7 @@ void DialogConfigEngine::load(HWND window) std::vector engines = si.getAvailableEngines(); for (unsigned int i = 0; i < engines.size(); ++i) { - SendDlgItemMessage(window, IDC_SELECT_ENGINE, CB_ADDSTRING, 0, (LPARAM)(engines[i].c_str())); + SendDlgItemMessage(window, IDC_SELECT_ENGINE, CB_ADDSTRING, 0, (LPARAM)engines[i].c_str()); } VoiceDesc desc = m_db.getVoiceDesc(); diff --git a/protocols/JabberG/src/jabber_adhoc.cpp b/protocols/JabberG/src/jabber_adhoc.cpp index 378c610910..37160b7ad7 100644 --- a/protocols/JabberG/src/jabber_adhoc.cpp +++ b/protocols/JabberG/src/jabber_adhoc.cpp @@ -551,7 +551,7 @@ int __cdecl CJabberProto::ContactMenuRunCommands(WPARAM hContact, LPARAM lParam) if (item == NULL || selected) { CJabberAdhocStartupParams* pStartupParams = new CJabberAdhocStartupParams(this, jid, NULL); - CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_FORM), NULL, JabberAdHoc_CommandDlgProc, (LPARAM)(pStartupParams)); + CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_FORM), NULL, JabberAdHoc_CommandDlgProc, (LPARAM)pStartupParams); } } else if (lParam != 0) diff --git a/protocols/JabberG/src/jabber_iqid_muc.cpp b/protocols/JabberG/src/jabber_iqid_muc.cpp index 8beb71694a..fde613418b 100644 --- a/protocols/JabberG/src/jabber_iqid_muc.cpp +++ b/protocols/JabberG/src/jabber_iqid_muc.cpp @@ -89,11 +89,9 @@ static void sttFillJidList(HWND hwndDlg) lvi.iSubItem = 0; for (int i=0; inmcd.hdr.hwndFrom, nm->nmcd.dwItemSpec, nm->iSubItem, LVIR_LABEL, &rc); if (nm->iSubItem == 1) { HICON hIcon; - if (nm->nmcd.lItemlParam == (LPARAM)(-1)) + if (nm->nmcd.lItemlParam == -1) hIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_ADDCONTACT), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0); else hIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_DELETE), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0); @@ -335,7 +333,7 @@ static INT_PTR CALLBACK JabberMucJidListDlgProc(HWND hwndDlg, UINT msg, WPARAM w lvi.pszText = text; lvi.cchTextMax = SIZEOF(text); ListView_GetItem(nm->hdr.hwndFrom, &lvi); - if (lvi.lParam == (LPARAM)(-1)) { + if (lvi.lParam == -1) { CMString szBuffer(dat->type2str()); if (!dat->ppro->EnterString(szBuffer, NULL, ESF_COMBO, "gcAddNick_")) break; @@ -397,7 +395,7 @@ static INT_PTR CALLBACK JabberMucJidListDlgProc(HWND hwndDlg, UINT msg, WPARAM w for (int i=0; inmcd.hdr.hwndFrom, nm->nmcd.dwItemSpec, nm->iSubItem, LVIR_LABEL, &rc); - if (nm->nmcd.lItemlParam == (LPARAM)(-1) && nm->iSubItem == 3) + if (nm->nmcd.lItemlParam == -1 && nm->iSubItem == 3) hIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_ADDCONTACT), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0); - else if (nm->iSubItem == 2 && nm->nmcd.lItemlParam != (LPARAM)(-1)) + else if (nm->iSubItem == 2 && nm->nmcd.lItemlParam != -1) hIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_EDIT), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0); - else if (nm->iSubItem == 3 && nm->nmcd.lItemlParam != (LPARAM)(-1)) + else if (nm->iSubItem == 3 && nm->nmcd.lItemlParam != -1) hIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_DELETE), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0); else break; DrawIconEx(nm->nmcd.hdc, (rc.left + rc.right - GetSystemMetrics(SM_CXSMICON)) / 2, (rc.top + rc.bottom - GetSystemMetrics(SM_CYSMICON)) / 2, hIcon, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0, NULL, DI_NORMAL); @@ -839,7 +839,7 @@ static INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM, LPARAM lP lvi.iItem = hti.iItem; lvi.iSubItem = 0; ListView_GetItem(nm->hdr.hwndFrom, &lvi); - if (lvi.lParam == (LPARAM)(-1)) { + if (lvi.lParam == -1) { if (hti.iSubItem == 3) { //add EditDlgParam param = { -1, ppro }; diff --git a/protocols/Sametime/src/conference.cpp b/protocols/Sametime/src/conference.cpp index 4f3402413a..cadbea21a9 100644 --- a/protocols/Sametime/src/conference.cpp +++ b/protocols/Sametime/src/conference.cpp @@ -279,7 +279,7 @@ void mwServiceConf_on_text(mwConference* conf, mwLoginInfo* user, const char* wh gce.ptszUID = tszUserId; gce.time = (DWORD)time(0); - CallService(MS_GC_EVENT, 0, (LPARAM)(GCEVENT *) &gce); + CallService(MS_GC_EVENT, 0, (LPARAM)&gce); mir_free(textT); mir_free(tszUserName); diff --git a/protocols/Sametime/src/messaging.cpp b/protocols/Sametime/src/messaging.cpp index ce457d3611..aafffea62e 100644 --- a/protocols/Sametime/src/messaging.cpp +++ b/protocols/Sametime/src/messaging.cpp @@ -74,7 +74,7 @@ void mwIm_conversation_recv(mwConversation* conv, mwImSendType type, gconstpoint proto->debugLog(_T("mwIm_conversation_recv() type=[%d] hContact=[%x]"), type, hContact); if (type == mwImSend_TYPING) { - CallService(MS_PROTO_CONTACTISTYPING, hContact, (LPARAM)(GPOINTER_TO_UINT(msg) == 0 ? 0 : 2)); + CallService(MS_PROTO_CONTACTISTYPING, hContact, (GPOINTER_TO_UINT(msg) == 0 ? 0 : 2)); return; } diff --git a/protocols/Tlen/src/tlen_svc.cpp b/protocols/Tlen/src/tlen_svc.cpp index 005f9af3ab..915fa2d7b5 100644 --- a/protocols/Tlen/src/tlen_svc.cpp +++ b/protocols/Tlen/src/tlen_svc.cpp @@ -569,7 +569,7 @@ static void __cdecl TlenGetAwayMsgThread(void *ptr) if (item != NULL) { db_free(&dbv); ProtoBroadcastAck(data->proto->m_szModuleName, data->hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, - item->statusMessage==NULL ? (LPARAM)NULL : (LPARAM)(TCHAR*)_A2T(item->statusMessage)); + item->statusMessage == NULL ? NULL : _A2T(item->statusMessage)); } else { ptrA ownJid(db_get_sa(NULL, data->proto->m_szModuleName, "jid")); if (!mir_strcmp(ownJid, dbv.pszVal)){ diff --git a/protocols/Yahoo/src/proto.cpp b/protocols/Yahoo/src/proto.cpp index 7d935a3418..4fbc1389a8 100644 --- a/protocols/Yahoo/src/proto.cpp +++ b/protocols/Yahoo/src/proto.cpp @@ -519,7 +519,7 @@ void __cdecl CYahooProto::get_status_thread(void *param) FREE(sm); - ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)(TCHAR*)_A2T(fm)); + ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, _A2T(fm)); } HANDLE __cdecl CYahooProto::GetAwayMsg(MCONTACT hContact) diff --git a/protocols/Yahoo/src/search.cpp b/protocols/Yahoo/src/search.cpp index 2d25f978e6..e914dacec4 100644 --- a/protocols/Yahoo/src/search.cpp +++ b/protocols/Yahoo/src/search.cpp @@ -132,10 +132,10 @@ static INT_PTR CALLBACK YahooSearchAdvancedDlgProc(HWND hwndDlg, UINT msg, WPARA case WM_INITDIALOG: TranslateDialogDefault(hwndDlg); - SendDlgItemMessageA(hwndDlg, IDC_SEARCH_PROTOCOL, CB_ADDSTRING, 0, (LPARAM)(LPCSTR)"Yahoo! Messenger"); - SendDlgItemMessageA(hwndDlg, IDC_SEARCH_PROTOCOL, CB_ADDSTRING, 0, (LPARAM)(LPCSTR)"Lotus Sametime"); - SendDlgItemMessageA(hwndDlg, IDC_SEARCH_PROTOCOL, CB_ADDSTRING, 0, (LPARAM)(LPCSTR)"LCS"); - SendDlgItemMessageA(hwndDlg, IDC_SEARCH_PROTOCOL, CB_ADDSTRING, 0, (LPARAM)(LPCSTR)"Windows Live (MSN)"); + SendDlgItemMessageA(hwndDlg, IDC_SEARCH_PROTOCOL, CB_ADDSTRING, 0, (LPARAM)"Yahoo! Messenger"); + SendDlgItemMessageA(hwndDlg, IDC_SEARCH_PROTOCOL, CB_ADDSTRING, 0, (LPARAM)"Lotus Sametime"); + SendDlgItemMessageA(hwndDlg, IDC_SEARCH_PROTOCOL, CB_ADDSTRING, 0, (LPARAM)"LCS"); + SendDlgItemMessageA(hwndDlg, IDC_SEARCH_PROTOCOL, CB_ADDSTRING, 0, (LPARAM)"Windows Live (MSN)"); // select the first one SendDlgItemMessage(hwndDlg, IDC_SEARCH_PROTOCOL, CB_SETCURSEL, 0, 0); diff --git a/src/core/miranda.h b/src/core/miranda.h index 2609052789..c5008e358a 100644 --- a/src/core/miranda.h +++ b/src/core/miranda.h @@ -172,21 +172,6 @@ int AssertInsideScreen(RECT &rc); HBITMAP ConvertIconToBitmap(HICON hIcon, HIMAGELIST hIml, int iconId); -class StrConvA -{ -private: - char* m_body; - -public: - StrConvA(const wchar_t* pSrc) : - m_body(mir_u2a(pSrc)) {} - - ~StrConvA() { mir_free(m_body); } - operator const char* () const { return m_body; } - operator const wchar_t* () const { return (wchar_t*)m_body; } // type cast to fake the interface definition - operator const LPARAM () const { return (LPARAM)m_body; } -}; - /////////////////////////////////////////////////////////////////////////////// extern "C" diff --git a/src/core/stdchat/src/window.cpp b/src/core/stdchat/src/window.cpp index 3a7969746e..806fa9a128 100644 --- a/src/core/stdchat/src/window.cpp +++ b/src/core/stdchat/src/window.cpp @@ -357,11 +357,11 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, if (wParam <= '9' && wParam >= '1' && isCtrl && !isAlt) // CTRL + 1 -> 9 (switch tab) if (g_Settings.bTabsEnable) - SendMessage(GetParent(hwnd), GC_SWITCHTAB, 0, (LPARAM)((int)wParam - (int)'1')); + SendMessage(GetParent(hwnd), GC_SWITCHTAB, 0, (int)wParam - (int)'1'); if (wParam <= VK_NUMPAD9 && wParam >= VK_NUMPAD1 && isCtrl && !isAlt) // CTRL + 1 -> 9 (switch tab) if (g_Settings.bTabsEnable) - SendMessage(GetParent(hwnd), GC_SWITCHTAB, 0, (LPARAM)((int)wParam - (int)VK_NUMPAD1)); + SendMessage(GetParent(hwnd), GC_SWITCHTAB, 0, (int)wParam - (int)VK_NUMPAD1); if (wParam == VK_TAB && !isCtrl && !isShift) { //tab-autocomplete TCHAR* pszText = NULL; diff --git a/src/core/stdfile/src/filesenddlg.cpp b/src/core/stdfile/src/filesenddlg.cpp index fc410095cb..bb4128b9dd 100644 --- a/src/core/stdfile/src/filesenddlg.cpp +++ b/src/core/stdfile/src/filesenddlg.cpp @@ -141,7 +141,7 @@ void __cdecl ChooseFilesThread(void* param) TCHAR *buf = (TCHAR*)mir_alloc(sizeof(TCHAR) * 32767); if (buf == NULL) { - PostMessage(hwndDlg, M_FILECHOOSEDONE, 0, (LPARAM)(TCHAR*)NULL); + PostMessage(hwndDlg, M_FILECHOOSEDONE, 0, NULL); return; } diff --git a/src/core/stduserinfo/src/contactinfo.cpp b/src/core/stduserinfo/src/contactinfo.cpp index 1e82742ef7..301371a4ef 100644 --- a/src/core/stduserinfo/src/contactinfo.cpp +++ b/src/core/stduserinfo/src/contactinfo.cpp @@ -267,7 +267,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP LVITEM lvi; lvi.mask = LVIF_TEXT|LVIF_PARAM; - lvi.lParam = (LPARAM)(-1); + lvi.lParam = -1; lvi.iSubItem = 0; lvi.iItem = 0; for (i = -1;; i++) { @@ -303,12 +303,12 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP lvi.iItem++; } lvi.mask = LVIF_PARAM; - lvi.lParam = (LPARAM)(-2); + lvi.lParam = -2; ListView_InsertItem(GetDlgItem(hwndDlg, IDC_EMAILS), &lvi); //phones ListView_DeleteAllItems(GetDlgItem(hwndDlg, IDC_PHONES)); lvi.mask = LVIF_TEXT|LVIF_PARAM; - lvi.lParam = (LPARAM)(-1); + lvi.lParam = -1; lvi.iSubItem = 0; lvi.iItem = 0; if ( !db_get_ts(hContact, szProto, "Phone", &dbv)) { @@ -368,7 +368,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP lvi.iItem++; } lvi.mask = LVIF_PARAM; - lvi.lParam = (LPARAM)(-2); + lvi.lParam = -2; ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi); } } @@ -410,9 +410,9 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP } HICON hIcon = NULL; - if (nm->nmcd.lItemlParam == (LPARAM)(-2) && nm->iSubItem-3 == (nm->nmcd.hdr.idFrom == IDC_PHONES)) + if (nm->nmcd.lItemlParam == -2 && nm->iSubItem-3 == (nm->nmcd.hdr.idFrom == IDC_PHONES)) hIcon = LoadSkinIcon(SKINICON_OTHER_ADDCONTACT); - else if (nm->iSubItem>1 && nm->nmcd.lItemlParam != (LPARAM)(-1) && nm->nmcd.lItemlParam != (LPARAM)(-2)) { + else if (nm->iSubItem>1 && nm->nmcd.lItemlParam != -1 && nm->nmcd.lItemlParam != -2) { static int iconResources[3] = {SKINICON_OTHER_RENAME, SKINICON_OTHER_DELETE}; if (nm->iSubItem == 2 && nm->nmcd.hdr.idFrom == IDC_PHONES) { TCHAR szText[2]; @@ -455,8 +455,8 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP lvi.iItem = hti.iItem; lvi.iSubItem = 0; ListView_GetItem(nm->hdr.hwndFrom, &lvi); - if (lvi.lParam == (LPARAM)(-1)) break; - if (lvi.lParam == (LPARAM)(-2)) { + if (lvi.lParam == -1) break; + if (lvi.lParam == -2) { if (hti.iSubItem-3 == (nm->hdr.idFrom == IDC_PHONES)) { //add char szNewData[256] = "", idstr[33]; diff --git a/src/modules/chat/clist.cpp b/src/modules/chat/clist.cpp index 8f8535eea1..4306806568 100644 --- a/src/modules/chat/clist.cpp +++ b/src/modules/chat/clist.cpp @@ -93,7 +93,7 @@ BOOL SetAllOffline(BOOL bHide, const char *pszModule) continue; int i = db_get_b(hContact, szProto, "ChatRoom", 0); if (i != 0) { - db_set_w(hContact, szProto, "ApparentMode", (LPARAM)(WORD)0); + db_set_w(hContact, szProto, "ApparentMode", 0); db_set_w(hContact, szProto, "Status", ID_STATUS_OFFLINE); } } diff --git a/src/modules/chat/tools.cpp b/src/modules/chat/tools.cpp index e20b59111f..fd4044515f 100644 --- a/src/modules/chat/tools.cpp +++ b/src/modules/chat/tools.cpp @@ -332,7 +332,7 @@ BOOL DoSoundsFlashPopupTrayStuff(SESSION_INFO *si, GCEVENT *gce, BOOL bHighlight if (bInactive && !(si->wState & STATE_TALK)) { si->wState |= STATE_TALK; - db_set_w(si->hContact, si->pszModule, "ApparentMode", (LPARAM)(WORD)40071); + db_set_w(si->hContact, si->pszModule, "ApparentMode", ID_STATUS_OFFLINE); } if (ci.OnFlashWindow) ci.OnFlashWindow(si, bInactive); diff --git a/src/modules/clist/genmenuopt.cpp b/src/modules/clist/genmenuopt.cpp index dd5d537c8c..7a2339ed47 100644 --- a/src/modules/clist/genmenuopt.cpp +++ b/src/modules/clist/genmenuopt.cpp @@ -355,7 +355,7 @@ public: PD->pos = ((MenuItemOptData *)tvi.lParam)->pos - 1; TVINSERTSTRUCT tvis = { 0 }; - tvis.item.lParam = (LPARAM)(PD); + tvis.item.lParam = (LPARAM)PD; tvis.item.pszText = PD->name; tvis.item.iImage = tvis.item.iSelectedImage = 1; tvis.hInsertAfter = hti; diff --git a/src/modules/protocols/protoaccs.cpp b/src/modules/protocols/protoaccs.cpp index 06a7268a6f..9e99d22ae5 100644 --- a/src/modules/protocols/protoaccs.cpp +++ b/src/modules/protocols/protoaccs.cpp @@ -418,7 +418,7 @@ static INT_PTR stub44(PROTO_INTERFACE* ppi, WPARAM wParam, LPARAM lParam) static INT_PTR stub45(PROTO_INTERFACE* ppi, WPARAM wParam, LPARAM lParam) { - return CallProtoServiceInt(NULL, ppi->m_szModuleName, PS_SETMYAVATARW, wParam, (LPARAM)(LPCTSTR)_A2T((char*)lParam)); + return CallProtoServiceInt(NULL, ppi->m_szModuleName, PS_SETMYAVATARW, wParam, _A2T((char*)lParam)); } static HANDLE CreateProtoServiceEx(const char* szModule, const char* szService, MIRANDASERVICEOBJ pFunc, void* param) diff --git a/src/modules/protocols/protoint.cpp b/src/modules/protocols/protoint.cpp index e8c834c45a..6f9624f9f5 100644 --- a/src/modules/protocols/protoint.cpp +++ b/src/modules/protocols/protoint.cpp @@ -66,7 +66,7 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE if (m_iVersion > 1) return (int)ProtoCallService(m_szModuleName, PS_AUTHDENY, hDbEvent, (LPARAM)szReason); - return (int)ProtoCallService(m_szModuleName, PS_AUTHDENY, hDbEvent, (LPARAM)StrConvA(szReason)); + return (int)ProtoCallService(m_szModuleName, PS_AUTHDENY, hDbEvent, _T2A(szReason)); } int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT *evt) @@ -152,14 +152,14 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE if (m_iVersion > 1) return (HANDLE)ProtoCallService(m_szModuleName, PS_BASICSEARCH, 0, (LPARAM)id); - return (HANDLE)ProtoCallService(m_szModuleName, PS_BASICSEARCH, 0, (LPARAM)StrConvA(id)); + return (HANDLE)ProtoCallService(m_szModuleName, PS_BASICSEARCH, 0, _T2A(id)); } HANDLE __cdecl SearchByEmail(const TCHAR* email) { if (m_iVersion > 1) return (HANDLE)ProtoCallService(m_szModuleName, PS_SEARCHBYEMAIL, 0, (LPARAM)email); - return (HANDLE)ProtoCallService(m_szModuleName, PS_SEARCHBYEMAIL, 0, (LPARAM)StrConvA(email)); + return (HANDLE)ProtoCallService(m_szModuleName, PS_SEARCHBYEMAIL, 0, _T2A(email)); } HANDLE __cdecl SearchByName(const TCHAR* nick, const TCHAR* firstName, const TCHAR* lastName) @@ -270,7 +270,7 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE { if (m_iVersion > 1) return (int)ProtoCallService(m_szModuleName, PS_SETAWAYMSG, iStatus, (LPARAM)msg); - return (int)ProtoCallService(m_szModuleName, PS_SETAWAYMSG, iStatus, (LPARAM)StrConvA(msg)); + return (int)ProtoCallService(m_szModuleName, PS_SETAWAYMSG, iStatus, _T2A(msg)); } int __cdecl UserIsTyping(MCONTACT hContact, int type) diff --git a/src/modules/protocols/protoopts.cpp b/src/modules/protocols/protoopts.cpp index 10968a73b2..48cb033202 100644 --- a/src/modules/protocols/protoopts.cpp +++ b/src/modules/protocols/protoopts.cpp @@ -355,7 +355,7 @@ static LRESULT CALLBACK AccListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA mir_subclassWindow(dat->hwndEdit, sttEditSubclassProc); SendMessage(dat->hwndEdit, WM_SETFONT, (WPARAM)parentDat->hfntTitle, 0); SendMessage(dat->hwndEdit, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN | EC_USEFONTINFO, 0); - SendMessage(dat->hwndEdit, EM_SETSEL, 0, (LPARAM)(-1)); + SendMessage(dat->hwndEdit, EM_SETSEL, 0, -1); ShowWindow(dat->hwndEdit, SW_SHOW); } SetFocus(dat->hwndEdit); -- cgit v1.2.3