From 86ecbad7907401648a49139d196559a2d27ec53a Mon Sep 17 00:00:00 2001 From: Rozhuk Ivan Date: Sat, 13 Dec 2014 21:56:47 +0000 Subject: SendMessage(GetDlgItem -> SendDlgItemMessage git-svn-id: http://svn.miranda-ng.org/main/trunk@11383 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Alarms/src/options.cpp | 20 +-- plugins/BuddyExpectator/src/options.cpp | 146 ++++++++++----------- plugins/BuddyPounce/src/dialog.cpp | 10 +- plugins/Clist_modern/src/modern_clistopts.cpp | 6 +- plugins/Clist_modern/src/modern_rowtemplateopt.cpp | 6 +- plugins/Clist_modern/src/modern_viewmodebar.cpp | 18 +-- plugins/Clist_nicer/skineditor/src/main.cpp | 8 +- plugins/ConnectionNotify/src/ConnectionNotify.cpp | 2 +- plugins/ConnectionNotify/src/filter.cpp | 4 +- plugins/ContactsPlus/src/receive.cpp | 4 +- plugins/Db3x_mmap/src/ui.cpp | 4 +- plugins/DbEditorPP/src/copymodule.cpp | 8 +- plugins/DbEditorPP/src/findwindow.cpp | 6 +- plugins/DbEditorPP/src/settinglist.cpp | 2 +- plugins/Db_autobackups/src/backup.cpp | 4 +- plugins/Db_autobackups/src/options.cpp | 8 +- plugins/FTPFileYM/src/dialog.cpp | 16 +-- plugins/FavContacts/src/options.cpp | 2 +- plugins/HTTPServer/src/GuiElements.cpp | 14 +- plugins/HistoryLinkListPlus/src/linklist_fct.cpp | 4 +- plugins/IEHistory/src/dlgHandlers.cpp | 16 +-- plugins/MirOTR/MirOTR/src/options.cpp | 10 +- plugins/MyDetails/src/services.cpp | 4 +- plugins/NewAwaySysMod/src/AwayOpt.cpp | 14 +- plugins/NewXstatusNotify/src/indsnd.cpp | 2 +- plugins/NewXstatusNotify/src/options.cpp | 4 +- plugins/New_GPG/src/main.cpp | 4 +- plugins/NotesAndReminders/src/notes.cpp | 2 +- plugins/Nudge/src/options.cpp | 8 +- plugins/PackUpdater/Src/Notifications.cpp | 2 +- plugins/PackUpdater/Src/Options.cpp | 4 +- plugins/PasteIt/src/PasteIt.cpp | 2 +- plugins/Ping/src/options.cpp | 8 +- plugins/PluginUpdater/src/Options.cpp | 4 +- plugins/Popup/src/actions.cpp | 2 +- plugins/Popup/src/opt_contacts.cpp | 8 +- plugins/Popup/src/opt_gen.cpp | 16 +-- plugins/Popup/src/opt_skins.cpp | 6 +- plugins/QuickContacts/src/quickcontacts.cpp | 18 +-- plugins/QuickMessages/src/options.cpp | 26 ++-- plugins/Scriver/src/chat/window.cpp | 28 ++-- plugins/Scriver/src/msgdialog.cpp | 12 +- plugins/Scriver/src/msgs.cpp | 2 +- plugins/SecureIM/src/options.cpp | 82 ++++++------ plugins/SendScreenshotPlus/src/UAboutForm.cpp | 4 +- plugins/SendScreenshotPlus/src/UMainForm.cpp | 6 +- plugins/Sessions/Src/Options.cpp | 4 +- plugins/ShellExt/src/options.cpp | 2 +- plugins/SimpleAR/src/Options.cpp | 2 +- plugins/SimpleStatusMsg/src/msgbox.cpp | 36 ++--- plugins/SimpleStatusMsg/src/options.cpp | 134 +++++++++---------- plugins/Spamotron/src/options.cpp | 8 +- plugins/StatusPlugins/StartupStatus/options.cpp | 2 +- plugins/StatusPlugins/confirmdialog.cpp | 2 +- plugins/TabSRMM/src/buttonsbar.cpp | 4 +- plugins/TabSRMM/src/chat/message.cpp | 2 +- plugins/TabSRMM/src/chat/window.cpp | 34 ++--- plugins/TabSRMM/src/generic_msghandlers.cpp | 4 +- plugins/TabSRMM/src/hotkeyhandler.cpp | 2 +- plugins/TabSRMM/src/msgdialog.cpp | 26 ++-- plugins/TabSRMM/src/msgdlgutils.cpp | 6 +- plugins/TabSRMM/src/msgs.cpp | 2 +- plugins/TabSRMM/src/templates.cpp | 12 +- plugins/Variables/src/help.cpp | 12 +- plugins/Variables/src/parse_system.cpp | 2 +- plugins/Weather/src/weather_ini.cpp | 8 +- plugins/Weather/src/weather_opt.cpp | 20 +-- plugins/Weather/src/weather_popup.cpp | 16 +-- plugins/Weather/src/weather_userinfo.cpp | 2 +- plugins/WebView/src/webview.cpp | 2 +- plugins/WebView/src/webview_datawnd.cpp | 10 +- plugins/WebView/src/webview_getdata.cpp | 6 +- plugins/WhenWasIt/src/dlg_handlers.cpp | 48 +++---- plugins/XSoundNotify/src/options.cpp | 4 +- plugins/YAMN/src/browser/mailbrowser.cpp | 2 +- plugins/YAMN/src/proto/pop3/pop3opt.cpp | 8 +- plugins/YARelay/src/options.cpp | 85 ++++++------ plugins/helpers/gen_helpers.cpp | 2 +- protocols/FacebookRM/src/dialogs.cpp | 11 +- protocols/GTalkExt/src/options.cpp | 2 +- protocols/IRCG/src/services.cpp | 2 +- protocols/IcqOscarJ/src/icq_xstatus.cpp | 4 +- protocols/JabberG/src/jabber_agent.cpp | 2 +- protocols/JabberG/src/jabber_chat.cpp | 2 +- protocols/JabberG/src/jabber_opt.cpp | 2 +- protocols/JabberG/src/jabber_search.cpp | 4 +- protocols/JabberG/src/jabber_vcard.cpp | 14 +- protocols/MRA/src/MraAdvancedSearch.cpp | 10 +- protocols/MRA/src/MraSelectEMail.cpp | 2 +- protocols/MSN/src/msn_menu.cpp | 2 +- protocols/Sametime/src/session_announce_win.cpp | 2 +- protocols/SkypeClassic/src/skypeopt.cpp | 88 ++++++------- protocols/Steam/src/steam_dialogs.cpp | 4 +- protocols/Xfire/src/options.cpp | 9 +- protocols/Xfire/src/userdetails.cpp | 6 +- protocols/Yahoo/src/options.cpp | 4 +- src/core/stdchat/src/window.cpp | 68 +++++----- src/core/stdmsg/src/msgdialog.cpp | 2 +- src/modules/metacontacts/meta_addto.cpp | 2 +- src/modules/options/options.cpp | 4 +- 100 files changed, 670 insertions(+), 671 deletions(-) diff --git a/plugins/Alarms/src/options.cpp b/plugins/Alarms/src/options.cpp index d67cc11bfc..afc9f71934 100644 --- a/plugins/Alarms/src/options.cpp +++ b/plugins/Alarms/src/options.cpp @@ -877,17 +877,17 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA EnableWindow(hw, TRUE); } - SendMessage(GetDlgItem(hwndDlg, IDC_SPIN_SNOOZE), UDM_SETRANGE, 0, (LPARAM)MAKELONG(360, 0)); - SendMessage(GetDlgItem(hwndDlg, IDC_SPIN_SNOOZE), UDM_SETPOS, 0, temp_options.snooze_minutes); + SendDlgItemMessage(hwndDlg, IDC_SPIN_SNOOZE, UDM_SETRANGE, 0, (LPARAM)MAKELONG(360, 0)); + SendDlgItemMessage(hwndDlg, IDC_SPIN_SNOOZE, UDM_SETPOS, 0, temp_options.snooze_minutes); - SendMessage(GetDlgItem(hwndDlg, IDC_SPIN_ROWHEIGHT), UDM_SETRANGE, 0, (LPARAM)MAKELONG(100, 5)); - SendMessage(GetDlgItem(hwndDlg, IDC_SPIN_ROWHEIGHT), UDM_SETPOS, 0, temp_options.row_height); + SendDlgItemMessage(hwndDlg, IDC_SPIN_ROWHEIGHT, UDM_SETRANGE, 0, (LPARAM)MAKELONG(100, 5)); + SendDlgItemMessage(hwndDlg, IDC_SPIN_ROWHEIGHT, UDM_SETPOS, 0, temp_options.row_height); - SendMessage(GetDlgItem(hwndDlg, IDC_SPIN_INDENT), UDM_SETRANGE, 0, (LPARAM)MAKELONG(100, 0)); - SendMessage(GetDlgItem(hwndDlg, IDC_SPIN_INDENT), UDM_SETPOS, 0, temp_options.indent); + SendDlgItemMessage(hwndDlg, IDC_SPIN_INDENT, UDM_SETRANGE, 0, (LPARAM)MAKELONG(100, 0)); + SendDlgItemMessage(hwndDlg, IDC_SPIN_INDENT, UDM_SETPOS, 0, temp_options.indent); - SendMessage(GetDlgItem(hwndDlg, IDC_SPIN_TRANS), UDM_SETRANGE, 0, (LPARAM)MAKELONG(100, 0)); - SendMessage(GetDlgItem(hwndDlg, IDC_SPIN_TRANS), UDM_SETPOS, 0, temp_options.aw_trans); + SendDlgItemMessage(hwndDlg, IDC_SPIN_TRANS, UDM_SETRANGE, 0, (LPARAM)MAKELONG(100, 0)); + SendDlgItemMessage(hwndDlg, IDC_SPIN_TRANS, UDM_SETPOS, 0, temp_options.aw_trans); } CheckDlgButton(hwndDlg, IDC_SHOWHIDE, temp_options.auto_showhide ? TRUE : FALSE); @@ -897,8 +897,8 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA CheckDlgButton(hwndDlg, IDC_CHK_AWROUND, temp_options.aw_roundcorners ? TRUE : FALSE); CheckDlgButton(hwndDlg, IDC_CHK_AWNOACTIVATE, temp_options.aw_dontstealfocus ? TRUE : FALSE); - SendMessage(GetDlgItem(hwndDlg, IDC_SPIN_PERIOD), UDM_SETRANGE, 0, (LPARAM)MAKELONG(72, 1)); - SendMessage(GetDlgItem(hwndDlg, IDC_SPIN_PERIOD), UDM_SETPOS, 0, temp_options.reminder_period); + SendDlgItemMessage(hwndDlg, IDC_SPIN_PERIOD, UDM_SETRANGE, 0, (LPARAM)MAKELONG(72, 1)); + SendDlgItemMessage(hwndDlg, IDC_SPIN_PERIOD, UDM_SETPOS, 0, temp_options.reminder_period); SendMessage( GetParent( hwndDlg ), PSM_UNCHANGED, 0, 0 ); return TRUE; diff --git a/plugins/BuddyExpectator/src/options.cpp b/plugins/BuddyExpectator/src/options.cpp index 49e319a807..f9862248ee 100644 --- a/plugins/BuddyExpectator/src/options.cpp +++ b/plugins/BuddyExpectator/src/options.cpp @@ -98,100 +98,100 @@ static INT_PTR CALLBACK OptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, EnableWindow(GetDlgItem(hwndDlg, IDC_CHECK_POPUP), FALSE); //iAbsencePeriod - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_RESETCONTENT, 0, 0); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_ADDSTRING, 0, (LPARAM) TranslateT("days")); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_ADDSTRING, 0, (LPARAM) TranslateT("weeks")); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_ADDSTRING, 0, (LPARAM) TranslateT("months")); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_ADDSTRING, 0, (LPARAM) TranslateT("years")); + SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD, CB_RESETCONTENT, 0, 0); + SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD, CB_ADDSTRING, 0, (LPARAM) TranslateT("days")); + SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD, CB_ADDSTRING, 0, (LPARAM) TranslateT("weeks")); + SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD, CB_ADDSTRING, 0, (LPARAM) TranslateT("months")); + SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD, CB_ADDSTRING, 0, (LPARAM) TranslateT("years")); if (options.iAbsencePeriod % 365 == 0) { SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE, options.iAbsencePeriod/365, FALSE); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_SETCURSEL, 3, 0); + SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD, CB_SETCURSEL, 3, 0); } else if (options.iAbsencePeriod % 30 == 0) { SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE, options.iAbsencePeriod/30, FALSE); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_SETCURSEL, 2, 0); + SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD, CB_SETCURSEL, 2, 0); } else if (options.iAbsencePeriod % 7 == 0) { SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE, options.iAbsencePeriod/7, FALSE); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_SETCURSEL, 1, 0); + SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD, CB_SETCURSEL, 1, 0); } else { SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE, options.iAbsencePeriod, FALSE); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_SETCURSEL, 0, 0); + SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD, CB_SETCURSEL, 0, 0); } //iAbsencePeriod2 - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_RESETCONTENT, 0, 0); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_ADDSTRING, 0, (LPARAM) TranslateT("days")); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_ADDSTRING, 0, (LPARAM) TranslateT("weeks")); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_ADDSTRING, 0, (LPARAM) TranslateT("months")); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_ADDSTRING, 0, (LPARAM) TranslateT("years")); + SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD2, CB_RESETCONTENT, 0, 0); + SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD2, CB_ADDSTRING, 0, (LPARAM) TranslateT("days")); + SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD2, CB_ADDSTRING, 0, (LPARAM) TranslateT("weeks")); + SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD2, CB_ADDSTRING, 0, (LPARAM) TranslateT("months")); + SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD2, CB_ADDSTRING, 0, (LPARAM) TranslateT("years")); if (options.iAbsencePeriod2 % 365 == 0) { SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE2, options.iAbsencePeriod2/365, FALSE); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_SETCURSEL, 3, 0); + SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD2, CB_SETCURSEL, 3, 0); } else if (options.iAbsencePeriod2 % 30 == 0) { SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE2, options.iAbsencePeriod2/30, FALSE); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_SETCURSEL, 2, 0); + SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD2, CB_SETCURSEL, 2, 0); } else if (options.iAbsencePeriod2 % 7 == 0) { SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE2, options.iAbsencePeriod2/7, FALSE); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_SETCURSEL, 1, 0); + SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD2, CB_SETCURSEL, 1, 0); } else { SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE2,options.iAbsencePeriod2, FALSE); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_SETCURSEL, 0, 0); + SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD2, CB_SETCURSEL, 0, 0); } //iSilencePeriod - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_RESETCONTENT, 0, 0); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_ADDSTRING, 0, (LPARAM) TranslateT("days")); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_ADDSTRING, 0, (LPARAM) TranslateT("weeks")); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_ADDSTRING, 0, (LPARAM) TranslateT("months")); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_ADDSTRING, 0, (LPARAM) TranslateT("years")); + SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD3, CB_RESETCONTENT, 0, 0); + SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD3, CB_ADDSTRING, 0, (LPARAM) TranslateT("days")); + SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD3, CB_ADDSTRING, 0, (LPARAM) TranslateT("weeks")); + SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD3, CB_ADDSTRING, 0, (LPARAM) TranslateT("months")); + SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD3, CB_ADDSTRING, 0, (LPARAM) TranslateT("years")); if (options.iSilencePeriod % 365 == 0) { SetDlgItemInt(hwndDlg, IDC_EDIT_SILENTFOR, options.iSilencePeriod/365, FALSE); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_SETCURSEL, 3, 0); + SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD3, CB_SETCURSEL, 3, 0); } else if (options.iSilencePeriod % 30 == 0) { SetDlgItemInt(hwndDlg, IDC_EDIT_SILENTFOR, options.iSilencePeriod/30, FALSE); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_SETCURSEL, 2, 0); + SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD3, CB_SETCURSEL, 2, 0); } else if (options.iSilencePeriod % 7 == 0) { SetDlgItemInt(hwndDlg, IDC_EDIT_SILENTFOR, options.iSilencePeriod/7, FALSE); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_SETCURSEL, 1, 0); + SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD3, CB_SETCURSEL, 1, 0); } else { SetDlgItemInt(hwndDlg, IDC_EDIT_SILENTFOR,options.iSilencePeriod, FALSE); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_SETCURSEL, 0, 0); + SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD3, CB_SETCURSEL, 0, 0); } - SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_POPUP), BM_SETCHECK, options.iShowPopup > 0 ? BST_CHECKED : BST_UNCHECKED, 0); - SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_FLASHICON), BM_SETCHECK, options.iShowEvent > 0 ? BST_CHECKED : BST_UNCHECKED, 0); - SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_UDETAILS), BM_SETCHECK, (options.iShowUDetails > 0 ? BST_CHECKED : BST_UNCHECKED), 0); - SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_MSGWINDOW), BM_SETCHECK, (options.iShowMessageWindow > 0 ? BST_CHECKED : BST_UNCHECKED), 0); - SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_FIRSTSIGHT), BM_SETCHECK, options.notifyFirstOnline ? BST_CHECKED : BST_UNCHECKED, 0); - SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_NOMSGS), BM_SETCHECK, options.hideInactive ? BST_CHECKED : BST_UNCHECKED, 0); - SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_MISSYOU), BM_SETCHECK, options.enableMissYou ? BST_CHECKED : BST_UNCHECKED, 0); - - SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_POPUP2), BM_SETCHECK, options.iShowPopup2 > 0 ? BST_CHECKED : BST_UNCHECKED, 0); - SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_FLASHICON2), BM_SETCHECK, options.iShowEvent2 > 0 ? BST_CHECKED : BST_UNCHECKED, 0); - - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_RESETCONTENT, 0, 0); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_ADDSTRING, 0, (LPARAM) TranslateT("Do nothing")); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_ADDSTRING, 0, (LPARAM) TranslateT("Delete the contact")); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_ADDSTRING, 0, (LPARAM) TranslateT("Open User Details")); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_ADDSTRING, 0, (LPARAM) TranslateT("Open message window")); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_SETCURSEL, options.action2, 0); + SendDlgItemMessage(hwndDlg, IDC_CHECK_POPUP, BM_SETCHECK, options.iShowPopup > 0 ? BST_CHECKED : BST_UNCHECKED, 0); + SendDlgItemMessage(hwndDlg, IDC_CHECK_FLASHICON, BM_SETCHECK, options.iShowEvent > 0 ? BST_CHECKED : BST_UNCHECKED, 0); + SendDlgItemMessage(hwndDlg, IDC_CHECK_UDETAILS, BM_SETCHECK, (options.iShowUDetails > 0 ? BST_CHECKED : BST_UNCHECKED), 0); + SendDlgItemMessage(hwndDlg, IDC_CHECK_MSGWINDOW, BM_SETCHECK, (options.iShowMessageWindow > 0 ? BST_CHECKED : BST_UNCHECKED), 0); + SendDlgItemMessage(hwndDlg, IDC_CHECK_FIRSTSIGHT, BM_SETCHECK, options.notifyFirstOnline ? BST_CHECKED : BST_UNCHECKED, 0); + SendDlgItemMessage(hwndDlg, IDC_CHECK_NOMSGS, BM_SETCHECK, options.hideInactive ? BST_CHECKED : BST_UNCHECKED, 0); + SendDlgItemMessage(hwndDlg, IDC_CHECK_MISSYOU, BM_SETCHECK, options.enableMissYou ? BST_CHECKED : BST_UNCHECKED, 0); + + SendDlgItemMessage(hwndDlg, IDC_CHECK_POPUP2, BM_SETCHECK, options.iShowPopup2 > 0 ? BST_CHECKED : BST_UNCHECKED, 0); + SendDlgItemMessage(hwndDlg, IDC_CHECK_FLASHICON2, BM_SETCHECK, options.iShowEvent2 > 0 ? BST_CHECKED : BST_UNCHECKED, 0); + + SendDlgItemMessage(hwndDlg, IDC_COMBO_ACTIONS, CB_RESETCONTENT, 0, 0); + SendDlgItemMessage(hwndDlg, IDC_COMBO_ACTIONS, CB_ADDSTRING, 0, (LPARAM) TranslateT("Do nothing")); + SendDlgItemMessage(hwndDlg, IDC_COMBO_ACTIONS, CB_ADDSTRING, 0, (LPARAM) TranslateT("Delete the contact")); + SendDlgItemMessage(hwndDlg, IDC_COMBO_ACTIONS, CB_ADDSTRING, 0, (LPARAM) TranslateT("Open User Details")); + SendDlgItemMessage(hwndDlg, IDC_COMBO_ACTIONS, CB_ADDSTRING, 0, (LPARAM) TranslateT("Open message window")); + SendDlgItemMessage(hwndDlg, IDC_COMBO_ACTIONS, CB_SETCURSEL, options.action2, 0); return TRUE; case WM_COMMAND: if ((HIWORD(wParam) == BN_CLICKED) || (HIWORD(wParam) == CBN_SELCHANGE) - || ((HIWORD(wParam) == EN_CHANGE) && (SendMessage(GetDlgItem(hwndDlg, IDC_EDIT_ABSENCE), EM_GETMODIFY, 0, 0))) - || ((HIWORD(wParam) == EN_CHANGE) && (SendMessage(GetDlgItem(hwndDlg, IDC_EDIT_ABSENCE2), EM_GETMODIFY, 0, 0))) - || ((HIWORD(wParam) == EN_CHANGE) && (SendMessage(GetDlgItem(hwndDlg, IDC_EDIT_SILENTFOR), EM_GETMODIFY, 0, 0)))) + || ((HIWORD(wParam) == EN_CHANGE) && (SendDlgItemMessage(hwndDlg, IDC_EDIT_ABSENCE, EM_GETMODIFY, 0, 0))) + || ((HIWORD(wParam) == EN_CHANGE) && (SendDlgItemMessage(hwndDlg, IDC_EDIT_ABSENCE2, EM_GETMODIFY, 0, 0))) + || ((HIWORD(wParam) == EN_CHANGE) && (SendDlgItemMessage(hwndDlg, IDC_EDIT_SILENTFOR, EM_GETMODIFY, 0, 0)))) { SendMessage(GetParent(hwndDlg),PSM_CHANGED,0,0); } @@ -204,7 +204,7 @@ static INT_PTR CALLBACK OptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, case PSN_APPLY: //iAbsencePeriod int num = GetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE, 0, FALSE); - switch (SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_GETCURSEL, 0, 0)) { + switch (SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD, CB_GETCURSEL, 0, 0)) { case 1: options.iAbsencePeriod = 7 * num; break; case 2: options.iAbsencePeriod = 30 * num; break; case 3: options.iAbsencePeriod = 365 * num; break; @@ -213,7 +213,7 @@ static INT_PTR CALLBACK OptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, //iAbsencePeriod2 num = GetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE2, 0, FALSE); - switch (SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_GETCURSEL, 0, 0)) { + switch (SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD2, CB_GETCURSEL, 0, 0)) { case 1: options.iAbsencePeriod2 = 7 * num; break; case 2: options.iAbsencePeriod2 = 30 * num; break; case 3: options.iAbsencePeriod2 = 365 * num; break; @@ -222,25 +222,25 @@ static INT_PTR CALLBACK OptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, //iSilencePeriod num = GetDlgItemInt(hwndDlg, IDC_EDIT_SILENTFOR, 0, FALSE); - switch (SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_GETCURSEL, 0, 0)) { + switch (SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD3, CB_GETCURSEL, 0, 0)) { case 1: options.iSilencePeriod = 7 * num; break; case 2: options.iSilencePeriod = 30 * num; break; case 3: options.iSilencePeriod = 365 * num; break; default: options.iSilencePeriod = num; break; } - options.iShowPopup = SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_POPUP), BM_GETCHECK, 0, 0) == BST_CHECKED ? 1:0; - options.iShowEvent = SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_FLASHICON), BM_GETCHECK, 0, 0) == BST_CHECKED ? 1:0; - options.iShowUDetails = SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_UDETAILS), BM_GETCHECK, 0, 0) == BST_CHECKED ? 1:0; - options.iShowMessageWindow = SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_MSGWINDOW), BM_GETCHECK, 0, 0) == BST_CHECKED ? 1:0; - options.notifyFirstOnline = SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_FIRSTSIGHT), BM_GETCHECK, 0, 0) == BST_CHECKED ? true : false; - options.hideInactive = SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_NOMSGS), BM_GETCHECK, 0, 0) == BST_CHECKED ? true : false; - options.enableMissYou = SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_MISSYOU), BM_GETCHECK, 0, 0) == BST_CHECKED ? true : false; + options.iShowPopup = SendDlgItemMessage(hwndDlg, IDC_CHECK_POPUP, BM_GETCHECK, 0, 0) == BST_CHECKED ? 1:0; + options.iShowEvent = SendDlgItemMessage(hwndDlg, IDC_CHECK_FLASHICON, BM_GETCHECK, 0, 0) == BST_CHECKED ? 1:0; + options.iShowUDetails = SendDlgItemMessage(hwndDlg, IDC_CHECK_UDETAILS, BM_GETCHECK, 0, 0) == BST_CHECKED ? 1:0; + options.iShowMessageWindow = SendDlgItemMessage(hwndDlg, IDC_CHECK_MSGWINDOW, BM_GETCHECK, 0, 0) == BST_CHECKED ? 1:0; + options.notifyFirstOnline = SendDlgItemMessage(hwndDlg, IDC_CHECK_FIRSTSIGHT, BM_GETCHECK, 0, 0) == BST_CHECKED ? true : false; + options.hideInactive = SendDlgItemMessage(hwndDlg, IDC_CHECK_NOMSGS, BM_GETCHECK, 0, 0) == BST_CHECKED ? true : false; + options.enableMissYou = SendDlgItemMessage(hwndDlg, IDC_CHECK_MISSYOU, BM_GETCHECK, 0, 0) == BST_CHECKED ? true : false; - options.iShowPopup2 = SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_POPUP2), BM_GETCHECK, 0, 0) == BST_CHECKED ? 1:0; - options.iShowEvent2 = SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_FLASHICON2), BM_GETCHECK, 0, 0) == BST_CHECKED ? 1:0; + options.iShowPopup2 = SendDlgItemMessage(hwndDlg, IDC_CHECK_POPUP2, BM_GETCHECK, 0, 0) == BST_CHECKED ? 1:0; + options.iShowEvent2 = SendDlgItemMessage(hwndDlg, IDC_CHECK_FLASHICON2, BM_GETCHECK, 0, 0) == BST_CHECKED ? 1:0; - options.action2 = (GoneContactAction)SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_GETCURSEL, 0, 0); + options.action2 = (GoneContactAction)SendDlgItemMessage(hwndDlg, IDC_COMBO_ACTIONS, CB_GETCURSEL, 0, 0); // save values to the DB SaveOptions(); @@ -296,15 +296,15 @@ static INT_PTR CALLBACK PopupOptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wP //iPopupDelay SetDlgItemInt(hwndDlg, IDC_EDIT_POPUPDELAY, 5, FALSE); if (options.iPopupDelay < 0) { - SendMessage(GetDlgItem(hwndDlg, IDC_DELAY_PERM), BM_SETCHECK, BST_CHECKED, 0); + SendDlgItemMessage(hwndDlg, IDC_DELAY_PERM, BM_SETCHECK, BST_CHECKED, 0); EnableWindow(GetDlgItem(hwndDlg, IDC_EDIT_POPUPDELAY), false); } else if(options.iPopupDelay == 0) { - SendMessage(GetDlgItem(hwndDlg, IDC_DELAY_DEF), BM_SETCHECK, BST_CHECKED, 0); + SendDlgItemMessage(hwndDlg, IDC_DELAY_DEF, BM_SETCHECK, BST_CHECKED, 0); EnableWindow(GetDlgItem(hwndDlg, IDC_EDIT_POPUPDELAY), false); } else { - SendMessage(GetDlgItem(hwndDlg, IDC_DELAY_CUST), BM_SETCHECK, BST_CHECKED, 0); + SendDlgItemMessage(hwndDlg, IDC_DELAY_CUST, BM_SETCHECK, BST_CHECKED, 0); SetDlgItemInt(hwndDlg, IDC_EDIT_POPUPDELAY, options.iPopupDelay, FALSE); } @@ -318,9 +318,9 @@ static INT_PTR CALLBACK PopupOptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wP //iPopupDelay options.iPopupDelay = GetDlgItemInt(hwndDlg, IDC_EDIT_POPUPDELAY, 0, FALSE); - if (SendMessage(GetDlgItem(hwndDlg, IDC_DELAY_PERM), BM_GETCHECK, 0, 0) == BST_CHECKED) + if (SendDlgItemMessage(hwndDlg, IDC_DELAY_PERM, BM_GETCHECK, 0, 0) == BST_CHECKED) options.iPopupDelay = -1; - else if (SendMessage(GetDlgItem(hwndDlg, IDC_DELAY_DEF), BM_GETCHECK, 0, 0) == BST_CHECKED) + else if (SendDlgItemMessage(hwndDlg, IDC_DELAY_DEF, BM_GETCHECK, 0, 0) == BST_CHECKED) options.iPopupDelay = 0; ppd.lchContact = NULL; @@ -410,9 +410,9 @@ static INT_PTR CALLBACK PopupOptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wP //iPopupDelay options.iPopupDelay = GetDlgItemInt(hwndDlg, IDC_EDIT_POPUPDELAY, 0, FALSE); - if (SendMessage(GetDlgItem(hwndDlg, IDC_DELAY_PERM), BM_GETCHECK, 0, 0) == BST_CHECKED) + if (SendDlgItemMessage(hwndDlg, IDC_DELAY_PERM, BM_GETCHECK, 0, 0) == BST_CHECKED) options.iPopupDelay = -1; - else if (SendMessage(GetDlgItem(hwndDlg, IDC_DELAY_DEF), BM_GETCHECK, 0, 0) == BST_CHECKED) + else if (SendDlgItemMessage(hwndDlg, IDC_DELAY_DEF, BM_GETCHECK, 0, 0) == BST_CHECKED) options.iPopupDelay = 0; // save value to the DB @@ -483,9 +483,9 @@ INT_PTR CALLBACK UserinfoDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lpar else SetDlgItemText(hdlg, IDC_EDIT_WILLNOTICE, _T("")); - SendMessage(GetDlgItem(hdlg, IDC_CHECK_MISSYOU), BM_SETCHECK, db_get_b((MCONTACT)lparam, MODULE_NAME, "MissYou", 0) ? BST_CHECKED : BST_UNCHECKED, 0); - SendMessage(GetDlgItem(hdlg, IDC_CHECK_NOTIFYALWAYS), BM_SETCHECK, db_get_b((MCONTACT)lparam, MODULE_NAME, "MissYouNotifyAlways", 0) ? BST_CHECKED : BST_UNCHECKED, 0); - SendMessage(GetDlgItem(hdlg, IDC_CHECK_NEVERHIDE), BM_SETCHECK, db_get_b((MCONTACT)lparam, MODULE_NAME, "NeverHide", 0) ? BST_CHECKED : BST_UNCHECKED, 0); + SendDlgItemMessage(hdlg, IDC_CHECK_MISSYOU, BM_SETCHECK, db_get_b((MCONTACT)lparam, MODULE_NAME, "MissYou", 0) ? BST_CHECKED : BST_UNCHECKED, 0); + SendDlgItemMessage(hdlg, IDC_CHECK_NOTIFYALWAYS, BM_SETCHECK, db_get_b((MCONTACT)lparam, MODULE_NAME, "MissYouNotifyAlways", 0) ? BST_CHECKED : BST_UNCHECKED, 0); + SendDlgItemMessage(hdlg, IDC_CHECK_NEVERHIDE, BM_SETCHECK, db_get_b((MCONTACT)lparam, MODULE_NAME, "NeverHide", 0) ? BST_CHECKED : BST_UNCHECKED, 0); TranslateDialogDefault(hdlg); return TRUE; @@ -503,9 +503,9 @@ INT_PTR CALLBACK UserinfoDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lpar if (hContact) { db_set_dw(hContact, MODULE_NAME, "iAbsencePeriod", GetDlgItemInt(hdlg, IDC_EDITABSENCE, 0, FALSE)); - db_set_b(hContact, MODULE_NAME, "MissYou", (SendMessage(GetDlgItem(hdlg, IDC_CHECK_MISSYOU), BM_GETCHECK, 0, 0) == BST_CHECKED) ? 1 : 0); - db_set_b(hContact, MODULE_NAME, "MissYouNotifyAlways", (SendMessage(GetDlgItem(hdlg, IDC_CHECK_NOTIFYALWAYS), BM_GETCHECK, 0, 0) == BST_CHECKED) ? 1 : 0); - db_set_b(hContact, MODULE_NAME, "NeverHide", (SendMessage(GetDlgItem(hdlg, IDC_CHECK_NEVERHIDE), BM_GETCHECK, 0, 0) == BST_CHECKED) ? 1 : 0); + db_set_b(hContact, MODULE_NAME, "MissYou", (SendDlgItemMessage(hdlg, IDC_CHECK_MISSYOU, BM_GETCHECK, 0, 0) == BST_CHECKED) ? 1 : 0); + db_set_b(hContact, MODULE_NAME, "MissYouNotifyAlways", (SendDlgItemMessage(hdlg, IDC_CHECK_NOTIFYALWAYS, BM_GETCHECK, 0, 0) == BST_CHECKED) ? 1 : 0); + db_set_b(hContact, MODULE_NAME, "NeverHide", (SendDlgItemMessage(hdlg, IDC_CHECK_NEVERHIDE, BM_GETCHECK, 0, 0) == BST_CHECKED) ? 1 : 0); } break; } diff --git a/plugins/BuddyPounce/src/dialog.cpp b/plugins/BuddyPounce/src/dialog.cpp index 3dd354e32f..ecada53f76 100644 --- a/plugins/BuddyPounce/src/dialog.cpp +++ b/plugins/BuddyPounce/src/dialog.cpp @@ -271,7 +271,7 @@ INT_PTR CALLBACK BuddyPounceDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l } populateSettingsList(GetDlgItem(hwnd, IDC_SETTINGS)); populateContacts(wi->hContact, GetDlgItem(hwnd, IDC_CONTACTS)); - SendMessage(GetDlgItem(hwnd,IDC_SPIN), UDM_SETRANGE, 0, (LPARAM) MAKELONG ((short) 1024, (short) 0)); + SendDlgItemMessage(hwnd, IDC_SPIN, UDM_SETRANGE, 0, (LPARAM)MAKELONG((short)1024, (short)0)); db_set_b(wi->hContact, modname, "LastSetting", 0); return FALSE; @@ -290,7 +290,7 @@ INT_PTR CALLBACK BuddyPounceDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l case IDC_SIMPLE: case IDOK: { - MCONTACT hContact = (MCONTACT)SendMessage(GetDlgItem(hwnd, IDC_CONTACTS), CB_GETITEMDATA, SendMessage(GetDlgItem(hwnd, IDC_CONTACTS), CB_GETCURSEL,0,0),0); + MCONTACT hContact = (MCONTACT)SendDlgItemMessage(hwnd, IDC_CONTACTS, CB_GETITEMDATA, SendDlgItemMessage(hwnd, IDC_CONTACTS, CB_GETCURSEL, 0, 0), 0); int length = GetWindowTextLength(GetDlgItem(hwnd, IDC_MESSAGE))+1; if (length>1) { TCHAR *text = (TCHAR*)mir_alloc(length*sizeof(TCHAR)); @@ -339,7 +339,7 @@ INT_PTR CALLBACK BuddyPounceDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l case IDC_SETTINGS: if (HIWORD(wParam) == LBN_SELCHANGE) { - int item = SendMessage(GetDlgItem(hwnd, IDC_SETTINGS), LB_GETCURSEL, 0, 0); + int item = SendDlgItemMessage(hwnd, IDC_SETTINGS, LB_GETCURSEL, 0, 0); TCHAR temp[5]; saveLastSetting(wi->hContact, hwnd); hideAll(hwnd); @@ -403,7 +403,7 @@ INT_PTR CALLBACK BuddyPounceOptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, L mir_sntprintf(msg, SIZEOF(msg), TranslateT("The Message (%d Characters)"), GetWindowTextLength(GetDlgItem(hwnd, IDC_MESSAGE))); SetDlgItemText(hwnd, GRP_MSG, msg); populateSettingsList(GetDlgItem(hwnd, IDC_SETTINGS)); - SendMessage(GetDlgItem(hwnd,IDC_SPIN), UDM_SETRANGE, 0, (LPARAM) MAKELONG ((short) 1024, (short) 0)); + SendDlgItemMessage(hwnd, IDC_SPIN, UDM_SETRANGE, 0, (LPARAM)MAKELONG((short)1024, (short)0)); CheckDlgButton(hwnd, IDC_USEADVANCED, db_get_b(NULL, modname, "UseAdvanced", 0)); CheckDlgButton(hwnd, IDC_SHOWDELIVERYMSGS, db_get_b(NULL, modname, "ShowDeliveryMessages", 1)); db_set_b(wi->hContact, modname, "LastSetting", 0); @@ -459,7 +459,7 @@ INT_PTR CALLBACK BuddyPounceOptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, L case IDC_SETTINGS: if (HIWORD(wParam) == LBN_SELCHANGE) { windowInfo *wi = (windowInfo *)GetWindowLongPtr(hwnd, GWLP_USERDATA); - int item = SendMessage(GetDlgItem(hwnd, IDC_SETTINGS), LB_GETCURSEL, 0, 0); + int item = SendDlgItemMessage(hwnd, IDC_SETTINGS, LB_GETCURSEL, 0, 0); TCHAR temp[5]; SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0); saveLastSetting(wi->hContact, hwnd); diff --git a/plugins/Clist_modern/src/modern_clistopts.cpp b/plugins/Clist_modern/src/modern_clistopts.cpp index f8007a4d37..db7be21e45 100644 --- a/plugins/Clist_modern/src/modern_clistopts.cpp +++ b/plugins/Clist_modern/src/modern_clistopts.cpp @@ -176,7 +176,7 @@ static INT_PTR CALLBACK DlgProcItemRowOpts(HWND hwndDlg, UINT msg, WPARAM wParam } if (LOWORD(wParam) == IDC_LIST_ORDER || LOWORD(wParam) == IDC_UP || LOWORD(wParam) == IDC_DOWN) { - int pos = SendMessage(GetDlgItem(hwndDlg, IDC_LIST_ORDER), LB_GETCURSEL, 0, 0); + int pos = SendDlgItemMessage(hwndDlg, IDC_LIST_ORDER, LB_GETCURSEL, 0, 0); EnableWindow(GetDlgItem(hwndDlg, IDC_UP), pos != LB_ERR && pos > 0); EnableWindow(GetDlgItem(hwndDlg, IDC_DOWN), pos != LB_ERR && pos < 4); } @@ -598,7 +598,7 @@ static INT_PTR CALLBACK DlgProcItemSecondLineOpts(HWND hwndDlg, UINT msg, WPARAM if (tszText) SetWindowText(GetDlgItem(hwndDlg, IDC_VARIABLE_TEXT), tszText); } - SendMessage(GetDlgItem(hwndDlg, IDC_VARIABLE_TEXT), EM_SETLIMITTEXT, TEXT_TEXT_MAX_LENGTH, 0); + SendDlgItemMessage(hwndDlg, IDC_VARIABLE_TEXT, EM_SETLIMITTEXT, TEXT_TEXT_MAX_LENGTH, 0); { int radio = db_get_w(NULL, "CList", "SecondLineType", TEXT_STATUS_MESSAGE); CheckDlgButton(hwndDlg, IDC_STATUS, radio == TEXT_STATUS ? BST_CHECKED : BST_UNCHECKED); @@ -765,7 +765,7 @@ static INT_PTR CALLBACK DlgProcItemThirdLineOpts(HWND hwndDlg, UINT msg, WPARAM db_free(&dbv); } } - SendMessage(GetDlgItem(hwndDlg, IDC_VARIABLE_TEXT), EM_SETLIMITTEXT, TEXT_TEXT_MAX_LENGTH, 0); + SendDlgItemMessage(hwndDlg, IDC_VARIABLE_TEXT, EM_SETLIMITTEXT, TEXT_TEXT_MAX_LENGTH, 0); { int radio = db_get_w(NULL, "CList", "ThirdLineType", SETTING_THIRDLINE_TYPE_DEFAULT); CheckDlgButton(hwndDlg, IDC_STATUS, radio == TEXT_STATUS ? BST_CHECKED : BST_UNCHECKED); diff --git a/plugins/Clist_modern/src/modern_rowtemplateopt.cpp b/plugins/Clist_modern/src/modern_rowtemplateopt.cpp index 66581b5271..5984ee7514 100644 --- a/plugins/Clist_modern/src/modern_rowtemplateopt.cpp +++ b/plugins/Clist_modern/src/modern_rowtemplateopt.cpp @@ -410,14 +410,14 @@ INT_PTR CALLBACK DlgTmplEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM case IDC_CONTTYPE: if (HIWORD(wParam) == CBN_SELENDOK) { TVITEM tv = {0}; - int index = SendMessage(GetDlgItem(hwndDlg,IDC_CONTTYPE),CB_GETCURSEL, 0, 0); + int index = SendDlgItemMessage(hwndDlg, IDC_CONTTYPE, CB_GETCURSEL, 0, 0); cell->type = index; RefreshTree(hwndDlg,NULL); } case IDC_VALIGN: if (HIWORD(wParam) == CBN_SELENDOK) { - switch (SendMessage(GetDlgItem(hwndDlg,IDC_VALIGN),CB_GETCURSEL, 0, 0)) { + switch (SendDlgItemMessage(hwndDlg, IDC_VALIGN, CB_GETCURSEL, 0, 0)) { case 0: cell->valign = TC_TOP; break; @@ -433,7 +433,7 @@ INT_PTR CALLBACK DlgTmplEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM case IDC_HALIGN: if (HIWORD(wParam) == CBN_SELENDOK) { - switch (SendMessage(GetDlgItem(hwndDlg,IDC_HALIGN),CB_GETCURSEL, 0, 0)) { + switch (SendDlgItemMessage(hwndDlg, IDC_HALIGN, CB_GETCURSEL, 0, 0)) { case 0: cell->halign = TC_LEFT; break; diff --git a/plugins/Clist_modern/src/modern_viewmodebar.cpp b/plugins/Clist_modern/src/modern_viewmodebar.cpp index 89fc954076..ce779f492f 100644 --- a/plugins/Clist_modern/src/modern_viewmodebar.cpp +++ b/plugins/Clist_modern/src/modern_viewmodebar.cpp @@ -82,7 +82,7 @@ static int ViewModePaintCallbackProc(HWND hWnd, HDC hDC, RECT *rcPaint, HRGN rgn GetWindowRect(GetDlgItem(hWnd, _buttons[i]),&childRect); Offset.x = childRect.left-MyRect.left; Offset.y = childRect.top-MyRect.top; - SendMessage(GetDlgItem(hWnd, _buttons[i]),BUTTONDRAWINPARENT,(WPARAM)hDC,(LPARAM)&Offset); + SendDlgItemMessage(hWnd, _buttons[i], BUTTONDRAWINPARENT, (WPARAM)hDC, (LPARAM)&Offset); } return 0; @@ -439,7 +439,7 @@ void SaveState() statusMask |= (1 << (i - ID_STATUS_OFFLINE)); } - int iLen = SendMessage(GetDlgItem(clvmHwnd, IDC_VIEWMODES), LB_GETTEXTLEN, clvm_curItem, 0); + int iLen = SendDlgItemMessage(clvmHwnd, IDC_VIEWMODES, LB_GETTEXTLEN, clvm_curItem, 0); if (iLen) { unsigned int stickies = 0; @@ -688,10 +688,10 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP tci.mask = TCIF_PARAM | TCIF_TEXT; tci.lParam = 0; tci.pszText = TranslateT("Sticky contacts"); - SendMessage(GetDlgItem(hwndDlg, IDC_TAB), TCM_INSERTITEM, 0, (LPARAM)&tci); + SendDlgItemMessage(hwndDlg, IDC_TAB, TCM_INSERTITEM, 0, (LPARAM)&tci); tci.pszText = TranslateT("Filtering"); - SendMessage(GetDlgItem(hwndDlg, IDC_TAB), TCM_INSERTITEM, 0, (LPARAM)&tci); + SendDlgItemMessage(hwndDlg, IDC_TAB, TCM_INSERTITEM, 0, (LPARAM)&tci); TabCtrl_SetCurSel(GetDlgItem(hwndDlg, IDC_TAB), 0); @@ -1013,11 +1013,11 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM break; case WM_USER + 100: - SendMessage(GetDlgItem(hwnd, IDC_RESETMODES), MBM_SETICOLIBHANDLE, 0, - (LPARAM) RegisterIcolibIconHandle("CLN_CLVM_reset", LPGEN("Contact list"), LPGEN("Reset view mode"), NULL, 0, g_hInst, IDI_RESETVIEW )); + SendDlgItemMessage(hwnd, IDC_RESETMODES, MBM_SETICOLIBHANDLE, 0, + (LPARAM)RegisterIcolibIconHandle("CLN_CLVM_reset", LPGEN("Contact list"), LPGEN("Reset view mode"), NULL, 0, g_hInst, IDI_RESETVIEW)); - SendMessage(GetDlgItem(hwnd, IDC_CONFIGUREMODES), MBM_SETICOLIBHANDLE, 0, - (LPARAM) RegisterIcolibIconHandle("CLN_CLVM_set", LPGEN("Contact list"), LPGEN("Setup view modes"), NULL, 0, g_hInst, IDI_SETVIEW )); + SendDlgItemMessage(hwnd, IDC_CONFIGUREMODES, MBM_SETICOLIBHANDLE, 0, + (LPARAM)RegisterIcolibIconHandle("CLN_CLVM_set", LPGEN("Contact list"), LPGEN("Setup view modes"), NULL, 0, g_hInst, IDI_SETVIEW)); { for (int i=0; _buttons[i] != 0; i++) { @@ -1072,7 +1072,7 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM GetWindowRect(GetDlgItem(hwnd, _buttons[i]), &childRect); Offset.x = childRect.left - MyRect.left; Offset.y = childRect.top - MyRect.top; - SendMessage(GetDlgItem(hwnd, _buttons[i]), BUTTONDRAWINPARENT, (WPARAM)hdc2, (LPARAM)&Offset); + SendDlgItemMessage(hwnd, _buttons[i], BUTTONDRAWINPARENT, (WPARAM)hdc2, (LPARAM)&Offset); } BitBlt(hdc, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, hdc2, rc.left, rc.top, SRCCOPY); diff --git a/plugins/Clist_nicer/skineditor/src/main.cpp b/plugins/Clist_nicer/skineditor/src/main.cpp index 14dfea057e..c10ed40fb7 100644 --- a/plugins/Clist_nicer/skineditor/src/main.cpp +++ b/plugins/Clist_nicer/skineditor/src/main.cpp @@ -560,14 +560,14 @@ static void OnListItemsChange(HWND hwndDlg) SaveLatestChanges(hwndDlg); // set new selection - last_selcount = SendMessage(GetDlgItem(hwndDlg, IDC_ITEMS), LB_GETSELCOUNT, 0, 0); + last_selcount = SendDlgItemMessage(hwndDlg, IDC_ITEMS, LB_GETSELCOUNT, 0, 0); if (last_selcount > 0) { int n, itemData, first_item; - // get selected indizes - SendMessage(GetDlgItem(hwndDlg, IDC_ITEMS), LB_GETSELITEMS, 64, (LPARAM) last_indizes); + // get selected indizes + SendDlgItemMessage(hwndDlg, IDC_ITEMS, LB_GETSELITEMS, 64, (LPARAM) last_indizes); - // initialize with first items value + // initialize with first items value first_item = SendDlgItemMessage(hwndDlg, IDC_ITEMS, LB_GETITEMDATA, last_indizes[0], 0) - ID_EXTBK_FIRST; StatusItems_t *pFirst = StatusItems[first_item]; diff --git a/plugins/ConnectionNotify/src/ConnectionNotify.cpp b/plugins/ConnectionNotify/src/ConnectionNotify.cpp index 6138ba455f..981f552b06 100644 --- a/plugins/ConnectionNotify/src/ConnectionNotify.cpp +++ b/plugins/ConnectionNotify/src/ConnectionNotify.cpp @@ -266,7 +266,7 @@ static INT_PTR CALLBACK FilterEditProc(HWND hWnd, UINT message, WPARAM wParam, L GetDlgItemText(hWnd, ID_TXT_REMOTE_IP, connCurrentEditModal->strExtIp, SIZEOF(connCurrentEditModal->strExtIp)); GetDlgItemText(hWnd, ID_TEXT_NAME, connCurrentEditModal->PName, SIZEOF(connCurrentEditModal->PName)); - connCurrentEditModal->Pid=!(BOOL)SendMessage(GetDlgItem(hWnd,ID_CBO_ACTION),CB_GETCURSEL, 0, 0); + connCurrentEditModal->Pid = !(BOOL)SendDlgItemMessage(hWnd, ID_CBO_ACTION, CB_GETCURSEL, 0, 0); connCurrentEditModal=NULL; EndDialog(hWnd,IDOK); diff --git a/plugins/ConnectionNotify/src/filter.cpp b/plugins/ConnectionNotify/src/filter.cpp index 9cccb4fc8c..9e5ba6933a 100644 --- a/plugins/ConnectionNotify/src/filter.cpp +++ b/plugins/ConnectionNotify/src/filter.cpp @@ -110,8 +110,8 @@ static INT_PTR CALLBACK ConnectionFilterEditProc(HWND hWnd, UINT message, WPARAM GetDlgItemText(hWnd, ID_TXT_REMOTE_IP, connCurrentEdit->strExtIp, SIZEOF(connCurrentEdit->strExtIp)); GetDlgItemText(hWnd, ID_TEXT_NAME, connCurrentEdit->PName, SIZEOF(connCurrentEdit->PName)); - connCurrentEdit->Pid=!(BOOL)SendMessage(GetDlgItem(hWnd,ID_CBO_ACTION),CB_GETCURSEL, 0, 0); - connCurrentEdit=NULL; + connCurrentEdit->Pid = !(BOOL)SendDlgItemMessage(hWnd, ID_CBO_ACTION, CB_GETCURSEL, 0, 0); + connCurrentEdit = NULL; saveSettingsConnections(connExceptions); ReleaseMutex(hExceptionsMutex); } diff --git a/plugins/ContactsPlus/src/receive.cpp b/plugins/ContactsPlus/src/receive.cpp index 7cc55f8eaa..02ba5fb8c7 100644 --- a/plugins/ContactsPlus/src/receive.cpp +++ b/plugins/ContactsPlus/src/receive.cpp @@ -98,7 +98,7 @@ static TCHAR* ListView_GetItemTextEx(HWND hLV, int iItem, int iSubItem) static void EnableGroupCombo(HWND hwndDlg) { - EnableDlgItem(hwndDlg, IDC_GROUPS, SendMessage(GetDlgItem(hwndDlg, IDC_ENABLEGROUPS), BM_GETCHECK, 0, 0)); + EnableDlgItem(hwndDlg, IDC_GROUPS, SendDlgItemMessage(hwndDlg, IDC_ENABLEGROUPS, BM_GETCHECK, 0, 0)); } static void RebuildGroupCombo(HWND hwndDlg) @@ -192,7 +192,7 @@ INT_PTR CALLBACK RecvDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara RecvListView_AddColumn(hLV, 100, TranslateT("Last Name"), 3); // fill in groups - SendMessage(GetDlgItem(hwndDlg, IDC_ENABLEGROUPS), BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0); + SendDlgItemMessage(hwndDlg, IDC_ENABLEGROUPS, BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0); RebuildGroupCombo(hwndDlg); { // fill listview with received contacts diff --git a/plugins/Db3x_mmap/src/ui.cpp b/plugins/Db3x_mmap/src/ui.cpp index e1c4e6e429..34d7efefd4 100644 --- a/plugins/Db3x_mmap/src/ui.cpp +++ b/plugins/Db3x_mmap/src/ui.cpp @@ -63,7 +63,7 @@ static INT_PTR CALLBACK sttEnterPassword(HWND hwndDlg, UINT uMsg, WPARAM wParam, switch (uMsg) { case WM_INITDIALOG: TranslateDialogDefault(hwndDlg); - SendMessage(GetDlgItem(hwndDlg, IDC_HEADERBAR), WM_SETICON, ICON_SMALL, (LPARAM)LoadIcon(g_hInst, MAKEINTRESOURCE(iconList[0].defIconID))); + SendDlgItemMessage(hwndDlg, IDC_HEADERBAR, WM_SETICON, ICON_SMALL, (LPARAM)LoadIcon(g_hInst, MAKEINTRESOURCE(iconList[0].defIconID))); param = (DlgChangePassParam*)lParam; SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam); @@ -160,7 +160,7 @@ static INT_PTR CALLBACK sttChangePassword(HWND hwndDlg, UINT uMsg, WPARAM wParam switch (uMsg) { case WM_INITDIALOG: TranslateDialogDefault(hwndDlg); - SendMessage(GetDlgItem(hwndDlg, IDC_HEADERBAR), WM_SETICON, ICON_SMALL, (LPARAM)Skin_GetIconByHandle(iconList[0].hIcolib, true)); + SendDlgItemMessage(hwndDlg, IDC_HEADERBAR, WM_SETICON, ICON_SMALL, (LPARAM)Skin_GetIconByHandle(iconList[0].hIcolib, true)); param = (DlgChangePassParam*)lParam; SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam); diff --git a/plugins/DbEditorPP/src/copymodule.cpp b/plugins/DbEditorPP/src/copymodule.cpp index 3f9dbfa4f9..d39f72933c 100644 --- a/plugins/DbEditorPP/src/copymodule.cpp +++ b/plugins/DbEditorPP/src/copymodule.cpp @@ -84,9 +84,9 @@ INT_PTR CALLBACK copyModDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara SendMessageW(GetDlgItem(hwnd, IDC_CONTACTS), CB_SETITEMDATA, index, hContact); } - index = (int)SendMessage(GetDlgItem(hwnd, IDC_CONTACTS), CB_INSERTSTRING, 0, (LPARAM)(char*)Translate("Settings")); - SendMessage(GetDlgItem(hwnd, IDC_CONTACTS), CB_SETITEMDATA, index, 0); - SendMessage(GetDlgItem(hwnd, IDC_CONTACTS), CB_SETCURSEL, index, 0); + index = (int)SendDlgItemMessage(hwnd, IDC_CONTACTS, CB_INSERTSTRING, 0, (LPARAM)(char*)Translate("Settings")); + SendDlgItemMessage(hwnd, IDC_CONTACTS, CB_SETITEMDATA, index, 0); + SendDlgItemMessage(hwnd, IDC_CONTACTS, CB_SETCURSEL, index, 0); SetWindowLongPtr(hwnd,GWLP_USERDATA,lParam); TranslateDialogDefault(hwnd); @@ -100,7 +100,7 @@ INT_PTR CALLBACK copyModDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara case IDOK: if (!IsDlgButtonChecked(hwnd,CHK_COPY2ALL)) { - MCONTACT hContact = (MCONTACT)SendMessage(GetDlgItem(hwnd, IDC_CONTACTS), CB_GETITEMDATA, SendMessage(GetDlgItem(hwnd, IDC_CONTACTS), CB_GETCURSEL, 0, 0), 0); + MCONTACT hContact = (MCONTACT)SendDlgItemMessage(hwnd, IDC_CONTACTS, CB_GETITEMDATA, SendDlgItemMessage(hwnd, IDC_CONTACTS, CB_GETCURSEL, 0, 0), 0); copyModule(mac->module, mac->hContact, hContact); } else { diff --git a/plugins/DbEditorPP/src/findwindow.cpp b/plugins/DbEditorPP/src/findwindow.cpp index 783e222ffe..1c4c46fbed 100644 --- a/plugins/DbEditorPP/src/findwindow.cpp +++ b/plugins/DbEditorPP/src/findwindow.cpp @@ -57,7 +57,7 @@ INT_PTR CALLBACK FindWindowDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP switch (msg) { case WM_INITDIALOG: TranslateDialogDefault(hwnd); - SendMessage(GetDlgItem(hwnd, IDC_SBAR), SB_SETTEXT, 0, (LPARAM)Translate("Enter a string to search the database for")); + SendDlgItemMessage(hwnd, IDC_SBAR, SB_SETTEXT, 0, (LPARAM)Translate("Enter a string to search the database for")); CheckDlgButton(hwnd, IDC_MODNAME, 1); CheckDlgButton(hwnd, IDC_SETTINGNAME, 1); CheckDlgButton(hwnd, IDC_SETTINGVALUE, 1); @@ -490,7 +490,7 @@ void __cdecl FindSettings(LPVOID di) return; } - SendMessage(GetDlgItem(GetParent(hwnd), IDC_SBAR), SB_SETTEXT, 0, (LPARAM)Translate("Searching...")); + SendDlgItemMessage(GetParent(hwnd), IDC_SBAR, SB_SETTEXT, 0, (LPARAM)Translate("Searching...")); hContact = 0; @@ -618,7 +618,7 @@ void __cdecl FindSettings(LPVOID di) } else mir_snprintf(szTmp, SIZEOF(szTmp), Translate("Finished. %d items were found."), foundCount); - SendMessage(GetDlgItem(prnthwnd, IDC_SBAR), SB_SETTEXT, 0, (LPARAM)szTmp); + SendDlgItemMessage(prnthwnd, IDC_SBAR, SB_SETTEXT, 0, (LPARAM)szTmp); SetWindowLongPtr(GetDlgItem(prnthwnd, IDC_SEARCH), GWLP_USERDATA, 0); diff --git a/plugins/DbEditorPP/src/settinglist.cpp b/plugins/DbEditorPP/src/settinglist.cpp index 51c93605ae..ef4bedafb4 100644 --- a/plugins/DbEditorPP/src/settinglist.cpp +++ b/plugins/DbEditorPP/src/settinglist.cpp @@ -347,7 +347,7 @@ static LRESULT CALLBACK SettingLabelEditSubClassProc(HWND hwnd,UINT msg,WPARAM w switch (LOWORD(wParam)) { case IDOK: { - int len = GetWindowTextLengthA(hwnd) + 1; + int len = GetWindowTextLength(hwnd) + 1; char *value = (char*)_alloca(len); WCHAR *wc = NULL; DBVARIANT dbv = { 0 }; diff --git a/plugins/Db_autobackups/src/backup.cpp b/plugins/Db_autobackups/src/backup.cpp index 792b02bdba..f9c6331ab2 100644 --- a/plugins/Db_autobackups/src/backup.cpp +++ b/plugins/Db_autobackups/src/backup.cpp @@ -46,7 +46,7 @@ INT_PTR CALLBACK DlgProcProgress(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l switch (msg) { case WM_INITDIALOG: TranslateDialogDefault(hwndDlg); - SendMessage(GetDlgItem(hwndDlg, IDC_PROGRESS), PBM_SETPOS, 0, 0); + SendDlgItemMessage(hwndDlg, IDC_PROGRESS, PBM_SETPOS, 0, 0); break; case WM_COMMAND: if (HIWORD(wParam) != BN_CLICKED || LOWORD(wParam) != IDCANCEL) @@ -263,7 +263,7 @@ int Backup(TCHAR* backup_filename) SetFileTime(hFile, NULL, NULL, &ft); CloseHandle(hFile); } - SendMessage(GetDlgItem(progress_dialog, IDC_PROGRESS), PBM_SETPOS, (WPARAM)(100), 0); + SendDlgItemMessage(progress_dialog, IDC_PROGRESS, PBM_SETPOS, (WPARAM)(100), 0); UpdateWindow(progress_dialog); db_set_dw(0, "AutoBackups", "LastBackupTimestamp", (DWORD)time(0)); if (!options.disable_popups) { diff --git a/plugins/Db_autobackups/src/options.cpp b/plugins/Db_autobackups/src/options.cpp index c72d69e617..4f246787cd 100644 --- a/plugins/Db_autobackups/src/options.cpp +++ b/plugins/Db_autobackups/src/options.cpp @@ -201,10 +201,10 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP SetDlgState(hwndDlg); - SendMessage(GetDlgItem(hwndDlg, IDC_PT), CB_ADDSTRING, 0, (LPARAM) TranslateT("days")); - SendMessage(GetDlgItem(hwndDlg, IDC_PT), CB_ADDSTRING, 0, (LPARAM) TranslateT("hours")); - SendMessage(GetDlgItem(hwndDlg, IDC_PT), CB_ADDSTRING, 0, (LPARAM) TranslateT("minutes")); - switch(new_options.period_type){ + SendDlgItemMessage(hwndDlg, IDC_PT, CB_ADDSTRING, 0, (LPARAM) TranslateT("days")); + SendDlgItemMessage(hwndDlg, IDC_PT, CB_ADDSTRING, 0, (LPARAM) TranslateT("hours")); + SendDlgItemMessage(hwndDlg, IDC_PT, CB_ADDSTRING, 0, (LPARAM) TranslateT("minutes")); + switch (new_options.period_type) { case PT_DAYS: SendDlgItemMessage(hwndDlg, IDC_PT, CB_SETCURSEL, 0, 0); break; case PT_HOURS: SendDlgItemMessage(hwndDlg, IDC_PT, CB_SETCURSEL, 1, 0); break; case PT_MINUTES: SendDlgItemMessage(hwndDlg, IDC_PT, CB_SETCURSEL, 2, 0); break; diff --git a/plugins/FTPFileYM/src/dialog.cpp b/plugins/FTPFileYM/src/dialog.cpp index ff2626e520..d945d55f85 100644 --- a/plugins/FTPFileYM/src/dialog.cpp +++ b/plugins/FTPFileYM/src/dialog.cpp @@ -175,20 +175,20 @@ INT_PTR CALLBACK UploadDialog::UploadDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar mir_subclassWindow(GetDlgItem(hwndDlg, IDC_TAB), TabControlProc); LOGFONT logFont = {0}; - HFONT hFont = (HFONT)SendMessage(GetDlgItem(hwndDlg, IDC_ST_FILE), WM_GETFONT, 0, 0); + HFONT hFont = (HFONT)SendDlgItemMessage(hwndDlg, IDC_ST_FILE, WM_GETFONT, 0, 0); GetObject(hFont, sizeof(logFont), &logFont); logFont.lfWeight = FW_BOLD; hFont = CreateFontIndirect(&logFont); - SendMessage(GetDlgItem(hwndDlg, IDC_ST_CONTACT), WM_SETFONT, (WPARAM)hFont, 0); - SendMessage(GetDlgItem(hwndDlg, IDC_ST_FILE), WM_SETFONT, (WPARAM)hFont, 0); - SendMessage(GetDlgItem(hwndDlg, IDC_ST_SERVER), WM_SETFONT, (WPARAM)hFont, 0); - SendMessage(GetDlgItem(hwndDlg, IDC_ST_SPEED), WM_SETFONT, (WPARAM)hFont, 0); - SendMessage(GetDlgItem(hwndDlg, IDC_ST_COMPLETED), WM_SETFONT, (WPARAM)hFont, 0); - SendMessage(GetDlgItem(hwndDlg, IDC_ST_REMAIN), WM_SETFONT, (WPARAM)hFont, 0); + SendDlgItemMessage(hwndDlg, IDC_ST_CONTACT, WM_SETFONT, (WPARAM)hFont, 0); + SendDlgItemMessage(hwndDlg, IDC_ST_FILE, WM_SETFONT, (WPARAM)hFont, 0); + SendDlgItemMessage(hwndDlg, IDC_ST_SERVER, WM_SETFONT, (WPARAM)hFont, 0); + SendDlgItemMessage(hwndDlg, IDC_ST_SPEED, WM_SETFONT, (WPARAM)hFont, 0); + SendDlgItemMessage(hwndDlg, IDC_ST_COMPLETED, WM_SETFONT, (WPARAM)hFont, 0); + SendDlgItemMessage(hwndDlg, IDC_ST_REMAIN, WM_SETFONT, (WPARAM)hFont, 0); logFont.lfHeight -= 4; hFont = CreateFontIndirect(&logFont); - SendMessage(GetDlgItem(hwndDlg, IDC_UP_CONTACT), WM_SETFONT, (WPARAM)hFont, 0); + SendDlgItemMessage(hwndDlg, IDC_UP_CONTACT, WM_SETFONT, (WPARAM)hFont, 0); SendDlgItemMessage(hwndDlg, IDC_BTN_PROTO, BUTTONSETASFLATBTN, 0, 0); SendDlgItemMessage(hwndDlg, IDC_BTN_PROTO, BUTTONADDTOOLTIP, (WPARAM)TranslateT("User Info"), BATF_TCHAR); diff --git a/plugins/FavContacts/src/options.cpp b/plugins/FavContacts/src/options.cpp index 4824d54eb8..2dc5ac89b1 100644 --- a/plugins/FavContacts/src/options.cpp +++ b/plugins/FavContacts/src/options.cpp @@ -86,7 +86,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA SetWindowLongPtr(GetDlgItem(hwnd, IDC_CLIST), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwnd, IDC_CLIST), GWL_STYLE) | CLS_CHECKBOXES | CLS_HIDEEMPTYGROUPS | CLS_USEGROUPS | CLS_GREYALTERNATE | CLS_GROUPCHECKBOXES); - SendMessage(GetDlgItem(hwnd, IDC_CLIST), CLM_SETEXSTYLE, CLS_EX_DISABLEDRAGDROP | CLS_EX_TRACKSELECT, 0); + SendDlgItemMessage(hwnd, IDC_CLIST, CLM_SETEXSTYLE, CLS_EX_DISABLEDRAGDROP | CLS_EX_TRACKSELECT, 0); sttResetListOptions(GetDlgItem(hwnd, IDC_CLIST)); hSelectedContact = db_find_first(); diff --git a/plugins/HTTPServer/src/GuiElements.cpp b/plugins/HTTPServer/src/GuiElements.cpp index 446e5bcaea..f2deece63b 100644 --- a/plugins/HTTPServer/src/GuiElements.cpp +++ b/plugins/HTTPServer/src/GuiElements.cpp @@ -259,9 +259,9 @@ UINT_PTR CALLBACK ShareNewFileDialogHook( pstShare = (STFileShareInfo *)((OPENFILENAME *)lParam)->lCustData; SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)pstShare); - SetDlgItemInt(hDlg, IDC_MAX_DOWNLOADS, pstShare->nMaxDownloads, true); - SendMessage(GetDlgItem(hDlg, IDC_ALLOWED_IPADDRESS), IPM_SETADDRESS, 0, pstShare->dwAllowedIP); - SendMessage(GetDlgItem(hDlg, IDC_ALLOWED_IP_MASK), IPM_SETADDRESS, 0, pstShare->dwAllowedMask); + SetDlgItemInt(hDlg, IDC_MAX_DOWNLOADS, pstShare->nMaxDownloads, TRUE); + SendDlgItemMessage(hDlg, IDC_ALLOWED_IPADDRESS, IPM_SETADDRESS, 0, pstShare->dwAllowedIP); + SendDlgItemMessage(hDlg, IDC_ALLOWED_IP_MASK, IPM_SETADDRESS, 0, pstShare->dwAllowedMask); if (*pstShare->pszSrvPath) nInit = 2; @@ -364,8 +364,8 @@ UINT_PTR CALLBACK ShareNewFileDialogHook( if (pstShare->nMaxDownloads <= 0 && pstShare->nMaxDownloads != -1) bTranslated = false; - SendMessage(GetDlgItem(hDlg, IDC_ALLOWED_IPADDRESS), IPM_GETADDRESS, 0, (LPARAM)&(pstShare->dwAllowedIP)); - SendMessage(GetDlgItem(hDlg, IDC_ALLOWED_IP_MASK), IPM_GETADDRESS, 0, (LPARAM)&(pstShare->dwAllowedMask)); + SendDlgItemMessage(hDlg, IDC_ALLOWED_IPADDRESS, IPM_GETADDRESS, 0, (LPARAM)&(pstShare->dwAllowedIP)); + SendDlgItemMessage(hDlg, IDC_ALLOWED_IP_MASK, IPM_GETADDRESS, 0, (LPARAM)&(pstShare->dwAllowedMask)); //if( ! (pstShare->dwAllowedIP & pstShare->dwAllowedMask) @@ -406,8 +406,8 @@ UINT_PTR CALLBACK ShareNewFileDialogHook( switch (LOWORD(wParam)) { case IDC_TOGGLE_MASK: { DWORD dwCur; - SendMessage(GetDlgItem(hDlg, IDC_ALLOWED_IP_MASK), IPM_GETADDRESS, 0, (LPARAM)&dwCur); - SendMessage(GetDlgItem(hDlg, IDC_ALLOWED_IP_MASK), IPM_SETADDRESS, 0, (LPARAM) dwCur == 0xFFFFFFFF ? 0 : 0xFFFFFFFF); + SendDlgItemMessage(hDlg, IDC_ALLOWED_IP_MASK, IPM_GETADDRESS, 0, (LPARAM)&dwCur); + SendDlgItemMessage(hDlg, IDC_ALLOWED_IP_MASK, IPM_SETADDRESS, 0, (LPARAM) dwCur == 0xFFFFFFFF ? 0 : 0xFFFFFFFF); return TRUE; } } diff --git a/plugins/HistoryLinkListPlus/src/linklist_fct.cpp b/plugins/HistoryLinkListPlus/src/linklist_fct.cpp index 16725d987b..aa1d6d5357 100644 --- a/plugins/HistoryLinkListPlus/src/linklist_fct.cpp +++ b/plugins/HistoryLinkListPlus/src/linklist_fct.cpp @@ -342,8 +342,8 @@ void WriteLinkList(HWND hDlg, BYTE params, LISTELEMENT *listStart, LPCTSTR searc } gtl.flags = GTL_PRECISE; gtl.codepage = CP_ACP; - sel.cpMin = sel.cpMax = SendMessage(GetDlgItem(hDlg, IDC_MAIN), EM_GETTEXTLENGTHEX, (WPARAM)>l, 0); - SendMessage(GetDlgItem(hDlg, IDC_MAIN), EM_EXSETSEL, 0, (LPARAM) &sel); + sel.cpMin = sel.cpMax = SendDlgItemMessage(hDlg, IDC_MAIN, EM_GETTEXTLENGTHEX, (WPARAM)>l, 0); + SendDlgItemMessage(hDlg, IDC_MAIN, EM_EXSETSEL, 0, (LPARAM) &sel); } if ( append == 0 ) diff --git a/plugins/IEHistory/src/dlgHandlers.cpp b/plugins/IEHistory/src/dlgHandlers.cpp index 2272427fbe..661f2440b4 100644 --- a/plugins/IEHistory/src/dlgHandlers.cpp +++ b/plugins/IEHistory/src/dlgHandlers.cpp @@ -579,9 +579,9 @@ INT_PTR CALLBACK SearchDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam TCITEM tabItem = { 0 }; tabItem.pszText = TranslateT("Text search"); tabItem.mask = TCIF_TEXT; - SendMessage(GetDlgItem(hWnd, IDC_TABS), TCM_INSERTITEM, 0, (LPARAM)&tabItem); + SendDlgItemMessage(hWnd, IDC_TABS, TCM_INSERTITEM, 0, (LPARAM)&tabItem); tabItem.pszText = TranslateT("Time search"); - SendMessage(GetDlgItem(hWnd, IDC_TABS), TCM_INSERTITEM, 1, (LPARAM)&tabItem); + SendDlgItemMessage(hWnd, IDC_TABS, TCM_INSERTITEM, 1, (LPARAM)&tabItem); } CheckDlgButton(hWnd, IDC_DIRECTION_DOWN, TRUE); @@ -609,11 +609,11 @@ INT_PTR CALLBACK SearchDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam case IDC_TABS: switch (((LPNMHDR)lParam)->code) { case TCN_SELCHANGE: - int tab = SendMessage(GetDlgItem(hWnd, IDC_TABS), TCM_GETCURSEL, 0, 0); + int tab = SendDlgItemMessage(hWnd, IDC_TABS, TCM_GETCURSEL, 0, 0); ShowWindow(GetDlgItem(hWnd, IDC_SEARCH_DATE), (tab == 1) ? SW_SHOW : SW_HIDE); ShowWindow(GetDlgItem(hWnd, IDC_SEARCH_TIME), (tab == 1) ? SW_SHOW : SW_HIDE); ShowWindow(GetDlgItem(hWnd, IDC_SEARCH_TEXT), (tab == 0) ? SW_SHOW : SW_HIDE); - SendMessage(GetDlgItem(hWnd, IDC_SEARCH_TEXT_STATIC), WM_SETTEXT, 0, (LPARAM)((tab == 0) ? TranslateT("Text:") : TranslateT("Time:"))); + SendDlgItemMessage(hWnd, IDC_SEARCH_TEXT_STATIC, WM_SETTEXT, 0, (LPARAM)((tab == 0) ? TranslateT("Text:") : TranslateT("Time:"))); break; } break; @@ -637,7 +637,7 @@ INT_PTR CALLBACK SearchDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam case IDC_FIND_NEXT: const HistoryWindowData *histData = (HistoryWindowData *)GetWindowLongPtr(data->hHistoryWindow, DWLP_USER); int direction = IsDlgButtonChecked(hWnd, IDC_DIRECTION_UP) ? DIRECTION_BACK : DIRECTION_FORWARD; - int tab = SendMessage(GetDlgItem(hWnd, IDC_TABS), TCM_GETCURSEL, 0, 0); + int tab = SendDlgItemMessage(hWnd, IDC_TABS, TCM_GETCURSEL, 0, 0); int type = (tab == 0) ? SEARCH_TEXT : SEARCH_TIME; SearchResult searchResult; if (data->hLastFoundEvent == NULL) @@ -647,15 +647,15 @@ INT_PTR CALLBACK SearchDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam if (type == SEARCH_TEXT) { //text search TCHAR text[2048]; //TODO buffer overrun - SendMessage(GetDlgItem(hWnd, IDC_SEARCH_TEXT), WM_GETTEXT, SIZEOF(text), (LPARAM)text); + SendDlgItemMessage(hWnd, IDC_SEARCH_TEXT, WM_GETTEXT, SIZEOF(text), (LPARAM)text); searchResult = SearchHistory(data->contact, data->hLastFoundEvent, text, direction, type); } else { //time search TimeSearchData tsData = { 0 }; SYSTEMTIME date = { 0 }, time = { 0 }; - int res = SendMessage(GetDlgItem(hWnd, IDC_SEARCH_DATE), DTM_GETSYSTEMTIME, 0, (LPARAM)&date); + int res = SendDlgItemMessage(hWnd, IDC_SEARCH_DATE, DTM_GETSYSTEMTIME, 0, (LPARAM)&date); tsData.flags = (res == GDT_VALID) ? TSDF_DATE_SET : 0; - res = SendMessage(GetDlgItem(hWnd, IDC_SEARCH_TIME), DTM_GETSYSTEMTIME, 0, (LPARAM)&time); + res = SendDlgItemMessage(hWnd, IDC_SEARCH_TIME, DTM_GETSYSTEMTIME, 0, (LPARAM)&time); if (res == GDT_VALID) { tsData.flags |= TSDF_TIME_SET; date.wHour = time.wHour; diff --git a/plugins/MirOTR/MirOTR/src/options.cpp b/plugins/MirOTR/MirOTR/src/options.cpp index af81ed63fe..61db53aaf1 100644 --- a/plugins/MirOTR/MirOTR/src/options.cpp +++ b/plugins/MirOTR/MirOTR/src/options.cpp @@ -320,7 +320,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsProto(HWND hwndDlg, UINT msg, WPARAM wP SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateT(LANG_POLICY_OPP)); SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateT(LANG_POLICY_MANUAL)); SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateT(LANG_POLICY_NEVER)); - SendMessage(GetDlgItem(hwndDlg, IDC_CMB_PROTO_POLICY), CB_SETCURSEL, (LPARAM)-1, 0); + SendDlgItemMessage(hwndDlg, IDC_CMB_PROTO_POLICY, CB_SETCURSEL, (LPARAM)-1, 0); EnableWindow(GetDlgItem(hwndDlg, IDC_CMB_PROTO_POLICY), FALSE); EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_PROTO_NEWKEY), FALSE); EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_PROTO_FORGET), FALSE); @@ -451,7 +451,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsProto(HWND hwndDlg, UINT msg, WPARAM wP && (((LPNMLISTVIEW)lParam)->uNewState & LVIS_SELECTED )) { int sel = ListView_GetSelectionMark(((LPNMHDR) lParam)->hwndFrom); if (sel == -1) { - SendMessage(GetDlgItem(hwndDlg, IDC_CMB_PROTO_POLICY), CB_SETCURSEL, (LPARAM)-1, 0); + SendDlgItemMessage(hwndDlg, IDC_CMB_PROTO_POLICY, CB_SETCURSEL, (LPARAM)-1, 0); EnableWindow(GetDlgItem(hwndDlg, IDC_CMB_PROTO_POLICY), FALSE); EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_PROTO_NEWKEY), FALSE); EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_PROTO_FORGET), FALSE); @@ -461,7 +461,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsProto(HWND hwndDlg, UINT msg, WPARAM wP EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_PROTO_FORGET), TRUE); TCHAR buff[50]; ListView_GetItemText(((LPNMHDR)lParam)->hwndFrom, sel, 1, buff, SIZEOF(buff)); - SendMessage(GetDlgItem(hwndDlg, IDC_CMB_PROTO_POLICY), CB_SELECTSTRING, (LPARAM)-1, (WPARAM)buff); + SendDlgItemMessage(hwndDlg, IDC_CMB_PROTO_POLICY, CB_SELECTSTRING, (LPARAM)-1, (WPARAM)buff); } } else if (((LPNMHDR)lParam)->code == (UINT) PSN_APPLY ) { @@ -629,13 +629,13 @@ static INT_PTR CALLBACK DlgProcMirOTROptsContacts(HWND hwndDlg, UINT msg, WPARAM if (code == (UINT) LVN_ITEMCHANGED && (((LPNMLISTVIEW)lParam)->uNewState & LVIS_SELECTED )) { int sel = ListView_GetSelectionMark(((LPNMHDR) lParam)->hwndFrom); if (sel == -1) { - SendMessage(GetDlgItem(hwndDlg, IDC_CMB_CONT_POLICY), CB_SETCURSEL, (LPARAM)-1, 0); + SendDlgItemMessage(hwndDlg, IDC_CMB_CONT_POLICY, CB_SETCURSEL, (LPARAM)-1, 0); EnableWindow(GetDlgItem(hwndDlg, IDC_CMB_CONT_POLICY), FALSE); } else { EnableWindow(GetDlgItem(hwndDlg, IDC_CMB_CONT_POLICY), TRUE); TCHAR buff[50]; ListView_GetItemText(((LPNMHDR)lParam)->hwndFrom, sel, 2, buff, SIZEOF(buff)); - SendMessage(GetDlgItem(hwndDlg, IDC_CMB_CONT_POLICY), CB_SELECTSTRING, (LPARAM)-1, (WPARAM)buff); + SendDlgItemMessage(hwndDlg, IDC_CMB_CONT_POLICY, CB_SELECTSTRING, (LPARAM)-1, (WPARAM)buff); } } else if (code == (UINT) NM_CLICK) { if (((LPNMLISTVIEW)lParam)->iSubItem == 3) { diff --git a/plugins/MyDetails/src/services.cpp b/plugins/MyDetails/src/services.cpp index c613b35763..a8ea0b9e70 100644 --- a/plugins/MyDetails/src/services.cpp +++ b/plugins/MyDetails/src/services.cpp @@ -34,7 +34,7 @@ static INT_PTR CALLBACK DlgProcSetNickname(HWND hwndDlg, UINT msg, WPARAM wParam switch (msg) { case WM_INITDIALOG: TranslateDialogDefault(hwndDlg); - SendMessage(GetDlgItem(hwndDlg, IDC_NICKNAME), EM_LIMITTEXT, MS_MYDETAILS_GETMYNICKNAME_BUFFER_SIZE - 1, 0); + SendDlgItemMessage(hwndDlg, IDC_NICKNAME, EM_LIMITTEXT, MS_MYDETAILS_GETMYNICKNAME_BUFFER_SIZE - 1, 0); return TRUE; case WMU_SETDATA: @@ -318,7 +318,7 @@ static INT_PTR CALLBACK DlgProcSetStatusMessage(HWND hwndDlg, UINT msg, WPARAM w switch (msg) { case WM_INITDIALOG: TranslateDialogDefault(hwndDlg); - SendMessage(GetDlgItem(hwndDlg, IDC_STATUSMESSAGE), EM_LIMITTEXT, MS_MYDETAILS_GETMYSTATUSMESSAGE_BUFFER_SIZE - 1, 0); + SendDlgItemMessage(hwndDlg, IDC_STATUSMESSAGE, EM_LIMITTEXT, MS_MYDETAILS_GETMYSTATUSMESSAGE_BUFFER_SIZE - 1, 0); mir_subclassWindow(GetDlgItem(hwndDlg, IDC_STATUSMESSAGE), StatusMsgEditSubclassProc); return TRUE; diff --git a/plugins/NewAwaySysMod/src/AwayOpt.cpp b/plugins/NewAwaySysMod/src/AwayOpt.cpp index 4cc1ebff71..f621c378e8 100644 --- a/plugins/NewAwaySysMod/src/AwayOpt.cpp +++ b/plugins/NewAwaySysMod/src/AwayOpt.cpp @@ -135,8 +135,8 @@ static INT_PTR CALLBACK MessagesOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LP MySetPos(hwndDlg); ChangeLock++; g_MessagesOptPage.SetWnd(hwndDlg); - SendMessage(GetDlgItem(hwndDlg, IDC_MESSAGEDLG_MSGTITLE), EM_LIMITTEXT, TREEITEMTITLE_MAXLEN, 0); - SendMessage(GetDlgItem(hwndDlg, IDC_MESSAGEDLG_MSGDATA), EM_LIMITTEXT, AWAY_MSGDATA_MAX, 0); + SendDlgItemMessage(hwndDlg, IDC_MESSAGEDLG_MSGTITLE, EM_LIMITTEXT, TREEITEMTITLE_MAXLEN, 0); + SendDlgItemMessage(hwndDlg, IDC_MESSAGEDLG_MSGDATA, EM_LIMITTEXT, AWAY_MSGDATA_MAX, 0); // init image buttons for (int i = 0; i < SIZEOF(Dlg1Buttons); i++) { HWND hButton = GetDlgItem(hwndDlg, Dlg1Buttons[i].DlgItem); @@ -536,9 +536,9 @@ INT_PTR CALLBACK AutoreplyOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l SendMessage(hButton, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Open Variables help dialog"), BATF_TCHAR); SendMessage(hButton, BUTTONSETASFLATBTN, TRUE, 0); - SendMessage(GetDlgItem(hwndDlg, IDC_MOREOPTDLG_EVNTMSG), BUTTONSETASTHEMEDBTN, TRUE, 0); - SendMessage(GetDlgItem(hwndDlg, IDC_MOREOPTDLG_EVNTURL), BUTTONSETASTHEMEDBTN, TRUE, 0); - SendMessage(GetDlgItem(hwndDlg, IDC_MOREOPTDLG_EVNTFILE), BUTTONSETASTHEMEDBTN, TRUE, 0); + SendDlgItemMessage(hwndDlg, IDC_MOREOPTDLG_EVNTMSG, BUTTONSETASTHEMEDBTN, TRUE, 0); + SendDlgItemMessage(hwndDlg, IDC_MOREOPTDLG_EVNTURL, BUTTONSETASTHEMEDBTN, TRUE, 0); + SendDlgItemMessage(hwndDlg, IDC_MOREOPTDLG_EVNTFILE, BUTTONSETASTHEMEDBTN, TRUE, 0); SendMessage(hwndDlg, UM_ICONSCHANGED, 0, 0); // init tooltips @@ -689,8 +689,8 @@ INT_PTR CALLBACK MessagesModernOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPA MySetPos(hwndDlg); ChangeLock++; g_MessagesOptPage.SetWnd(hwndDlg); - SendMessage(GetDlgItem(hwndDlg, IDC_MESSAGEDLG_MSGTITLE), EM_LIMITTEXT, TREEITEMTITLE_MAXLEN, 0); - SendMessage(GetDlgItem(hwndDlg, IDC_MESSAGEDLG_MSGDATA), EM_LIMITTEXT, AWAY_MSGDATA_MAX, 0); + SendDlgItemMessage(hwndDlg, IDC_MESSAGEDLG_MSGTITLE, EM_LIMITTEXT, TREEITEMTITLE_MAXLEN, 0); + SendDlgItemMessage(hwndDlg, IDC_MESSAGEDLG_MSGDATA, EM_LIMITTEXT, AWAY_MSGDATA_MAX, 0); // init image buttons for (int i = 0; i < SIZEOF(Dlg4Buttons); i++) { diff --git a/plugins/NewXstatusNotify/src/indsnd.cpp b/plugins/NewXstatusNotify/src/indsnd.cpp index b9a8278cc2..8acd14a4bb 100644 --- a/plugins/NewXstatusNotify/src/indsnd.cpp +++ b/plugins/NewXstatusNotify/src/indsnd.cpp @@ -587,7 +587,7 @@ INT_PTR CALLBACK DlgProcFiltering(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM break; case WM_DESTROY: - HIMAGELIST hImageList = (HIMAGELIST)SendMessage(GetDlgItem(hwndDlg, IDC_INDSNDLIST), CLM_GETEXTRAIMAGELIST, 0, 0); + HIMAGELIST hImageList = (HIMAGELIST)SendDlgItemMessage(hwndDlg, IDC_INDSNDLIST, CLM_GETEXTRAIMAGELIST, 0, 0); for (int i = 0; i < ImageList_GetImageCount(hImageList); i++) DestroyIcon(ImageList_GetIcon(hImageList, i, ILD_NORMAL)); ImageList_Destroy(hImageList); diff --git a/plugins/NewXstatusNotify/src/options.cpp b/plugins/NewXstatusNotify/src/options.cpp index 6e2ef86b28..e390a49e14 100644 --- a/plugins/NewXstatusNotify/src/options.cpp +++ b/plugins/NewXstatusNotify/src/options.cpp @@ -337,8 +337,8 @@ INT_PTR CALLBACK DlgProcPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM //Mouse actions for (int i = 0; i < SIZEOF(PopupActions); i++) { - SendMessage(GetDlgItem(hwndDlg, IDC_STATUS_LC), CB_SETITEMDATA, SendMessage(GetDlgItem(hwndDlg, IDC_STATUS_LC), CB_ADDSTRING, 0, (LPARAM)TranslateTS(PopupActions[i].Text)), PopupActions[i].Action); - SendMessage(GetDlgItem(hwndDlg, IDC_STATUS_RC), CB_SETITEMDATA, SendMessage(GetDlgItem(hwndDlg, IDC_STATUS_RC), CB_ADDSTRING, 0, (LPARAM)TranslateTS(PopupActions[i].Text)), PopupActions[i].Action); + SendDlgItemMessage(hwndDlg, IDC_STATUS_LC, CB_SETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_STATUS_LC, CB_ADDSTRING, 0, (LPARAM)TranslateTS(PopupActions[i].Text)), PopupActions[i].Action); + SendDlgItemMessage(hwndDlg, IDC_STATUS_RC, CB_SETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_STATUS_RC, CB_ADDSTRING, 0, (LPARAM)TranslateTS(PopupActions[i].Text)), PopupActions[i].Action); } SendDlgItemMessage(hwndDlg, IDC_STATUS_LC, CB_SETCURSEL, opt.LeftClickAction, 0); diff --git a/plugins/New_GPG/src/main.cpp b/plugins/New_GPG/src/main.cpp index 886732df7b..22929e46bf 100755 --- a/plugins/New_GPG/src/main.cpp +++ b/plugins/New_GPG/src/main.cpp @@ -576,7 +576,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR params.code = &code; params.result = &result; extern HFONT bold_font; - SendMessage(GetDlgItem(hwndDlg, IDC_GENERATING_KEY), WM_SETFONT, (WPARAM)bold_font, true); + SendDlgItemMessage(hwndDlg, IDC_GENERATING_KEY, WM_SETFONT, (WPARAM)bold_font, TRUE); SetWindowText(GetDlgItem(hwndDlg, IDC_GENERATING_KEY), TranslateT("Generating new random key, please wait")); EnableWindow(GetDlgItem(hwndDlg, IDC_GENERATE_KEY), 0); EnableWindow(GetDlgItem(hwndDlg, IDC_OTHER), 0); @@ -1523,7 +1523,7 @@ static INT_PTR CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wPara params.out = &out; params.code = &code; params.result = &result; - SendMessage(GetDlgItem(hwndDlg, IDC_GENERATING_TEXT), WM_SETFONT, (WPARAM)bold_font, true); + SendDlgItemMessage(hwndDlg, IDC_GENERATING_TEXT, WM_SETFONT, (WPARAM)bold_font, TRUE); SetWindowText(GetDlgItem(hwndDlg, IDC_GENERATING_TEXT), TranslateT("Generating new key, please wait...")); EnableWindow(GetDlgItem(hwndDlg, IDCANCEL), 0); EnableWindow(GetDlgItem(hwndDlg, IDOK), 0); diff --git a/plugins/NotesAndReminders/src/notes.cpp b/plugins/NotesAndReminders/src/notes.cpp index 8daed58a4d..f73cb4a51e 100644 --- a/plugins/NotesAndReminders/src/notes.cpp +++ b/plugins/NotesAndReminders/src/notes.cpp @@ -849,7 +849,7 @@ static void JustSaveNotesEx(STICKYNOTE *pModified) if (pNote->OnTop) flags |= 2; // get note text - SzT = SendMessage(pNote->REHwnd, WM_GETTEXTLENGTH, 0, 0); + SzT = GetWindowTextLength(pNote->REHwnd); if (SzT) // TODO: change to support unicode and rtf, use EM_STREAMOUT { if (SzT > MAX_NOTE_LEN) SzT = MAX_NOTE_LEN; // we want to be far below the 64k limit diff --git a/plugins/Nudge/src/options.cpp b/plugins/Nudge/src/options.cpp index a2701c651c..2cfa0cf774 100644 --- a/plugins/Nudge/src/options.cpp +++ b/plugins/Nudge/src/options.cpp @@ -149,10 +149,10 @@ static INT_PTR CALLBACK DlgProcShakeOpt(HWND hwnd,UINT msg,WPARAM wParam,LPARAM case 0: switch (((LPNMHDR)lParam)->code) { case PSN_APPLY: - shake.nMoveClist = (int)SendMessage(GetDlgItem(hwnd, IDC_SNUMBER_CLIST), TBM_GETPOS, 0, 0); - shake.nMoveChat = (int)SendMessage(GetDlgItem(hwnd, IDC_SNUMBER_CHAT), TBM_GETPOS, 0, 0); - shake.nScaleClist = (int)SendMessage(GetDlgItem(hwnd, IDC_SSCALE_CLIST), TBM_GETPOS, 0, 0); - shake.nScaleChat = (int)SendMessage(GetDlgItem(hwnd, IDC_SSCALE_CHAT), TBM_GETPOS, 0, 0); + shake.nMoveClist = (int)SendDlgItemMessage(hwnd, IDC_SNUMBER_CLIST, TBM_GETPOS, 0, 0); + shake.nMoveChat = (int)SendDlgItemMessage(hwnd, IDC_SNUMBER_CHAT, TBM_GETPOS, 0, 0); + shake.nScaleClist = (int)SendDlgItemMessage(hwnd, IDC_SSCALE_CLIST, TBM_GETPOS, 0, 0); + shake.nScaleChat = (int)SendDlgItemMessage(hwnd, IDC_SSCALE_CHAT, TBM_GETPOS, 0, 0); shake.Save(); } } diff --git a/plugins/PackUpdater/Src/Notifications.cpp b/plugins/PackUpdater/Src/Notifications.cpp index 25ea203e73..5205531ade 100644 --- a/plugins/PackUpdater/Src/Notifications.cpp +++ b/plugins/PackUpdater/Src/Notifications.cpp @@ -157,7 +157,7 @@ INT_PTR CALLBACK DlgDownload(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPar case WM_INITDIALOG: SetWindowText(GetDlgItem(hDlg, IDC_LABEL), tszDialogMsg); SetWindowLongPtr(GetDlgItem(hDlg, IDC_PB), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hDlg, IDC_PB), GWL_STYLE) | PBS_MARQUEE); - SendMessage(GetDlgItem(hDlg, IDC_PB), PBM_SETMARQUEE, 1, 50); + SendDlgItemMessage(hDlg, IDC_PB, PBM_SETMARQUEE, 1, 50); return TRUE; } return FALSE; diff --git a/plugins/PackUpdater/Src/Options.cpp b/plugins/PackUpdater/Src/Options.cpp index f064dfeac6..56b57e2b84 100644 --- a/plugins/PackUpdater/Src/Options.cpp +++ b/plugins/PackUpdater/Src/Options.cpp @@ -196,8 +196,8 @@ INT_PTR CALLBACK DlgPopupOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) SetDlgItemInt(hdlg, IDC_TIMEOUT_VALUE, MyOptions.Timeout, TRUE); //Mouse actions for (i = 0; i < SIZEOF(PopupActions); i++) { - SendMessage(GetDlgItem(hdlg, IDC_LC), CB_SETITEMDATA, SendMessage(GetDlgItem(hdlg, IDC_LC), CB_ADDSTRING, 0, (LPARAM)TranslateTS(PopupActions[i].Text)), PopupActions[i].Action); - SendMessage(GetDlgItem(hdlg, IDC_RC), CB_SETITEMDATA, SendMessage(GetDlgItem(hdlg, IDC_RC), CB_ADDSTRING, 0, (LPARAM)TranslateTS(PopupActions[i].Text)), PopupActions[i].Action); + SendDlgItemMessage(hdlg, IDC_LC, CB_SETITEMDATA, SendDlgItemMessage(hdlg, IDC_LC, CB_ADDSTRING, 0, (LPARAM)TranslateTS(PopupActions[i].Text)), PopupActions[i].Action); + SendDlgItemMessage(hdlg, IDC_RC, CB_SETITEMDATA, SendDlgItemMessage(hdlg, IDC_RC, CB_ADDSTRING, 0, (LPARAM)TranslateTS(PopupActions[i].Text)), PopupActions[i].Action); } SendDlgItemMessage(hdlg, IDC_LC, CB_SETCURSEL, MyOptions.LeftClickAction, 0); SendDlgItemMessage(hdlg, IDC_RC, CB_SETCURSEL, MyOptions.RightClickAction, 0); diff --git a/plugins/PasteIt/src/PasteIt.cpp b/plugins/PasteIt/src/PasteIt.cpp index a2222f6453..52825a706c 100644 --- a/plugins/PasteIt/src/PasteIt.cpp +++ b/plugins/PasteIt/src/PasteIt.cpp @@ -190,7 +190,7 @@ void PasteIt(MCONTACT hContact, int mode) // it->second is imput window, so now I can send to them // new text. Afterr all is sended MS_MSG_SENDMESSAGE // to focus window. - SendMessage(it->second, EM_SETSEL, -1, SendMessage(it->second, WM_GETTEXTLENGTH, 0, 0)); + SendMessage(it->second, EM_SETSEL, -1, GetWindowTextLength(it->second)); SendMessageA(it->second, EM_REPLACESEL, FALSE, (LPARAM)pasteToWeb->szFileLink); CallServiceSync(MS_MSG_SENDMESSAGE, hContact, NULL); } diff --git a/plugins/Ping/src/options.cpp b/plugins/Ping/src/options.cpp index 5a0a264f70..2ef48f65a1 100644 --- a/plugins/Ping/src/options.cpp +++ b/plugins/Ping/src/options.cpp @@ -132,11 +132,11 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA options.no_test_icon = IsDlgButtonChecked(hwndDlg, IDC_CHK_NOTESTICON) == BST_CHECKED; - options.indent = SendMessage(GetDlgItem(hwndDlg, IDC_SP_INDENT), UDM_GETPOS, 0, 0); - options.row_height = SendMessage(GetDlgItem(hwndDlg, IDC_SP_ROWHEIGHT), UDM_GETPOS, 0, 0); + options.indent = SendDlgItemMessage(hwndDlg, IDC_SP_INDENT, UDM_GETPOS, 0, 0); + options.row_height = SendDlgItemMessage(hwndDlg, IDC_SP_ROWHEIGHT, UDM_GETPOS, 0, 0); - DWORD new_retries = GetDlgItemInt( hwndDlg, IDC_RPT, &trans_success, FALSE); - if(trans_success) { + DWORD new_retries = GetDlgItemInt(hwndDlg, IDC_RPT, &trans_success, FALSE); + if (trans_success) { options.retries = new_retries; } diff --git a/plugins/PluginUpdater/src/Options.cpp b/plugins/PluginUpdater/src/Options.cpp index 9b1e58764c..d9d1606424 100644 --- a/plugins/PluginUpdater/src/Options.cpp +++ b/plugins/PluginUpdater/src/Options.cpp @@ -223,8 +223,8 @@ INT_PTR CALLBACK DlgPopupOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) SetDlgItemInt(hdlg, IDC_TIMEOUT_VALUE, PopupOptions.Timeout, TRUE); //Mouse actions for (int i = 0; i < SIZEOF(PopupActions); i++) { - SendMessage(GetDlgItem(hdlg, IDC_LC), CB_SETITEMDATA, SendMessage(GetDlgItem(hdlg, IDC_LC), CB_ADDSTRING, 0, (LPARAM)TranslateTS(PopupActions[i].Text)), PopupActions[i].Action); - SendMessage(GetDlgItem(hdlg, IDC_RC), CB_SETITEMDATA, SendMessage(GetDlgItem(hdlg, IDC_RC), CB_ADDSTRING, 0, (LPARAM)TranslateTS(PopupActions[i].Text)), PopupActions[i].Action); + SendDlgItemMessage(hdlg, IDC_LC, CB_SETITEMDATA, SendDlgItemMessage(hdlg, IDC_LC, CB_ADDSTRING, 0, (LPARAM)TranslateTS(PopupActions[i].Text)), PopupActions[i].Action); + SendDlgItemMessage(hdlg, IDC_RC, CB_SETITEMDATA, SendDlgItemMessage(hdlg, IDC_RC, CB_ADDSTRING, 0, (LPARAM)TranslateTS(PopupActions[i].Text)), PopupActions[i].Action); } SendDlgItemMessage(hdlg, IDC_LC, CB_SETCURSEL, PopupOptions.LeftClickAction, 0); SendDlgItemMessage(hdlg, IDC_RC, CB_SETCURSEL, PopupOptions.RightClickAction, 0); diff --git a/plugins/Popup/src/actions.cpp b/plugins/Popup/src/actions.cpp index f92a72bfdf..9165c11181 100644 --- a/plugins/Popup/src/actions.cpp +++ b/plugins/Popup/src/actions.cpp @@ -188,7 +188,7 @@ INT_PTR CALLBACK DlgProcPopupActions(HWND hwnd, UINT msg, WPARAM wParam, LPARAM TranslateDialogDefault(hwnd); - SendMessage(GetDlgItem(hwnd, IDC_ICO_INFO), STM_SETICON, (WPARAM)IcoLib_GetIcon(ICO_MISC_NOTIFY, 0), 0); + SendDlgItemMessage(hwnd, IDC_ICO_INFO, STM_SETICON, (WPARAM)IcoLib_GetIcon(ICO_MISC_NOTIFY, 0), 0); CheckDlgButton(hwnd, IDC_CHK_ENABLEACTIONS, PopupOptions.actions & ACT_ENABLE ? TRUE : FALSE); CheckDlgButton(hwnd, IDC_CHK_IMCONTACTSONLY, PopupOptions.actions & ACT_DEF_IMONLY ? TRUE : FALSE); diff --git a/plugins/Popup/src/opt_contacts.cpp b/plugins/Popup/src/opt_contacts.cpp index 9bf3b9024b..c20327a275 100644 --- a/plugins/Popup/src/opt_contacts.cpp +++ b/plugins/Popup/src/opt_contacts.cpp @@ -46,10 +46,10 @@ INT_PTR CALLBACK DlgProcContactOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l case WM_INITDIALOG: TranslateDialogDefault(hwnd); - SendMessage(GetDlgItem(hwnd, IDC_ICO_AUTO), STM_SETICON, (WPARAM)IcoLib_GetIcon(ICO_OPT_DEF,0), 0); - SendMessage(GetDlgItem(hwnd, IDC_ICO_FAVORITE), STM_SETICON, (WPARAM)IcoLib_GetIcon(ICO_OPT_FAV,0), 0); - SendMessage(GetDlgItem(hwnd, IDC_ICO_FULLSCREEN), STM_SETICON, (WPARAM)IcoLib_GetIcon(ICO_OPT_FULLSCREEN,0), 0); - SendMessage(GetDlgItem(hwnd, IDC_ICO_BLOCK), STM_SETICON, (WPARAM)IcoLib_GetIcon(ICO_OPT_BLOCK,0), 0); + SendDlgItemMessage(hwnd, IDC_ICO_AUTO, STM_SETICON, (WPARAM)IcoLib_GetIcon(ICO_OPT_DEF,0), 0); + SendDlgItemMessage(hwnd, IDC_ICO_FAVORITE, STM_SETICON, (WPARAM)IcoLib_GetIcon(ICO_OPT_FAV,0), 0); + SendDlgItemMessage(hwnd, IDC_ICO_FULLSCREEN, STM_SETICON, (WPARAM)IcoLib_GetIcon(ICO_OPT_FULLSCREEN,0), 0); + SendDlgItemMessage(hwnd, IDC_ICO_BLOCK, STM_SETICON, (WPARAM)IcoLib_GetIcon(ICO_OPT_BLOCK,0), 0); { HIMAGELIST hIml = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 5, 5); ImageList_AddIcon(hIml, LoadSkinnedIcon(SKINICON_OTHER_SMALLDOT)); diff --git a/plugins/Popup/src/opt_gen.cpp b/plugins/Popup/src/opt_gen.cpp index 78a4d160ba..3d14d0703a 100644 --- a/plugins/Popup/src/opt_gen.cpp +++ b/plugins/Popup/src/opt_gen.cpp @@ -611,19 +611,19 @@ INT_PTR CALLBACK PositionBoxDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA case WM_INITDIALOG: EnableThemeDialogTexture(hwndDlg, ETDT_ENABLETAB); - GetObject((HFONT)SendMessage(GetDlgItem(hwndDlg, IDC_TITLE), WM_GETFONT, 0, 0), sizeof(lf), &lf); + GetObject((HFONT)SendDlgItemMessage(hwndDlg, IDC_TITLE, WM_GETFONT, 0, 0), sizeof(lf), &lf); lf.lfWeight = FW_BOLD; lf.lfHeight *= 1.2; hFontTitle = CreateFontIndirect(&lf); - SendMessage(GetDlgItem(hwndDlg, IDC_TITLE), WM_SETFONT, (WPARAM)hFontTitle, TRUE); + SendDlgItemMessage(hwndDlg, IDC_TITLE, WM_SETFONT, (WPARAM)hFontTitle, TRUE); - SendMessage(GetDlgItem(hwndDlg, IDOK), BUTTONSETASFLATBTN, TRUE, 0); - SendMessage(GetDlgItem(hwndDlg, IDOK), BUTTONADDTOOLTIP, (WPARAM)_T("OK"), BATF_TCHAR); - SendMessage(GetDlgItem(hwndDlg, IDOK), BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIcon(ICO_OPT_OK, 0)); + SendDlgItemMessage(hwndDlg, IDOK, BUTTONSETASFLATBTN, TRUE, 0); + SendDlgItemMessage(hwndDlg, IDOK, BUTTONADDTOOLTIP, (WPARAM)_T("OK"), BATF_TCHAR); + SendDlgItemMessage(hwndDlg, IDOK, BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIcon(ICO_OPT_OK, 0)); - SendMessage(GetDlgItem(hwndDlg, IDCANCEL), BUTTONSETASFLATBTN, TRUE, 0); - SendMessage(GetDlgItem(hwndDlg, IDCANCEL), BUTTONADDTOOLTIP, (WPARAM)_T("Cancel"), BATF_TCHAR); - SendMessage(GetDlgItem(hwndDlg, IDCANCEL), BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIcon(ICO_OPT_CANCEL, 0)); + SendDlgItemMessage(hwndDlg, IDCANCEL, BUTTONSETASFLATBTN, TRUE, 0); + SendDlgItemMessage(hwndDlg, IDCANCEL, BUTTONADDTOOLTIP, (WPARAM)_T("Cancel"), BATF_TCHAR); + SendDlgItemMessage(hwndDlg, IDCANCEL, BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIcon(ICO_OPT_CANCEL, 0)); SetDlgItemInt(hwndDlg, IDC_TXT_TOP, PopupOptions.gapTop, FALSE); SetDlgItemInt(hwndDlg, IDC_TXT_BOTTOM, PopupOptions.gapBottom, FALSE); diff --git a/plugins/Popup/src/opt_skins.cpp b/plugins/Popup/src/opt_skins.cpp index 9ec85d5921..5cf38b25b1 100644 --- a/plugins/Popup/src/opt_skins.cpp +++ b/plugins/Popup/src/opt_skins.cpp @@ -366,9 +366,9 @@ INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR ListBox_SetCurSel(hCtrl, ListBox_FindString(hCtrl, 0, PopupOptions.SkinPack)); // Skin List reload button - SendMessage(GetDlgItem(hwndDlg, IDC_BTN_RELOAD), BUTTONSETASFLATBTN, TRUE, 0); - SendMessage(GetDlgItem(hwndDlg, IDC_BTN_RELOAD), BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIcon(ICO_OPT_RELOAD,0)); - SendMessage(GetDlgItem(hwndDlg, IDC_BTN_RELOAD), BUTTONADDTOOLTIP, (WPARAM)Translate("Refresh List"), 0); + SendDlgItemMessage(hwndDlg, IDC_BTN_RELOAD, BUTTONSETASFLATBTN, TRUE, 0); + SendDlgItemMessage(hwndDlg, IDC_BTN_RELOAD, BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIcon(ICO_OPT_RELOAD,0)); + SendDlgItemMessage(hwndDlg, IDC_BTN_RELOAD, BUTTONADDTOOLTIP, (WPARAM)Translate("Refresh List"), 0); // Skin Option List SkinOptionList_Update (skinOptions, &skinOptionsCount, hwndDlg); diff --git a/plugins/QuickContacts/src/quickcontacts.cpp b/plugins/QuickContacts/src/quickcontacts.cpp index bc9fd1f734..d686c9c7fb 100644 --- a/plugins/QuickContacts/src/quickcontacts.cpp +++ b/plugins/QuickContacts/src/quickcontacts.cpp @@ -443,7 +443,7 @@ void EnableButtons(HWND hwndDlg, MCONTACT hContact) EnableWindow(GetDlgItem(hwndDlg, IDC_HISTORY), FALSE); EnableWindow(GetDlgItem(hwndDlg, IDC_MENU), FALSE); - SendMessage(GetDlgItem(hwndDlg, IDC_ICO), STM_SETICON, 0, 0); + SendDlgItemMessage(hwndDlg, IDC_ICO, STM_SETICON, 0, 0); } else { @@ -467,7 +467,7 @@ void EnableButtons(HWND hwndDlg, MCONTACT hContact) EnableWindow(GetDlgItem(hwndDlg, IDC_MENU), TRUE); HICON ico = ImageList_GetIcon(hIml, CallService(MS_CLIST_GETCONTACTICON, hContact, 0), ILD_IMAGE); - SendMessage(GetDlgItem(hwndDlg, IDC_ICO), STM_SETICON, (WPARAM) ico, 0); + SendDlgItemMessage(hwndDlg, IDC_ICO, STM_SETICON, (WPARAM) ico, 0); } } @@ -656,13 +656,13 @@ LRESULT CALLBACK HookProc(int code, WPARAM wparam, LPARAM lparam) } if (msg->message == WM_KEYDOWN && msg->wParam == VK_ESCAPE) { - switch(SendMessage(GetDlgItem(hwndMain, IDC_USERNAME), CB_GETDROPPEDSTATE, 0, 0)) { + switch (SendDlgItemMessage(hwndMain, IDC_USERNAME, CB_GETDROPPEDSTATE, 0, 0)) { case FALSE: SendMessage(hwndMain, WM_CLOSE, 0, 0); break; case TRUE: - SendMessage(GetDlgItem(hwndMain, IDC_USERNAME), CB_SHOWDROPDOWN, FALSE, 0); + SendDlgItemMessage(hwndMain, IDC_USERNAME, CB_SHOWDROPDOWN, FALSE, 0); break; } } @@ -715,9 +715,9 @@ static void FillButton(HWND hwndDlg, int dlgItem, TCHAR *name, TCHAR *key, HICON else mir_sntprintf(tmp, SIZEOF(tmp), _T("%s (%s)"), TranslateTS(name), key); - SendMessage(GetDlgItem(hwndDlg, dlgItem), BUTTONSETASFLATBTN, 0, 0); - SendMessage(GetDlgItem(hwndDlg, dlgItem), BUTTONADDTOOLTIP, (LPARAM) full, BATF_TCHAR); - SendDlgItemMessage(hwndDlg, dlgItem, BM_SETIMAGE, IMAGE_ICON, (LPARAM) icon); + SendDlgItemMessage(hwndDlg, dlgItem, BUTTONSETASFLATBTN, 0, 0); + SendDlgItemMessage(hwndDlg, dlgItem, BUTTONADDTOOLTIP, (LPARAM)full, BATF_TCHAR); + SendDlgItemMessage(hwndDlg, dlgItem, BM_SETIMAGE, IMAGE_ICON, (LPARAM)icon); } @@ -731,7 +731,7 @@ static void FillCheckbox(HWND hwndDlg, int dlgItem, TCHAR *name, TCHAR *key) else mir_sntprintf(tmp, SIZEOF(tmp), _T("%s (%s)"), TranslateTS(name), key); - SendMessage(GetDlgItem(hwndDlg, dlgItem), WM_SETTEXT, 0, (LPARAM) full); + SendDlgItemMessage(hwndDlg, dlgItem, WM_SETTEXT, 0, (LPARAM)full); } @@ -755,7 +755,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA hHook = SetWindowsHookEx(WH_MSGFILTER, HookProc, 0, GetCurrentThreadId()); // Combo - SendMessage(GetDlgItem(hwndDlg, IDC_USERNAME), EM_LIMITTEXT, (WPARAM)119,0); + SendDlgItemMessage(hwndDlg, IDC_USERNAME, EM_LIMITTEXT, (WPARAM)119, 0); mir_subclassWindow(GetWindow(GetDlgItem(hwndDlg, IDC_USERNAME),GW_CHILD), EditProc); // Buttons diff --git a/plugins/QuickMessages/src/options.cpp b/plugins/QuickMessages/src/options.cpp index e57801ed0d..c0a4eba7eb 100644 --- a/plugins/QuickMessages/src/options.cpp +++ b/plugins/QuickMessages/src/options.cpp @@ -39,19 +39,19 @@ INT_PTR CALLBACK HelpDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam) RECT rc; g_varhelpDlg=hdlg; TranslateDialogDefault(hdlg); - hFont = (HFONT)SendMessage(GetDlgItem(hdlg, IDC_STATICTITLE), WM_GETFONT, 0, 0); + hFont = (HFONT)SendDlgItemMessage(hdlg, IDC_STATICTITLE, WM_GETFONT, 0, 0); GetObject(hFont, sizeof logFont, &logFont); logFont.lfWeight = FW_BOLD; hFont = CreateFontIndirect(&logFont); - SendMessage(GetDlgItem(hdlg, IDC_STATICTITLE), WM_SETFONT, (WPARAM)hFont, 0); - SendMessage(GetDlgItem(hdlg, IDC_STATICTITLE2), WM_SETFONT, (WPARAM)hFont, 0); - SendMessage(GetDlgItem(hdlg, IDC_VARTEXT), WM_SETFONT, (WPARAM)hFont, 0); - SendMessage(GetDlgItem(hdlg, IDC_VARCLIP), WM_SETFONT, (WPARAM)hFont, 0); - SendMessage(GetDlgItem(hdlg, IDC_VARPUNAME), WM_SETFONT, (WPARAM)hFont, 0); - SendMessage(GetDlgItem(hdlg, IDC_VARPLNAME), WM_SETFONT, (WPARAM)hFont, 0); - SendMessage(GetDlgItem(hdlg, IDC_VARCNAME), WM_SETFONT, (WPARAM)hFont, 0); - SendMessage(GetDlgItem(hdlg, IDC_VARCFNAME), WM_SETFONT, (WPARAM)hFont, 0); - SendMessage(GetDlgItem(hdlg, IDC_VARCLNAME), WM_SETFONT, (WPARAM)hFont, 0); + SendDlgItemMessage(hdlg, IDC_STATICTITLE, WM_SETFONT, (WPARAM)hFont, 0); + SendDlgItemMessage(hdlg, IDC_STATICTITLE2, WM_SETFONT, (WPARAM)hFont, 0); + SendDlgItemMessage(hdlg, IDC_VARTEXT, WM_SETFONT, (WPARAM)hFont, 0); + SendDlgItemMessage(hdlg, IDC_VARCLIP, WM_SETFONT, (WPARAM)hFont, 0); + SendDlgItemMessage(hdlg, IDC_VARPUNAME, WM_SETFONT, (WPARAM)hFont, 0); + SendDlgItemMessage(hdlg, IDC_VARPLNAME, WM_SETFONT, (WPARAM)hFont, 0); + SendDlgItemMessage(hdlg, IDC_VARCNAME, WM_SETFONT, (WPARAM)hFont, 0); + SendDlgItemMessage(hdlg, IDC_VARCFNAME, WM_SETFONT, (WPARAM)hFont, 0); + SendDlgItemMessage(hdlg, IDC_VARCLNAME, WM_SETFONT, (WPARAM)hFont, 0); GetWindowRect(g_opHdlg,&rc); SetWindowPos(hdlg,0,rc.left,rc.top,0,0,SWP_SHOWWINDOW|SWP_NOSIZE); @@ -552,11 +552,11 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam) EnableWindow(GetDlgItem(hdlg,IDC_MENUNAME),FALSE); ShowWindow(GetDlgItem(hdlg,IDC_WARNING),SW_SHOW); - hFont = (HFONT)SendMessage(GetDlgItem(hdlg, IDC_WARNING), WM_GETFONT, 0, 0); - GetObject(hFont, sizeof logFont, &logFont); + hFont = (HFONT)SendDlgItemMessage(hdlg, IDC_WARNING, WM_GETFONT, 0, 0); + GetObject(hFont, sizeof(logFont), &logFont); logFont.lfWeight = FW_BOLD; hFont = CreateFontIndirect(&logFont); - SendMessage(GetDlgItem(hdlg, IDC_WARNING), WM_SETFONT, (WPARAM)hFont, 0); + SendDlgItemMessage(hdlg, IDC_WARNING, WM_SETFONT, (WPARAM)hFont, 0); break; } diff --git a/plugins/Scriver/src/chat/window.cpp b/plugins/Scriver/src/chat/window.cpp index baa47093a2..2eed55adbf 100644 --- a/plugins/Scriver/src/chat/window.cpp +++ b/plugins/Scriver/src/chat/window.cpp @@ -317,7 +317,7 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, case WM_MOUSEWHEEL: if ((GetWindowLongPtr(hwnd, GWL_STYLE) & WS_VSCROLL) == 0) - SendMessage(GetDlgItem(GetParent(hwnd), IDC_CHAT_LOG), WM_MOUSEWHEEL, wParam, lParam); + SendDlgItemMessage(GetParent(hwnd), IDC_CHAT_LOG, WM_MOUSEWHEEL, wParam, lParam); dat->lastEnterTime = 0; return TRUE; @@ -750,7 +750,7 @@ static LRESULT CALLBACK LogSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR case WM_CHAR: SetFocus(GetDlgItem(GetParent(hwnd), IDC_CHAT_MESSAGE)); - SendMessage(GetDlgItem(GetParent(hwnd), IDC_CHAT_MESSAGE), WM_CHAR, wParam, lParam); + SendDlgItemMessage(GetParent(hwnd), IDC_CHAT_MESSAGE, WM_CHAR, wParam, lParam); break; } @@ -1119,7 +1119,7 @@ static INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR EnableWindow(GetDlgItem(hwndDlg, IDC_CHAT_SMILEY), TRUE); - SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_LOG), EM_HIDESELECTION, TRUE, 0); + SendDlgItemMessage(hwndDlg, IDC_CHAT_LOG, EM_HIDESELECTION, TRUE, 0); SendMessage(hwndDlg, GC_SETWNDPROPS, 0, 0); SendMessage(hwndDlg, DM_UPDATESTATUSBAR, 0, 0); @@ -1139,7 +1139,7 @@ static INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR SendMessage(hwndDlg, DM_UPDATETITLEBAR, 0, 0); SendMessage(hwndDlg, GC_FIXTABICONS, 0, 0); - SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_LOG), EM_SETBKGNDCOLOR, 0, g_Settings.crLogBackground); + SendDlgItemMessage(hwndDlg, IDC_CHAT_LOG, EM_SETBKGNDCOLOR, 0, g_Settings.crLogBackground); { // messagebox COLORREF crFore; @@ -1151,7 +1151,7 @@ static INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR cf.dwEffects = 0; cf.crTextColor = crFore; cf.crBackColor = db_get_dw(NULL, SRMMMOD, SRMSGSET_INPUTBKGCOLOUR, SRMSGDEFSET_INPUTBKGCOLOUR); - SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE), EM_SETBKGNDCOLOR, 0, db_get_dw(NULL, SRMMMOD, SRMSGSET_INPUTBKGCOLOUR, SRMSGDEFSET_INPUTBKGCOLOUR)); + SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_SETBKGNDCOLOR, 0, db_get_dw(NULL, SRMMMOD, SRMSGSET_INPUTBKGCOLOUR, SRMSGDEFSET_INPUTBKGCOLOUR)); SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, WM_SETFONT, (WPARAM)g_Settings.MessageBoxFont, MAKELPARAM(TRUE, 0)); SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_SETCHARFORMAT, (WPARAM)SCF_ALL, (LPARAM)&cf); @@ -1164,7 +1164,7 @@ static INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR if (db_get_b(NULL, CHAT_MODULE, "ShowContactStatus", 0)) font = font > 16 ? font : 16; - SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_LIST), LB_SETITEMHEIGHT, 0, (LPARAM)height > font ? height : font); + SendDlgItemMessage(hwndDlg, IDC_CHAT_LIST, LB_SETITEMHEIGHT, 0, (LPARAM)height > font ? height : font); InvalidateRect(GetDlgItem(hwndDlg, IDC_CHAT_LIST), NULL, TRUE); } SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_REQUESTRESIZE, 0, 0); @@ -1449,7 +1449,7 @@ static INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR case GC_UPDATENICKLIST: SendDlgItemMessage(hwndDlg, IDC_CHAT_LIST, WM_SETREDRAW, FALSE, 0); - SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_LIST), LB_RESETCONTENT, 0, 0); + SendDlgItemMessage(hwndDlg, IDC_CHAT_LIST, LB_RESETCONTENT, 0, 0); for (int index = 0; index < si->nUsersInNicklist; index++) { USERINFO *ui = pci->SM_GetUserFromIndex(si->ptszID, si->pszModule, index); if (ui) { @@ -1457,9 +1457,9 @@ static INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR if (szIndicator > '\0') { static TCHAR ptszBuf[128]; mir_sntprintf(ptszBuf, SIZEOF(ptszBuf), _T("%c%s"), szIndicator, ui->pszNick); - SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_LIST), LB_ADDSTRING, 0, (LPARAM)ptszBuf); + SendDlgItemMessage(hwndDlg, IDC_CHAT_LIST, LB_ADDSTRING, 0, (LPARAM)ptszBuf); } - else SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_LIST), LB_ADDSTRING, 0, (LPARAM)ui->pszNick); + else SendDlgItemMessage(hwndDlg, IDC_CHAT_LIST, LB_ADDSTRING, 0, (LPARAM)ui->pszNick); } } SendDlgItemMessage(hwndDlg, IDC_CHAT_LIST, WM_SETREDRAW, TRUE, 0); @@ -1592,7 +1592,7 @@ LABEL_SHOWWINDOW: CHARRANGE sel; sel.cpMin = sel.cpMax = GetRichTextLength(GetDlgItem(hwndDlg, IDC_CHAT_LOG), CP_ACP, FALSE); - SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_LOG), EM_EXSETSEL, 0, (LPARAM)&sel); + SendDlgItemMessage(hwndDlg, IDC_CHAT_LOG, EM_EXSETSEL, 0, (LPARAM)&sel); PostMessage(GetDlgItem(hwndDlg, IDC_CHAT_LOG), WM_VSCROLL, MAKEWPARAM(SB_BOTTOM, 0), 0); } break; @@ -1663,7 +1663,7 @@ LABEL_SHOWWINDOW: POINT p; GetCursorPos(&p); ScreenToClient(GetDlgItem(hwndDlg, IDC_CHAT_LIST), &p); - int item = LOWORD(SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_LIST), LB_ITEMFROMPOINT, 0, MAKELPARAM(p.x, p.y))); + int item = LOWORD(SendDlgItemMessage(hwndDlg, IDC_CHAT_LIST, LB_ITEMFROMPOINT, 0, MAKELPARAM(p.x, p.y))); USERINFO *ui = pci->SM_GetUserFromIndex(parentdat->ptszID, parentdat->pszModule, item); if (ui != NULL) { static TCHAR ptszBuf[1024]; @@ -1691,11 +1691,11 @@ LABEL_SHOWWINDOW: hti.pt.y = (short)HIWORD(GetMessagePos()); ScreenToClient(GetDlgItem(hwndDlg, IDC_CHAT_LIST), &hti.pt); - int item = LOWORD(SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_LIST), LB_ITEMFROMPOINT, 0, MAKELPARAM(hti.pt.x, hti.pt.y))); + int item = LOWORD(SendDlgItemMessage(hwndDlg, IDC_CHAT_LIST, LB_ITEMFROMPOINT, 0, MAKELPARAM(hti.pt.x, hti.pt.y))); USERINFO *ui = pci->SM_GetUserFromIndex(si->ptszID, si->pszModule, item); if (ui) { if (GetKeyState(VK_SHIFT) & 0x8000) { - LRESULT lResult = (LRESULT)SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE), EM_GETSEL, 0, 0); + LRESULT lResult = (LRESULT)SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_GETSEL, 0, 0); int start = LOWORD(lResult); size_t dwNameLenMax = (mir_tstrlen(ui->pszUID) + 4); TCHAR* pszName = (TCHAR*)alloca(sizeof(TCHAR) * dwNameLenMax); @@ -1704,7 +1704,7 @@ LABEL_SHOWWINDOW: else mir_sntprintf(pszName, dwNameLenMax, _T("%s "), ui->pszUID); - SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE), EM_REPLACESEL, FALSE, (LPARAM)pszName); + SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_REPLACESEL, FALSE, (LPARAM)pszName); PostMessage(hwndDlg, WM_MOUSEACTIVATE, 0, 0); } else pci->DoEventHookAsync(hwndDlg, si->ptszID, si->pszModule, GC_USER_PRIVMESS, ui->pszUID, NULL, 0); diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index c0bc5bfa8c..256b10e7f4 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -425,7 +425,7 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPar case WM_MOUSEWHEEL: if ((GetWindowLongPtr(hwnd, GWL_STYLE) & WS_VSCROLL) == 0) - SendMessage(GetDlgItem(GetParent(hwnd), IDC_LOG), WM_MOUSEWHEEL, wParam, lParam); + SendDlgItemMessage(GetParent(hwnd), IDC_LOG, WM_MOUSEWHEEL, wParam, lParam); break; case WM_LBUTTONDOWN: @@ -1065,7 +1065,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP char idbuf[128], buf[128]; GetContactUniqueId(dat, idbuf, sizeof(idbuf)); mir_snprintf(buf, SIZEOF(buf), Translate("User Menu - %s"), idbuf); - SendMessage(GetDlgItem(hwndDlg, IDC_USERMENU), BUTTONADDTOOLTIP, (WPARAM)buf, 0); + SendDlgItemMessage(hwndDlg, IDC_USERMENU, BUTTONADDTOOLTIP, (WPARAM)buf, 0); if (!cws || (!strcmp(cws->szModule, dat->szProto) && !strcmp(cws->szSetting, "Status"))) dat->wStatus = cws->value.wVal; @@ -1751,7 +1751,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (buffer != NULL) { TCHAR *quotedBuffer = GetQuotedTextW(buffer); - SendMessage(GetDlgItem(hwndDlg, IDC_MESSAGE), EM_SETTEXTEX, (WPARAM)&st, (LPARAM)quotedBuffer); + SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_SETTEXTEX, (WPARAM)&st, (LPARAM)quotedBuffer); mir_free(quotedBuffer); mir_free(buffer); } @@ -1766,7 +1766,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP TCHAR *buffer = DbGetEventTextT(&dbei, CP_ACP); if (buffer != NULL) { TCHAR *quotedBuffer = GetQuotedTextW(buffer); - SendMessage(GetDlgItem(hwndDlg, IDC_MESSAGE), EM_SETTEXTEX, (WPARAM)&st, (LPARAM)quotedBuffer); + SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_SETTEXTEX, (WPARAM)&st, (LPARAM)quotedBuffer); mir_free(quotedBuffer); mir_free(buffer); } @@ -1825,7 +1825,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP case WM_CHAR: if (!(GetKeyState(VK_CONTROL) & 0x8000)) { SetFocus(GetDlgItem(hwndDlg, IDC_MESSAGE)); - SendMessage(GetDlgItem(hwndDlg, IDC_MESSAGE), ((MSGFILTER *)lParam)->msg, ((MSGFILTER *)lParam)->wParam, ((MSGFILTER *)lParam)->lParam); + SendDlgItemMessage(hwndDlg, IDC_MESSAGE, ((MSGFILTER *)lParam)->msg, ((MSGFILTER *)lParam)->wParam, ((MSGFILTER *)lParam)->lParam); SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, TRUE); } return TRUE; @@ -1896,7 +1896,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP case WM_CHAR: SetFocus(GetDlgItem(hwndDlg, IDC_MESSAGE)); - SendMessage(GetDlgItem(hwndDlg, IDC_MESSAGE), msg, wParam, lParam); + SendDlgItemMessage(hwndDlg, IDC_MESSAGE, msg, wParam, lParam); break; case WM_DESTROY: diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp index 7f982177e8..a1db3be6ff 100644 --- a/plugins/Scriver/src/msgs.cpp +++ b/plugins/Scriver/src/msgs.cpp @@ -153,7 +153,7 @@ static INT_PTR SendMessageCommandWorker(MCONTACT hContact, LPCSTR pszMsg, bool i if (hwnd != NULL) { if (pszMsg) { HWND hEdit = GetDlgItem(hwnd, IDC_MESSAGE); - SendMessage(hEdit, EM_SETSEL, -1, SendMessage(hEdit, WM_GETTEXTLENGTH, 0, 0)); + SendMessage(hEdit, EM_SETSEL, -1, GetWindowTextLength(hEdit)); if (isWchar) SendMessageW(hEdit, EM_REPLACESEL, FALSE, (LPARAM)pszMsg); else diff --git a/plugins/SecureIM/src/options.cpp b/plugins/SecureIM/src/options.cpp index 0356f1dd81..02dca0b603 100644 --- a/plugins/SecureIM/src/options.cpp +++ b/plugins/SecureIM/src/options.cpp @@ -687,7 +687,7 @@ INT_PTR CALLBACK DlgProcOptionsPGP(HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM l case IDC_NO_KEYRINGS: { - BOOL bNoKR = (SendMessage(GetDlgItem(hDlg, IDC_NO_KEYRINGS), BM_GETCHECK, 0L, 0L) == BST_CHECKED); + BOOL bNoKR = (SendDlgItemMessage(hDlg, IDC_NO_KEYRINGS, BM_GETCHECK, 0L, 0L) == BST_CHECKED); EnableWindow(GetDlgItem(hDlg, IDC_SET_KEYRINGS), !bNoKR); EnableWindow(GetDlgItem(hDlg, IDC_LOAD_PRIVKEY), bNoKR); SetDlgItemText(hDlg, IDC_KEYRING_STATUS, bNoKR ? Translate(sim225) : ((bPGP9) ? Translate(sim220) : (bPGPkeyrings ? Translate(sim216) : Translate(sim217)))); @@ -951,20 +951,20 @@ void RefreshGeneralDlg(HWND hDlg, BOOL iInit) GetFlags(); - SendMessage(GetDlgItem(hDlg, IDC_SFT), BM_SETCHECK, (bSFT) ? BST_CHECKED : BST_UNCHECKED, 0); - SendMessage(GetDlgItem(hDlg, IDC_SOM), BM_SETCHECK, (bSOM) ? BST_CHECKED : BST_UNCHECKED, 0); - SendMessage(GetDlgItem(hDlg, IDC_ASI), BM_SETCHECK, (bASI) ? BST_CHECKED : BST_UNCHECKED, 0); - SendMessage(GetDlgItem(hDlg, IDC_MCD), BM_SETCHECK, (bMCD) ? BST_CHECKED : BST_UNCHECKED, 0); - SendMessage(GetDlgItem(hDlg, IDC_SCM), BM_SETCHECK, (bSCM) ? BST_CHECKED : BST_UNCHECKED, 0); - SendMessage(GetDlgItem(hDlg, IDC_DGP), BM_SETCHECK, (bDGP) ? BST_CHECKED : BST_UNCHECKED, 0); - SendMessage(GetDlgItem(hDlg, IDC_AIP), BM_SETCHECK, (bAIP) ? BST_CHECKED : BST_UNCHECKED, 0); - SendMessage(GetDlgItem(hDlg, IDC_NOL), BM_SETCHECK, (bNOL) ? BST_CHECKED : BST_UNCHECKED, 0); - SendMessage(GetDlgItem(hDlg, IDC_AAK), BM_SETCHECK, (bAAK) ? BST_CHECKED : BST_UNCHECKED, 0); - SendMessage(GetDlgItem(hDlg, IDC_MCM), BM_SETCHECK, (bMCM) ? BST_CHECKED : BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg, IDC_SFT, BM_SETCHECK, (bSFT) ? BST_CHECKED : BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg, IDC_SOM, BM_SETCHECK, (bSOM) ? BST_CHECKED : BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg, IDC_ASI, BM_SETCHECK, (bASI) ? BST_CHECKED : BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg, IDC_MCD, BM_SETCHECK, (bMCD) ? BST_CHECKED : BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg, IDC_SCM, BM_SETCHECK, (bSCM) ? BST_CHECKED : BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg, IDC_DGP, BM_SETCHECK, (bDGP) ? BST_CHECKED : BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg, IDC_AIP, BM_SETCHECK, (bAIP) ? BST_CHECKED : BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg, IDC_NOL, BM_SETCHECK, (bNOL) ? BST_CHECKED : BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg, IDC_AAK, BM_SETCHECK, (bAAK) ? BST_CHECKED : BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg, IDC_MCM, BM_SETCHECK, (bMCM) ? BST_CHECKED : BST_UNCHECKED, 0); // Select {OFF,PGP,GPG} - SendMessage(GetDlgItem(hDlg, IDC_PGP), BM_SETCHECK, bPGP ? BST_CHECKED : BST_UNCHECKED, 0); - SendMessage(GetDlgItem(hDlg, IDC_GPG), BM_SETCHECK, bGPG ? BST_CHECKED : BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg, IDC_PGP, BM_SETCHECK, bPGP ? BST_CHECKED : BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg, IDC_GPG, BM_SETCHECK, bGPG ? BST_CHECKED : BST_UNCHECKED, 0); // rebuild list of contacts HWND hLV = GetDlgItem(hDlg, IDC_STD_USERLIST); @@ -1050,7 +1050,7 @@ void RefreshPGPDlg(HWND hDlg, BOOL iInit) SetDlgItemText(hDlg, IDC_KEYRING_STATUS, !bUseKeyrings ? Translate(sim225) : ((bPGP9) ? Translate(sim220) : (bPGPkeyrings ? Translate(sim216) : Translate(sim217)))); // Disable keyrings use - SendMessage(GetDlgItem(hDlg, IDC_NO_KEYRINGS), BM_SETCHECK, (bUseKeyrings) ? BST_UNCHECKED : BST_CHECKED, 0L); + SendDlgItemMessage(hDlg, IDC_NO_KEYRINGS, BM_SETCHECK, (bUseKeyrings) ? BST_UNCHECKED : BST_CHECKED, 0L); // rebuild list of contacts HWND hLV = GetDlgItem(hDlg, IDC_PGP_USERLIST); @@ -1097,15 +1097,15 @@ void RefreshGPGDlg(HWND hDlg, BOOL iInit) mir_free(path); } BOOL bGPGLogFlag = db_get_b(0, MODULENAME, "gpgLogFlag", 0); - SendMessage(GetDlgItem(hDlg, IDC_LOGGINGON_CBOX), BM_SETCHECK, (bGPGLogFlag) ? BST_CHECKED : BST_UNCHECKED, 0L); + SendDlgItemMessage(hDlg, IDC_LOGGINGON_CBOX, BM_SETCHECK, (bGPGLogFlag) ? BST_CHECKED : BST_UNCHECKED, 0L); path = db_get_sa(0, MODULENAME, "gpgLog"); if (path) { SetDlgItemText(hDlg, IDC_GPGLOGFILE_EDIT, path); mir_free(path); } - SendMessage(GetDlgItem(hDlg, IDC_SAVEPASS_CBOX), BM_SETCHECK, (bSavePass) ? BST_CHECKED : BST_UNCHECKED, 0L); + SendDlgItemMessage(hDlg, IDC_SAVEPASS_CBOX, BM_SETCHECK, (bSavePass) ? BST_CHECKED : BST_UNCHECKED, 0L); BOOL bGPGTmpFlag = db_get_b(0, MODULENAME, "gpgTmpFlag", 0); - SendMessage(GetDlgItem(hDlg, IDC_TMPPATHON_CBOX), BM_SETCHECK, (bGPGTmpFlag) ? BST_CHECKED : BST_UNCHECKED, 0L); + SendDlgItemMessage(hDlg, IDC_TMPPATHON_CBOX, BM_SETCHECK, (bGPGTmpFlag) ? BST_CHECKED : BST_UNCHECKED, 0L); path = db_get_sa(0, MODULENAME, "gpgTmp"); if (path) { SetDlgItemText(hDlg, IDC_GPGTMPPATH_EDIT, path); @@ -1157,14 +1157,14 @@ void ResetGeneralDlg(HWND hDlg) SetDlgItemText(hDlg, IDC_KET, _T("10")); SetDlgItemText(hDlg, IDC_OKT, _T("2")); - SendMessage(GetDlgItem(hDlg, IDC_SFT), BM_SETCHECK, BST_UNCHECKED, 0L); - SendMessage(GetDlgItem(hDlg, IDC_SOM), BM_SETCHECK, BST_UNCHECKED, 0L); - SendMessage(GetDlgItem(hDlg, IDC_ASI), BM_SETCHECK, BST_UNCHECKED, 0L); - SendMessage(GetDlgItem(hDlg, IDC_MCD), BM_SETCHECK, BST_UNCHECKED, 0L); - SendMessage(GetDlgItem(hDlg, IDC_SCM), BM_SETCHECK, BST_UNCHECKED, 0L); - SendMessage(GetDlgItem(hDlg, IDC_DGP), BM_SETCHECK, BST_UNCHECKED, 0L); - SendMessage(GetDlgItem(hDlg, IDC_AIP), BM_SETCHECK, BST_UNCHECKED, 0L); - SendMessage(GetDlgItem(hDlg, IDC_MCM), BM_SETCHECK, BST_UNCHECKED, 0L); + SendDlgItemMessage(hDlg, IDC_SFT, BM_SETCHECK, BST_UNCHECKED, 0L); + SendDlgItemMessage(hDlg, IDC_SOM, BM_SETCHECK, BST_UNCHECKED, 0L); + SendDlgItemMessage(hDlg, IDC_ASI, BM_SETCHECK, BST_UNCHECKED, 0L); + SendDlgItemMessage(hDlg, IDC_MCD, BM_SETCHECK, BST_UNCHECKED, 0L); + SendDlgItemMessage(hDlg, IDC_SCM, BM_SETCHECK, BST_UNCHECKED, 0L); + SendDlgItemMessage(hDlg, IDC_DGP, BM_SETCHECK, BST_UNCHECKED, 0L); + SendDlgItemMessage(hDlg, IDC_AIP, BM_SETCHECK, BST_UNCHECKED, 0L); + SendDlgItemMessage(hDlg, IDC_MCM, BM_SETCHECK, BST_UNCHECKED, 0L); // rebuild list of contacts HWND hLV = GetDlgItem(hDlg, IDC_STD_USERLIST); @@ -1227,28 +1227,28 @@ void ApplyGeneralSettings(HWND hDlg) mir_itoa(tmp, timeout, 10); SetDlgItemText(hDlg, IDC_OKT, timeout); - bSFT = (SendMessage(GetDlgItem(hDlg, IDC_SFT), BM_GETCHECK, 0L, 0L) == BST_CHECKED); - bSOM = (SendMessage(GetDlgItem(hDlg, IDC_SOM), BM_GETCHECK, 0L, 0L) == BST_CHECKED); - bASI = (SendMessage(GetDlgItem(hDlg, IDC_ASI), BM_GETCHECK, 0L, 0L) == BST_CHECKED); - bMCD = (SendMessage(GetDlgItem(hDlg, IDC_MCD), BM_GETCHECK, 0L, 0L) == BST_CHECKED); - bSCM = (SendMessage(GetDlgItem(hDlg, IDC_SCM), BM_GETCHECK, 0L, 0L) == BST_CHECKED); - bDGP = (SendMessage(GetDlgItem(hDlg, IDC_DGP), BM_GETCHECK, 0L, 0L) == BST_CHECKED); - bAIP = (SendMessage(GetDlgItem(hDlg, IDC_AIP), BM_GETCHECK, 0L, 0L) == BST_CHECKED); - bNOL = (SendMessage(GetDlgItem(hDlg, IDC_NOL), BM_GETCHECK, 0L, 0L) == BST_CHECKED); - bAAK = (SendMessage(GetDlgItem(hDlg, IDC_AAK), BM_GETCHECK, 0L, 0L) == BST_CHECKED); - bMCM = (SendMessage(GetDlgItem(hDlg, IDC_MCM), BM_GETCHECK, 0L, 0L) == BST_CHECKED); + bSFT = (SendDlgItemMessage(hDlg, IDC_SFT, BM_GETCHECK, 0L, 0L) == BST_CHECKED); + bSOM = (SendDlgItemMessage(hDlg, IDC_SOM, BM_GETCHECK, 0L, 0L) == BST_CHECKED); + bASI = (SendDlgItemMessage(hDlg, IDC_ASI, BM_GETCHECK, 0L, 0L) == BST_CHECKED); + bMCD = (SendDlgItemMessage(hDlg, IDC_MCD, BM_GETCHECK, 0L, 0L) == BST_CHECKED); + bSCM = (SendDlgItemMessage(hDlg, IDC_SCM, BM_GETCHECK, 0L, 0L) == BST_CHECKED); + bDGP = (SendDlgItemMessage(hDlg, IDC_DGP, BM_GETCHECK, 0L, 0L) == BST_CHECKED); + bAIP = (SendDlgItemMessage(hDlg, IDC_AIP, BM_GETCHECK, 0L, 0L) == BST_CHECKED); + bNOL = (SendDlgItemMessage(hDlg, IDC_NOL, BM_GETCHECK, 0L, 0L) == BST_CHECKED); + bAAK = (SendDlgItemMessage(hDlg, IDC_AAK, BM_GETCHECK, 0L, 0L) == BST_CHECKED); + bMCM = (SendDlgItemMessage(hDlg, IDC_MCM, BM_GETCHECK, 0L, 0L) == BST_CHECKED); SetFlags(); // PGP &| GPG flags { tmp = 0; - i = SendMessage(GetDlgItem(hDlg, IDC_PGP), BM_GETCHECK, 0L, 0L) == BST_CHECKED; + i = SendDlgItemMessage(hDlg, IDC_PGP, BM_GETCHECK, 0L, 0L) == BST_CHECKED; if (i != bPGP) { bPGP = i; tmp++; db_set_b(0, MODULENAME, "pgp", bPGP); } - i = SendMessage(GetDlgItem(hDlg, IDC_GPG), BM_GETCHECK, 0L, 0L) == BST_CHECKED; + i = SendDlgItemMessage(hDlg, IDC_GPG, BM_GETCHECK, 0L, 0L) == BST_CHECKED; if (i != bGPG) { bGPG = i; tmp++; db_set_b(0, MODULENAME, "gpg", bGPG); @@ -1310,7 +1310,7 @@ void ApplyProtoSettings(HWND hDlg) void ApplyPGPSettings(HWND hDlg) { - bUseKeyrings = !(SendMessage(GetDlgItem(hDlg, IDC_NO_KEYRINGS), BM_GETCHECK, 0L, 0L) == BST_CHECKED); + bUseKeyrings = !(SendDlgItemMessage(hDlg, IDC_NO_KEYRINGS, BM_GETCHECK, 0L, 0L) == BST_CHECKED); db_set_b(0, MODULENAME, "ukr", bUseKeyrings); char *priv = db_get_sa(0, MODULENAME, "tpgpPrivKey"); @@ -1332,17 +1332,17 @@ void ApplyGPGSettings(HWND hDlg) GetDlgItemText(hDlg, IDC_GPGHOME_EDIT, tmp, SIZEOF(tmp)); db_set_s(0, MODULENAME, "gpgHome", tmp); - bSavePass = (SendMessage(GetDlgItem(hDlg, IDC_SAVEPASS_CBOX), BM_GETCHECK, 0L, 0L) == BST_CHECKED); + bSavePass = (SendDlgItemMessage(hDlg, IDC_SAVEPASS_CBOX, BM_GETCHECK, 0L, 0L) == BST_CHECKED); db_set_b(0, MODULENAME, "gpgSaveFlag", bSavePass); - BOOL bgpgLogFlag = (SendMessage(GetDlgItem(hDlg, IDC_LOGGINGON_CBOX), BM_GETCHECK, 0L, 0L) == BST_CHECKED); + BOOL bgpgLogFlag = (SendDlgItemMessage(hDlg, IDC_LOGGINGON_CBOX, BM_GETCHECK, 0L, 0L) == BST_CHECKED); db_set_b(0, MODULENAME, "gpgLogFlag", bgpgLogFlag); GetDlgItemText(hDlg, IDC_GPGLOGFILE_EDIT, tmp, SIZEOF(tmp)); db_set_s(0, MODULENAME, "gpgLog", tmp); if (bgpgLogFlag) gpg_set_log(tmp); else gpg_set_log(0); - BOOL bgpgTmpFlag = (SendMessage(GetDlgItem(hDlg, IDC_TMPPATHON_CBOX), BM_GETCHECK, 0L, 0L) == BST_CHECKED); + BOOL bgpgTmpFlag = (SendDlgItemMessage(hDlg, IDC_TMPPATHON_CBOX, BM_GETCHECK, 0L, 0L) == BST_CHECKED); db_set_b(0, MODULENAME, "gpgTmpFlag", bgpgTmpFlag); GetDlgItemText(hDlg, IDC_GPGTMPPATH_EDIT, tmp, SIZEOF(tmp)); db_set_s(0, MODULENAME, "gpgTmp", tmp); diff --git a/plugins/SendScreenshotPlus/src/UAboutForm.cpp b/plugins/SendScreenshotPlus/src/UAboutForm.cpp index 1ce8c14b62..e587697bdd 100644 --- a/plugins/SendScreenshotPlus/src/UAboutForm.cpp +++ b/plugins/SendScreenshotPlus/src/UAboutForm.cpp @@ -101,7 +101,7 @@ LRESULT TfrmAbout::wmInitdialog(WPARAM wParam, LPARAM lParam) { mir_free(pszPlug); mir_free(pszVer); SetDlgItemText( m_hWnd, IDC_HEADERBAR, newTitle ); - SendMessage(GetDlgItem(m_hWnd, IDC_HEADERBAR), WM_SETICON, ICON_BIG, (LPARAM)Skin_GetIcon(ICO_COMMON_SSWINDOW1,1)); + SendDlgItemMessage(m_hWnd, IDC_HEADERBAR, WM_SETICON, ICON_BIG, (LPARAM)Skin_GetIcon(ICO_COMMON_SSWINDOW1,1)); //License { mir_tcsadd(pszTitle ,_T(__COPYRIGHT)); @@ -136,7 +136,7 @@ LRESULT TfrmAbout::wmInitdialog(WPARAM wParam, LPARAM lParam) { //init controls btnPageClick(); - SendMessage(GetDlgItem(m_hWnd, IDA_CONTRIBLINK), BUTTONSETDEFAULT, 1, NULL); + SendDlgItemMessage(m_hWnd, IDA_CONTRIBLINK, BUTTONSETDEFAULT, 1, NULL); TranslateDialogDefault(m_hWnd); return FALSE; diff --git a/plugins/SendScreenshotPlus/src/UMainForm.cpp b/plugins/SendScreenshotPlus/src/UMainForm.cpp index efc7063416..b427e7c01a 100644 --- a/plugins/SendScreenshotPlus/src/UMainForm.cpp +++ b/plugins/SendScreenshotPlus/src/UMainForm.cpp @@ -185,7 +185,7 @@ void TfrmMain::wmInitdialog(WPARAM wParam, LPARAM lParam) { } mir_free(pt); - SendMessage(GetDlgItem(m_hWnd, IDC_HEADERBAR), WM_SETICON, ICON_BIG, (LPARAM)Skin_GetIcon(ICO_COMMON_SSWINDOW1,1)); + SendDlgItemMessage(m_hWnd, IDC_HEADERBAR, WM_SETICON, ICON_BIG, (LPARAM)Skin_GetIcon(ICO_COMMON_SSWINDOW1,1)); /// Timed controls CheckDlgButton(m_hWnd,ID_chkTimed, m_opt_chkTimed ? BST_CHECKED : BST_UNCHECKED); @@ -866,12 +866,12 @@ void TfrmMain::cboxSendByChange() { } bState = (itemFlag & SS_DLG_DELETEAFTERSSEND); hIcon = Skin_GetIcon(m_opt_btnDeleteAfterSend ? ICO_COMMON_SSDELON : ICO_COMMON_SSDELOFF); - SendMessage(GetDlgItem(m_hWnd, ID_btnDeleteAfterSend), BM_SETIMAGE, IMAGE_ICON, (LPARAM)(bState ? hIcon : 0)); + SendDlgItemMessage(m_hWnd, ID_btnDeleteAfterSend, BM_SETIMAGE, IMAGE_ICON, (LPARAM)(bState ? hIcon : 0)); Button_Enable(GetDlgItem(m_hWnd, ID_btnDeleteAfterSend), bState); bState = (itemFlag & SS_DLG_DESCRIPTION); hIcon = Skin_GetIcon(m_opt_btnDesc ? ICO_COMMON_SSDESKON : ICO_COMMON_SSDESKOFF); - SendMessage(GetDlgItem(m_hWnd, ID_btnDesc), BM_SETIMAGE, IMAGE_ICON, (LPARAM)(bState ? hIcon : 0)); + SendDlgItemMessage(m_hWnd, ID_btnDesc, BM_SETIMAGE, IMAGE_ICON, (LPARAM)(bState ? hIcon : 0)); Button_Enable(GetDlgItem(m_hWnd, ID_btnDesc), bState); } diff --git a/plugins/Sessions/Src/Options.cpp b/plugins/Sessions/Src/Options.cpp index fb29c64c81..07af2e33dd 100644 --- a/plugins/Sessions/Src/Options.cpp +++ b/plugins/Sessions/Src/Options.cpp @@ -363,8 +363,8 @@ static INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM l { int i = 0; for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { - BYTE res = (BYTE)SendMessage(GetDlgItem(hdlg, IDC_EMCLIST), CLM_GETCHECKMARK, - SendMessage(GetDlgItem(hdlg, IDC_EMCLIST), CLM_FINDCONTACT, hContact, 0), 0); + BYTE res = (BYTE)SendDlgItemMessage(hdlg, IDC_EMCLIST, CLM_GETCHECKMARK, + SendDlgItemMessage(hdlg, IDC_EMCLIST, CLM_FINDCONTACT, hContact, 0), 0); if (res) { SetSessionMark(hContact, 1, '1', opses_count); SetInSessionOrder(hContact, 1, opses_count, i); diff --git a/plugins/ShellExt/src/options.cpp b/plugins/ShellExt/src/options.cpp index b8088416c3..132f2b29f8 100644 --- a/plugins/ShellExt/src/options.cpp +++ b/plugins/ShellExt/src/options.cpp @@ -60,7 +60,7 @@ static INT_PTR CALLBACK OptDialogProc(HWND hwndDlg, UINT wMsg, WPARAM wParam, LP CheckDlgButton(hwndDlg, IDC_HIDEOFFLINE, db_get_b(0, SHLExt_Name, SHLExt_ShowNoOffline, BST_UNCHECKED)); // give the Remove button a Vista icon - SendMessage(GetDlgItem(hwndDlg, IDC_REMOVE), BCM_SETSHIELD, 0, 1); + SendDlgItemMessage(hwndDlg, IDC_REMOVE, BCM_SETSHIELD, 0, 1); return TRUE; case WM_NOTIFY: diff --git a/plugins/SimpleAR/src/Options.cpp b/plugins/SimpleAR/src/Options.cpp index ac80cda1e6..e84168fe11 100644 --- a/plugins/SimpleAR/src/Options.cpp +++ b/plugins/SimpleAR/src/Options.cpp @@ -62,7 +62,7 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara // First, save last, then load current if (lastIndex>-1) { - INT size=SendDlgItemMessage(hwndDlg,IDC_MESSAGE,WM_GETTEXTLENGTH,0,0)+1; + int size=SendDlgItemMessage(hwndDlg,IDC_MESSAGE,WM_GETTEXTLENGTH,0,0)+1; GetDlgItemText(hwndDlg,IDC_MESSAGE,ptszMessage[lastIndex],size); } lastIndex=SendDlgItemMessage(hwndDlg,IDC_STATUSMODE,CB_GETCURSEL,0,0); diff --git a/plugins/SimpleStatusMsg/src/msgbox.cpp b/plugins/SimpleStatusMsg/src/msgbox.cpp index aa5fcc7480..633eb257cf 100644 --- a/plugins/SimpleStatusMsg/src/msgbox.cpp +++ b/plugins/SimpleStatusMsg/src/msgbox.cpp @@ -411,7 +411,7 @@ VOID APIENTRY HandlePopupMenu(HWND hwnd, POINT pt, HWND edit_control) EnableMenuItem(hmenuTrackPopup, IDM_COPY, MF_BYCOMMAND | MF_GRAYED); EnableMenuItem(hmenuTrackPopup, IDM_CUT, MF_BYCOMMAND | MF_GRAYED); } - if (SendMessage(edit_control, WM_GETTEXTLENGTH, 0, 0) == 0) + if (GetWindowTextLength(edit_control) == 0) EnableMenuItem(hmenuTrackPopup, IDM_DELETE, MF_BYCOMMAND | MF_GRAYED); if (ServiceExists(MS_VARS_FORMATSTRING)) @@ -690,15 +690,15 @@ void DisplayCharsCount(struct MsgBoxData *dlg_data, HWND hwndDlg) len = GetDlgItemText(hwndDlg, IDC_EDIT1, msg, SIZEOF(msg)); if (db_get_b(NULL, "SimpleStatusMsg", "RemoveCR", 0)) { - int index, num_lines = SendMessage(GetDlgItem(hwndDlg, IDC_EDIT1), EM_GETLINECOUNT, 0, 0); + int index, num_lines = SendDlgItemMessage(hwndDlg, IDC_EDIT1, EM_GETLINECOUNT, 0, 0); for (int i = 1; i < num_lines; ++i) { - index = SendMessage(GetDlgItem(hwndDlg, IDC_EDIT1), EM_LINEINDEX, (WPARAM)i, 0); + index = SendDlgItemMessage(hwndDlg, IDC_EDIT1, EM_LINEINDEX, (WPARAM)i, 0); if (msg[index - 1] == '\n') lines++; } } mir_sntprintf(status_text, SIZEOF(status_text), TranslateT("OK (%d)"), len - (lines - 1)); - SendMessage(GetDlgItem(hwndDlg, IDC_OK), WM_SETTEXT, 0, (LPARAM)status_text); + SendDlgItemMessage(hwndDlg, IDC_OK, WM_SETTEXT, 0, (LPARAM)status_text); } void SetEditControlText(struct MsgBoxData *data, HWND hwndDlg, int iStatus) @@ -957,23 +957,23 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA copy_init_data->other_icons = AddOtherIconsToImageList(copy_init_data); if ((copy_init_data->m_iDlgFlags & DLG_SHOW_BUTTONS) || (copy_init_data->m_iDlgFlags & DLG_SHOW_BUTTONS_FLAT)) { - SendMessage(GetDlgItem(hwndDlg, IDC_BADD), BUTTONADDTOOLTIP, (WPARAM)Translate("Add to predefined"), 0); - SendMessage(GetDlgItem(hwndDlg, IDC_BADD), BM_SETIMAGE, IMAGE_ICON, (LPARAM)copy_init_data->icon[I_ICON_ADD]); + SendDlgItemMessage(hwndDlg, IDC_BADD, BUTTONADDTOOLTIP, (WPARAM)Translate("Add to predefined"), 0); + SendDlgItemMessage(hwndDlg, IDC_BADD, BM_SETIMAGE, IMAGE_ICON, (LPARAM)copy_init_data->icon[I_ICON_ADD]); EnableWindow(GetDlgItem(hwndDlg, IDC_BADD), TRUE); ShowWindow(GetDlgItem(hwndDlg, IDC_BADD), TRUE); - SendMessage(GetDlgItem(hwndDlg, IDC_BDEL), BUTTONADDTOOLTIP, (WPARAM)Translate("Delete selected"), 0); - SendMessage(GetDlgItem(hwndDlg, IDC_BDEL), BM_SETIMAGE, IMAGE_ICON, (LPARAM)copy_init_data->icon[I_ICON_DEL]); + SendDlgItemMessage(hwndDlg, IDC_BDEL, BUTTONADDTOOLTIP, (WPARAM)Translate("Delete selected"), 0); + SendDlgItemMessage(hwndDlg, IDC_BDEL, BM_SETIMAGE, IMAGE_ICON, (LPARAM)copy_init_data->icon[I_ICON_DEL]); ShowWindow(GetDlgItem(hwndDlg, IDC_BDEL), TRUE); - SendMessage(GetDlgItem(hwndDlg, IDC_BCLEAR), BUTTONADDTOOLTIP, (WPARAM)Translate("Clear history"), 0); - SendMessage(GetDlgItem(hwndDlg, IDC_BCLEAR), BM_SETIMAGE, IMAGE_ICON, (LPARAM)copy_init_data->icon[I_ICON_CLEAR]); + SendDlgItemMessage(hwndDlg, IDC_BCLEAR, BUTTONADDTOOLTIP, (WPARAM)Translate("Clear history"), 0); + SendDlgItemMessage(hwndDlg, IDC_BCLEAR, BM_SETIMAGE, IMAGE_ICON, (LPARAM)copy_init_data->icon[I_ICON_CLEAR]); ShowWindow(GetDlgItem(hwndDlg, IDC_BCLEAR), TRUE); if (copy_init_data->m_iDlgFlags & DLG_SHOW_BUTTONS_FLAT) { - SendMessage(GetDlgItem(hwndDlg, IDC_BADD), BUTTONSETASFLATBTN, TRUE, 0); - SendMessage(GetDlgItem(hwndDlg, IDC_BDEL), BUTTONSETASFLATBTN, TRUE, 0); - SendMessage(GetDlgItem(hwndDlg, IDC_BCLEAR), BUTTONSETASFLATBTN, TRUE, 0); + SendDlgItemMessage(hwndDlg, IDC_BADD, BUTTONSETASFLATBTN, TRUE, 0); + SendDlgItemMessage(hwndDlg, IDC_BDEL, BUTTONSETASFLATBTN, TRUE, 0); + SendDlgItemMessage(hwndDlg, IDC_BCLEAR, BUTTONSETASFLATBTN, TRUE, 0); } } else { @@ -1065,7 +1065,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA mir_subclassWindow( GetDlgItem(hwndDlg, IDC_EDIT1), EditBoxSubProc); if (!init_data->m_bOnEvent && IsWindowEnabled(GetDlgItem(hwndDlg, IDC_EDIT1))) { SetFocus(GetDlgItem(hwndDlg, IDC_EDIT1)); - SendMessage(GetDlgItem(hwndDlg, IDC_EDIT1), EM_SETSEL, 0, -1); + SendDlgItemMessage(hwndDlg, IDC_EDIT1, EM_SETSEL, 0, -1); } else SetFocus(GetDlgItem(hwndDlg, IDC_OK)); @@ -1441,7 +1441,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA if (IsWindowEnabled(GetDlgItem(hwndDlg, IDC_EDIT1))) { SetFocus(GetDlgItem(hwndDlg, IDC_EDIT1)); - SendMessage(GetDlgItem(hwndDlg, IDC_EDIT1), EM_SETSEL, 0, -1); + SendDlgItemMessage(hwndDlg, IDC_EDIT1, EM_SETSEL, 0, -1); } break; } @@ -1567,9 +1567,9 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA ImageList_ReplaceIcon(msgbox_data->other_icons, i, msgbox_data->icon[i]); } if ((msgbox_data->m_iDlgFlags & DLG_SHOW_BUTTONS) || (msgbox_data->m_iDlgFlags & DLG_SHOW_BUTTONS_FLAT)) { - SendMessage(GetDlgItem(hwndDlg, IDC_BADD), BM_SETIMAGE, IMAGE_ICON, (LPARAM)msgbox_data->icon[I_ICON_ADD]); - SendMessage(GetDlgItem(hwndDlg, IDC_BCLEAR), BM_SETIMAGE, IMAGE_ICON, (LPARAM)msgbox_data->icon[I_ICON_CLEAR]); - SendMessage(GetDlgItem(hwndDlg, IDC_BDEL), BM_SETIMAGE, IMAGE_ICON, (LPARAM)msgbox_data->icon[I_ICON_DEL]); + SendDlgItemMessage(hwndDlg, IDC_BADD, BM_SETIMAGE, IMAGE_ICON, (LPARAM)msgbox_data->icon[I_ICON_ADD]); + SendDlgItemMessage(hwndDlg, IDC_BCLEAR, BM_SETIMAGE, IMAGE_ICON, (LPARAM)msgbox_data->icon[I_ICON_CLEAR]); + SendDlgItemMessage(hwndDlg, IDC_BDEL, BM_SETIMAGE, IMAGE_ICON, (LPARAM)msgbox_data->icon[I_ICON_DEL]); } break; diff --git a/plugins/SimpleStatusMsg/src/options.cpp b/plugins/SimpleStatusMsg/src/options.cpp index 5b750e136a..d64a87d34e 100644 --- a/plugins/SimpleStatusMsg/src/options.cpp +++ b/plugins/SimpleStatusMsg/src/options.cpp @@ -117,9 +117,9 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)data); SendDlgItemMessage(hwndDlg, IDC_OPTEDIT1, EM_LIMITTEXT, 1024, 0); - SendMessage(GetDlgItem(hwndDlg, IDC_SMAXLENGTH), UDM_SETBUDDY, (WPARAM)GetDlgItem(hwndDlg, IDC_EMAXLENGTH), 0); - SendMessage(GetDlgItem(hwndDlg, IDC_SMAXLENGTH), UDM_SETRANGE32, 1, 1024); - SendMessage(GetDlgItem(hwndDlg, IDC_EMAXLENGTH), EM_LIMITTEXT, 4, 0); + SendDlgItemMessage(hwndDlg, IDC_SMAXLENGTH, UDM_SETBUDDY, (WPARAM)GetDlgItem(hwndDlg, IDC_EMAXLENGTH), 0); + SendDlgItemMessage(hwndDlg, IDC_SMAXLENGTH, UDM_SETRANGE32, 1, 1024); + SendDlgItemMessage(hwndDlg, IDC_EMAXLENGTH, EM_LIMITTEXT, 4, 0); data->status_msg = (struct SingleStatusMsg *)mir_alloc(sizeof(struct SingleStatusMsg)*(accounts->count + 1)); @@ -127,13 +127,13 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L { if (accounts->statusMsgFlags & Proto_Status2Flag(i)) { - index = SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTSTATUS), CB_INSERTSTRING, -1, (LPARAM)pcli->pfnGetStatusModeDescription(i, 0)); + index = SendDlgItemMessage(hwndDlg, IDC_CBOPTSTATUS, CB_INSERTSTRING, -1, (LPARAM)pcli->pfnGetStatusModeDescription(i, 0)); if (index != CB_ERR && index != CB_ERRSPACE) { int j; char setting[80]; - SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTSTATUS), CB_SETITEMDATA, (WPARAM)index, (LPARAM)i - ID_STATUS_ONLINE); + SendDlgItemMessage(hwndDlg, IDC_CBOPTSTATUS, CB_SETITEMDATA, (WPARAM)index, (LPARAM)i - ID_STATUS_ONLINE); val = db_get_b(NULL, "SimpleStatusMsg", (char *)StatusModeToDbSetting(i, "Flags"), STATUS_DEFAULT); data->status_msg[0].flags[i - ID_STATUS_ONLINE] = val; @@ -155,7 +155,7 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L } } } - SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTSTATUS), CB_SETCURSEL, 0, 0); + SendDlgItemMessage(hwndDlg, IDC_CBOPTSTATUS, CB_SETCURSEL, 0, 0); data->proto_msg = (struct SingleProtoMsg *)mir_alloc(sizeof(struct SingleProtoMsg)*(accounts->count + 1)); if (!data->proto_msg) @@ -175,7 +175,7 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L data->proto_ok = TRUE; - index = SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTPROTO), CB_ADDSTRING, 0, (LPARAM)TranslateT("Global status change")); + index = SendDlgItemMessage(hwndDlg, IDC_CBOPTPROTO, CB_ADDSTRING, 0, (LPARAM)TranslateT("Global status change")); if (index != CB_ERR && index != CB_ERRSPACE) { @@ -184,7 +184,7 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L val = db_get_b(NULL, "SimpleStatusMsg", "ProtoFlags", PROTO_DEFAULT); data->proto_msg[0].flags = val; data->proto_msg[0].max_length = 0; - SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTPROTO), CB_SETITEMDATA, (WPARAM)index, 0); + SendDlgItemMessage(hwndDlg, IDC_CBOPTPROTO, CB_SETITEMDATA, (WPARAM)index, 0); } for (i = 0; i < accounts->count; ++i) @@ -197,8 +197,8 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L continue; } - index = SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTPROTO), CB_ADDSTRING, 0, (LPARAM)accounts->pa[i]->tszAccountName); - // SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTPROTO), CB_SETITEMDATA, index, (LPARAM)i + 1); + index = SendDlgItemMessage(hwndDlg, IDC_CBOPTPROTO, CB_ADDSTRING, 0, (LPARAM)accounts->pa[i]->tszAccountName); + // SendDlgItemMessage(hwndDlg, IDC_CBOPTPROTO, CB_SETITEMDATA, index, (LPARAM)i + 1); if (index != CB_ERR && index != CB_ERRSPACE) { mir_snprintf(setting, SIZEOF(setting), "Proto%sDefault", accounts->pa[i]->szModuleName); @@ -211,7 +211,7 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L mir_snprintf(setting, SIZEOF(setting), "Proto%sMaxLen", accounts->pa[i]->szModuleName); val = db_get_w(NULL, "SimpleStatusMsg", setting, 1024); data->proto_msg[i+1].max_length = val; - SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTPROTO), CB_SETITEMDATA, (WPARAM)index, (LPARAM)i + 1); + SendDlgItemMessage(hwndDlg, IDC_CBOPTPROTO, CB_SETITEMDATA, (WPARAM)index, (LPARAM)i + 1); } } @@ -219,9 +219,9 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L { EnableWindow(GetDlgItem(hwndDlg, IDC_BOPTPROTO), FALSE); EnableWindow(GetDlgItem(hwndDlg, IDC_CBOPTPROTO), FALSE); - SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTPROTO), CB_SETCURSEL, 1, 0); + SendDlgItemMessage(hwndDlg, IDC_CBOPTPROTO, CB_SETCURSEL, 1, 0); } - else SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTPROTO), CB_SETCURSEL, 0, 0); + else SendDlgItemMessage(hwndDlg, IDC_CBOPTPROTO, CB_SETCURSEL, 0, 0); SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_CBOPTPROTO, CBN_SELCHANGE), (LPARAM)GetDlgItem(hwndDlg, IDC_CBOPTPROTO)); } @@ -241,14 +241,14 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L } if (hIcon != NULL) - SendMessage(GetDlgItem(hwndDlg, IDC_VARSHELP), BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon); + SendDlgItemMessage(hwndDlg, IDC_VARSHELP, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon); else SetDlgItemText(hwndDlg, IDC_VARSHELP, _T("V")); if (szTipInfo == NULL) - SendMessage(GetDlgItem(hwndDlg, IDC_VARSHELP), BUTTONADDTOOLTIP, (WPARAM)TranslateT("Open string formatting help"), 0); + SendDlgItemMessage(hwndDlg, IDC_VARSHELP, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Open string formatting help"), 0); else - SendMessage(GetDlgItem(hwndDlg, IDC_VARSHELP), BUTTONADDTOOLTIP, (WPARAM)szTipInfo, 0); + SendDlgItemMessage(hwndDlg, IDC_VARSHELP, BUTTONADDTOOLTIP, (WPARAM)szTipInfo, 0); SendDlgItemMessage(hwndDlg, IDC_VARSHELP, BUTTONSETASFLATBTN, TRUE, 0); } @@ -278,7 +278,7 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L SetDlgItemInt(hwndDlg, IDC_EMAXLENGTH, 1, FALSE); val = GetDlgItemInt(hwndDlg, IDC_EMAXLENGTH, &translated, FALSE); - i = SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTPROTO), CB_GETITEMDATA, (WPARAM)SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTPROTO), CB_GETCURSEL, 0, 0), 0); + i = SendDlgItemMessage(hwndDlg, IDC_CBOPTPROTO, CB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_CBOPTPROTO, CB_GETCURSEL, 0, 0), 0); data->proto_msg[i].max_length = val; break; } @@ -381,18 +381,18 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L else status_modes = accounts->statusMsgFlags; - j = SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTSTATUS), CB_GETITEMDATA, (WPARAM)SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTSTATUS), CB_GETCURSEL, 0, 0), 0); - SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTSTATUS), CB_RESETCONTENT, 0, 0); + j = SendDlgItemMessage(hwndDlg, IDC_CBOPTSTATUS, CB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_CBOPTSTATUS, CB_GETCURSEL, 0, 0), 0); + SendDlgItemMessage(hwndDlg, IDC_CBOPTSTATUS, CB_RESETCONTENT, 0, 0); for (l=ID_STATUS_ONLINE; l<=ID_STATUS_OUTTOLUNCH; l++) { int index; if (status_modes & Proto_Status2Flag(l)) { - index = SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTSTATUS), CB_INSERTSTRING, -1, (LPARAM)pcli->pfnGetStatusModeDescription(l, 0)); + index = SendDlgItemMessage(hwndDlg, IDC_CBOPTSTATUS, CB_INSERTSTRING, -1, (LPARAM)pcli->pfnGetStatusModeDescription(l, 0)); if (index != CB_ERR && index != CB_ERRSPACE) { - SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTSTATUS), CB_SETITEMDATA, (WPARAM)index, (LPARAM)l - ID_STATUS_ONLINE); + SendDlgItemMessage(hwndDlg, IDC_CBOPTSTATUS, CB_SETITEMDATA, (WPARAM)index, (LPARAM)l - ID_STATUS_ONLINE); if (j == l-ID_STATUS_ONLINE) newindex=index; } @@ -401,11 +401,11 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L if (!newindex) { - SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTSTATUS), CB_SETCURSEL, 0, 0); - j = SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTSTATUS), CB_GETITEMDATA, (WPARAM)SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTSTATUS), CB_GETCURSEL, 0, 0), 0); + SendDlgItemMessage(hwndDlg, IDC_CBOPTSTATUS, CB_SETCURSEL, 0, 0); + j = SendDlgItemMessage(hwndDlg, IDC_CBOPTSTATUS, CB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_CBOPTSTATUS, CB_GETCURSEL, 0, 0), 0); } else - SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTSTATUS), CB_SETCURSEL, (WPARAM)newindex, 0); + SendDlgItemMessage(hwndDlg, IDC_CBOPTSTATUS, CB_SETCURSEL, (WPARAM)newindex, 0); if (data->status_msg[i].flags[j] & STATUS_SHOW_DLG) CheckDlgButton(hwndDlg, IDC_COPTMSG1, BST_CHECKED); @@ -517,8 +517,8 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L { int i, j; - i = SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTPROTO), CB_GETITEMDATA, (WPARAM)SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTPROTO), CB_GETCURSEL, 0, 0), 0); - j = SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTSTATUS), CB_GETITEMDATA, (WPARAM)SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTSTATUS), CB_GETCURSEL, 0, 0), 0); + i = SendDlgItemMessage(hwndDlg, IDC_CBOPTPROTO, CB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_CBOPTPROTO, CB_GETCURSEL, 0, 0), 0); + j = SendDlgItemMessage(hwndDlg, IDC_CBOPTSTATUS, CB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_CBOPTSTATUS, CB_GETCURSEL, 0, 0), 0); data->proto_msg[i].flags = 0; @@ -670,7 +670,7 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L int i, j; i = SendMessage((HWND)lParam, CB_GETITEMDATA, (WPARAM)SendMessage((HWND)lParam, CB_GETCURSEL, 0, 0), 0); - j = SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTPROTO), CB_GETITEMDATA, (WPARAM)SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTPROTO), CB_GETCURSEL, 0, 0), 0); + j = SendDlgItemMessage(hwndDlg, IDC_CBOPTPROTO, CB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_CBOPTPROTO, CB_GETCURSEL, 0, 0), 0); if (data->status_msg[j].flags[i] & STATUS_SHOW_DLG) CheckDlgButton(hwndDlg, IDC_COPTMSG1, BST_CHECKED); @@ -759,8 +759,8 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L { int i, j; - i = SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTSTATUS), CB_GETITEMDATA, (WPARAM)SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTSTATUS), CB_GETCURSEL, 0, 0), 0); - j = SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTPROTO), CB_GETITEMDATA, (WPARAM)SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTPROTO), CB_GETCURSEL, 0, 0), 0); + i = SendDlgItemMessage(hwndDlg, IDC_CBOPTSTATUS, CB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_CBOPTSTATUS, CB_GETCURSEL, 0, 0), 0); + j = SendDlgItemMessage(hwndDlg, IDC_CBOPTPROTO, CB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_CBOPTPROTO, CB_GETCURSEL, 0, 0), 0); if (IsDlgButtonChecked(hwndDlg, IDC_COPTMSG1) == BST_CHECKED) data->status_msg[j].flags[i] |= STATUS_SHOW_DLG; else @@ -780,8 +780,8 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L { int i, j; - i = SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTSTATUS), CB_GETITEMDATA, (WPARAM)SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTSTATUS), CB_GETCURSEL, 0, 0), 0); - j = SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTPROTO), CB_GETITEMDATA, (WPARAM)SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTPROTO), CB_GETCURSEL, 0, 0), 0); + i = SendDlgItemMessage(hwndDlg, IDC_CBOPTSTATUS, CB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_CBOPTSTATUS, CB_GETCURSEL, 0, 0), 0); + j = SendDlgItemMessage(hwndDlg, IDC_CBOPTPROTO, CB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_CBOPTPROTO, CB_GETCURSEL, 0, 0), 0); if (LOWORD(wParam) == IDC_ROPTMSG4 && data->proto_msg[j].flags & PROTO_THIS_MSG) break; @@ -869,8 +869,8 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L case IDC_OPTEDIT1: { - int i = SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTSTATUS), CB_GETITEMDATA, (WPARAM)SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTSTATUS), CB_GETCURSEL, 0, 0), 0); - int j = SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTPROTO), CB_GETITEMDATA, (WPARAM)SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTPROTO), CB_GETCURSEL, 0, 0), 0); + int i = SendDlgItemMessage(hwndDlg, IDC_CBOPTSTATUS, CB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_CBOPTSTATUS, CB_GETCURSEL, 0, 0), 0); + int j = SendDlgItemMessage(hwndDlg, IDC_CBOPTPROTO, CB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_CBOPTPROTO, CB_GETCURSEL, 0, 0), 0); if (HIWORD(wParam) == EN_KILLFOCUS) { @@ -914,7 +914,7 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L case IDC_BOPTPROTO: { int i, j, k; - j = SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTPROTO), CB_GETITEMDATA, (WPARAM)SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTPROTO), CB_GETCURSEL, 0, 0), 0); + j = SendDlgItemMessage(hwndDlg, IDC_CBOPTPROTO, CB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_CBOPTPROTO, CB_GETCURSEL, 0, 0), 0); if (j) { @@ -983,8 +983,8 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L { int status_modes, i, j, k; - i = SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTSTATUS), CB_GETITEMDATA, (WPARAM)SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTSTATUS), CB_GETCURSEL, 0, 0), 0); - j = SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTPROTO), CB_GETITEMDATA, (WPARAM)SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTPROTO), CB_GETCURSEL, 0, 0), 0); + i = SendDlgItemMessage(hwndDlg, IDC_CBOPTSTATUS, CB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_CBOPTSTATUS, CB_GETCURSEL, 0, 0), 0); + j = SendDlgItemMessage(hwndDlg, IDC_CBOPTPROTO, CB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_CBOPTPROTO, CB_GETCURSEL, 0, 0), 0); if (j) status_modes = CallProtoService(accounts->pa[j-1]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0); @@ -1219,15 +1219,15 @@ static INT_PTR CALLBACK DlgAdvancedOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM w TranslateDialogDefault(hwndDlg); // Layout - int i_btnhide = SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTBUTTONS), CB_ADDSTRING, 0, (LPARAM)TranslateT("Hide")); - int i_btndown = SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTBUTTONS), CB_ADDSTRING, 0, (LPARAM)TranslateT("Show next to cancel button")); - int i_btndownflat = SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTBUTTONS), CB_ADDSTRING, 0, (LPARAM)TranslateT("Flat, next to cancel button")); - int i_btnlist = SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTBUTTONS), CB_ADDSTRING, 0, (LPARAM)TranslateT("Show in message list")); + int i_btnhide = SendDlgItemMessage(hwndDlg, IDC_CBOPTBUTTONS, CB_ADDSTRING, 0, (LPARAM)TranslateT("Hide")); + int i_btndown = SendDlgItemMessage(hwndDlg, IDC_CBOPTBUTTONS, CB_ADDSTRING, 0, (LPARAM)TranslateT("Show next to cancel button")); + int i_btndownflat = SendDlgItemMessage(hwndDlg, IDC_CBOPTBUTTONS, CB_ADDSTRING, 0, (LPARAM)TranslateT("Flat, next to cancel button")); + int i_btnlist = SendDlgItemMessage(hwndDlg, IDC_CBOPTBUTTONS, CB_ADDSTRING, 0, (LPARAM)TranslateT("Show in message list")); - SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTBUTTONS), CB_SETITEMDATA, (WPARAM)i_btnhide, 0); - SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTBUTTONS), CB_SETITEMDATA, (WPARAM)i_btndown, DLG_SHOW_BUTTONS); - SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTBUTTONS), CB_SETITEMDATA, (WPARAM)i_btndownflat, DLG_SHOW_BUTTONS_FLAT); - SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTBUTTONS), CB_SETITEMDATA, (WPARAM)i_btnlist, DLG_SHOW_BUTTONS_INLIST); + SendDlgItemMessage(hwndDlg, IDC_CBOPTBUTTONS, CB_SETITEMDATA, (WPARAM)i_btnhide, 0); + SendDlgItemMessage(hwndDlg, IDC_CBOPTBUTTONS, CB_SETITEMDATA, (WPARAM)i_btndown, DLG_SHOW_BUTTONS); + SendDlgItemMessage(hwndDlg, IDC_CBOPTBUTTONS, CB_SETITEMDATA, (WPARAM)i_btndownflat, DLG_SHOW_BUTTONS_FLAT); + SendDlgItemMessage(hwndDlg, IDC_CBOPTBUTTONS, CB_SETITEMDATA, (WPARAM)i_btnlist, DLG_SHOW_BUTTONS_INLIST); settingValue = db_get_b(NULL, "SimpleStatusMsg", "DlgFlags", DLG_SHOW_DEFAULT); CheckDlgButton(hwndDlg, IDC_CSTATUSLIST, settingValue & DLG_SHOW_STATUS ? BST_CHECKED : BST_UNCHECKED); @@ -1241,13 +1241,13 @@ static INT_PTR CALLBACK DlgAdvancedOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM w } if (settingValue & DLG_SHOW_BUTTONS) - SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTBUTTONS), CB_SETCURSEL, (WPARAM)i_btndown, 0); + SendDlgItemMessage(hwndDlg, IDC_CBOPTBUTTONS, CB_SETCURSEL, (WPARAM)i_btndown, 0); else if (settingValue & DLG_SHOW_BUTTONS_FLAT) - SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTBUTTONS), CB_SETCURSEL, (WPARAM)i_btndownflat, 0); + SendDlgItemMessage(hwndDlg, IDC_CBOPTBUTTONS, CB_SETCURSEL, (WPARAM)i_btndownflat, 0); else if (settingValue & DLG_SHOW_BUTTONS_INLIST) - SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTBUTTONS), CB_SETCURSEL, (WPARAM)i_btnlist, 0); + SendDlgItemMessage(hwndDlg, IDC_CBOPTBUTTONS, CB_SETCURSEL, (WPARAM)i_btnlist, 0); else - SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTBUTTONS), CB_SETCURSEL, (WPARAM)i_btnhide, 0); + SendDlgItemMessage(hwndDlg, IDC_CBOPTBUTTONS, CB_SETCURSEL, (WPARAM)i_btnhide, 0); if (!ServiceExists(MS_SS_GETPROFILECOUNT)) { TCHAR szText[100]; @@ -1404,9 +1404,9 @@ static INT_PTR CALLBACK DlgAdvancedOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM w if (IsDlgButtonChecked(hwndDlg, IDC_CPROFILES) == BST_CHECKED) flags |= DLG_SHOW_STATUS_PROFILES; - curSel = SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTBUTTONS), CB_GETCURSEL, 0, 0); + curSel = SendDlgItemMessage(hwndDlg, IDC_CBOPTBUTTONS, CB_GETCURSEL, 0, 0); if (curSel != CB_ERR) - flags |= SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTBUTTONS), CB_GETITEMDATA, (WPARAM)curSel, 0); + flags |= SendDlgItemMessage(hwndDlg, IDC_CBOPTBUTTONS, CB_GETITEMDATA, (WPARAM)curSel, 0); db_set_b(NULL, "SimpleStatusMsg", "DlgFlags", (BYTE)flags); @@ -1454,7 +1454,7 @@ static INT_PTR CALLBACK DlgStatusOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wPa if (!IsAccountEnabled(accounts->pa[i]) || !(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) &~ CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_5, 0))) continue; - index = SendMessage(GetDlgItem(hwndDlg, IDC_LISTPROTO), LB_ADDSTRING, 0, (LPARAM)accounts->pa[i]->tszAccountName); + index = SendDlgItemMessage(hwndDlg, IDC_LISTPROTO, LB_ADDSTRING, 0, (LPARAM)accounts->pa[i]->tszAccountName); if (index != LB_ERR && index != LB_ERRSPACE) { char setting[80]; @@ -1462,22 +1462,22 @@ static INT_PTR CALLBACK DlgStatusOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wPa data->status[i] = db_get_w(NULL, "SimpleStatusMsg", setting, ID_STATUS_OFFLINE); mir_snprintf(setting, SIZEOF(setting), "Set%sStatusDelay", accounts->pa[i]->szModuleName); data->setdelay[i] = db_get_w(NULL, "SimpleStatusMsg", setting, 300); - SendMessage(GetDlgItem(hwndDlg, IDC_LISTPROTO), LB_SETITEMDATA, (WPARAM)index, (LPARAM)i); + SendDlgItemMessage(hwndDlg, IDC_LISTPROTO, LB_SETITEMDATA, (WPARAM)index, (LPARAM)i); } } - SendMessage(GetDlgItem(hwndDlg, IDC_LISTPROTO), LB_SETCURSEL, 0, 0); + SendDlgItemMessage(hwndDlg, IDC_LISTPROTO, LB_SETCURSEL, 0, 0); SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_LISTPROTO, LBN_SELCHANGE), (LPARAM)GetDlgItem(hwndDlg, IDC_LISTPROTO)); data->setglobaldelay = db_get_w(NULL, "SimpleStatusMsg", "SetStatusDelay", 300); - SendMessage(GetDlgItem(hwndDlg, IDC_SSETSTATUS), UDM_SETBUDDY, (WPARAM)GetDlgItem(hwndDlg, IDC_ESETSTATUS), 0); - SendMessage(GetDlgItem(hwndDlg, IDC_SSETSTATUS), UDM_SETRANGE32, 0, 9000); - SendMessage(GetDlgItem(hwndDlg, IDC_ESETSTATUS), EM_LIMITTEXT, 4, 0); + SendDlgItemMessage(hwndDlg, IDC_SSETSTATUS, UDM_SETBUDDY, (WPARAM)GetDlgItem(hwndDlg, IDC_ESETSTATUS), 0); + SendDlgItemMessage(hwndDlg, IDC_SSETSTATUS, UDM_SETRANGE32, 0, 9000); + SendDlgItemMessage(hwndDlg, IDC_ESETSTATUS, EM_LIMITTEXT, 4, 0); if (!db_get_b(NULL, "SimpleStatusMsg", "GlobalStatusDelay", 1)) { CheckDlgButton(hwndDlg, IDC_SPECSET, BST_CHECKED); - i = SendMessage(GetDlgItem(hwndDlg, IDC_LISTPROTO), LB_GETITEMDATA, (WPARAM)SendMessage(GetDlgItem(hwndDlg, IDC_LISTPROTO), LB_GETCURSEL, 0, 0), 0); + i = SendDlgItemMessage(hwndDlg, IDC_LISTPROTO, LB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_LISTPROTO, LB_GETCURSEL, 0, 0), 0); SetDlgItemInt(hwndDlg, IDC_ESETSTATUS, data->setdelay[i], FALSE); } else @@ -1503,7 +1503,7 @@ static INT_PTR CALLBACK DlgStatusOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wPa { EnableWindow(GetDlgItem(hwndDlg, IDC_SPECSET), FALSE); CheckDlgButton(hwndDlg, IDC_SPECSET, BST_UNCHECKED); //should work like when checked, but should not be checked - i = SendMessage(GetDlgItem(hwndDlg, IDC_LISTPROTO), LB_GETITEMDATA, (WPARAM)SendMessage(GetDlgItem(hwndDlg, IDC_LISTPROTO), LB_GETCURSEL, 0, 0), 0); + i = SendDlgItemMessage(hwndDlg, IDC_LISTPROTO, LB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_LISTPROTO, LB_GETCURSEL, 0, 0), 0); SetDlgItemInt(hwndDlg, IDC_ESETSTATUS, data->setdelay[i], FALSE); } @@ -1530,7 +1530,7 @@ static INT_PTR CALLBACK DlgStatusOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wPa if (IsDlgButtonChecked(hwndDlg, IDC_SPECSET) == BST_CHECKED || (accounts->statusCount == 1 && accounts->statusMsgCount == 1)) { - int i = SendMessage(GetDlgItem(hwndDlg, IDC_LISTPROTO), LB_GETITEMDATA, (WPARAM)SendMessage(GetDlgItem(hwndDlg, IDC_LISTPROTO), LB_GETCURSEL, 0, 0), 0); + int i = SendDlgItemMessage(hwndDlg, IDC_LISTPROTO, LB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_LISTPROTO, LB_GETCURSEL, 0, 0), 0); data->setdelay[i] = val; } else @@ -1546,7 +1546,7 @@ static INT_PTR CALLBACK DlgStatusOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wPa case BN_CLICKED: if (SendMessage((HWND)lParam, BM_GETCHECK, 0, 0) == BST_CHECKED || (accounts->statusCount == 1 && accounts->statusMsgCount == 1)) { - int i = SendMessage(GetDlgItem(hwndDlg, IDC_LISTPROTO), LB_GETITEMDATA, (WPARAM)SendMessage(GetDlgItem(hwndDlg, IDC_LISTPROTO), LB_GETCURSEL, 0, 0), 0); + int i = SendDlgItemMessage(hwndDlg, IDC_LISTPROTO, LB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_LISTPROTO, LB_GETCURSEL, 0, 0), 0); SetDlgItemInt(hwndDlg, IDC_ESETSTATUS, data->setdelay[i], FALSE); } else @@ -1585,30 +1585,30 @@ static INT_PTR CALLBACK DlgStatusOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wPa i = SendMessage((HWND)lParam, LB_GETITEMDATA, (WPARAM)SendMessage((HWND)lParam, LB_GETCURSEL, 0, 0), 0); status_modes = CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) & ~CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_5, 0); - SendMessage(GetDlgItem(hwndDlg, IDC_LISTSTATUS), LB_RESETCONTENT, 0, 0); + SendDlgItemMessage(hwndDlg, IDC_LISTSTATUS, LB_RESETCONTENT, 0, 0); for (l = ID_STATUS_OFFLINE; l <= ID_STATUS_OUTTOLUNCH; l++) { if (status_modes & Proto_Status2Flag(l) || l == ID_STATUS_OFFLINE) { - index = SendMessage(GetDlgItem(hwndDlg, IDC_LISTSTATUS), LB_INSERTSTRING, -1, (LPARAM)pcli->pfnGetStatusModeDescription(l, 0)); + index = SendDlgItemMessage(hwndDlg, IDC_LISTSTATUS, LB_INSERTSTRING, -1, (LPARAM)pcli->pfnGetStatusModeDescription(l, 0)); if (index != LB_ERR && index != LB_ERRSPACE) { - SendMessage(GetDlgItem(hwndDlg, IDC_LISTSTATUS), LB_SETITEMDATA, (WPARAM)index, (LPARAM)l - ID_STATUS_OFFLINE); + SendDlgItemMessage(hwndDlg, IDC_LISTSTATUS, LB_SETITEMDATA, (WPARAM)index, (LPARAM)l - ID_STATUS_OFFLINE); if (data->status[i] == l) newindex = index; } } } - index = SendMessage(GetDlgItem(hwndDlg, IDC_LISTSTATUS), LB_INSERTSTRING, -1, (LPARAM)TranslateT("")); + index = SendDlgItemMessage(hwndDlg, IDC_LISTSTATUS, LB_INSERTSTRING, -1, (LPARAM)TranslateT("")); if (index != LB_ERR && index != LB_ERRSPACE) { - SendMessage(GetDlgItem(hwndDlg, IDC_LISTSTATUS), LB_SETITEMDATA, (WPARAM)index, (LPARAM)ID_STATUS_CURRENT-ID_STATUS_OFFLINE); + SendDlgItemMessage(hwndDlg, IDC_LISTSTATUS, LB_SETITEMDATA, (WPARAM)index, (LPARAM)ID_STATUS_CURRENT - ID_STATUS_OFFLINE); if (data->status[i] == ID_STATUS_CURRENT) newindex = index; } - SendMessage(GetDlgItem(hwndDlg, IDC_LISTSTATUS), LB_SETCURSEL, (WPARAM)newindex, 0); + SendDlgItemMessage(hwndDlg, IDC_LISTSTATUS, LB_SETCURSEL, (WPARAM)newindex, 0); if (IsDlgButtonChecked(hwndDlg, IDC_SPECSET) == BST_CHECKED || (accounts->statusCount == 1 && accounts->statusMsgCount == 1)) SetDlgItemInt(hwndDlg, IDC_ESETSTATUS, data->setdelay[i], FALSE); @@ -1622,7 +1622,7 @@ static INT_PTR CALLBACK DlgStatusOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wPa case LBN_SELCHANGE: { int i = SendMessage((HWND)lParam, LB_GETITEMDATA, (WPARAM)SendMessage((HWND)lParam, LB_GETCURSEL, 0, 0), 0); - int j = SendMessage(GetDlgItem(hwndDlg, IDC_LISTPROTO), LB_GETITEMDATA, (WPARAM)SendMessage(GetDlgItem(hwndDlg, IDC_LISTPROTO), LB_GETCURSEL, 0, 0), 0); + int j = SendDlgItemMessage(hwndDlg, IDC_LISTPROTO, LB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_LISTPROTO, LB_GETCURSEL, 0, 0), 0); data->status[j] = i + ID_STATUS_OFFLINE; break; } diff --git a/plugins/Spamotron/src/options.cpp b/plugins/Spamotron/src/options.cpp index d20d36855b..70de5acef5 100644 --- a/plugins/Spamotron/src/options.cpp +++ b/plugins/Spamotron/src/options.cpp @@ -288,8 +288,8 @@ INT_PTR CALLBACK DlgProcOptionsQuestion(HWND optDlg, UINT msg, WPARAM wParam, LP case IDC_OPT_MODE: if (HIWORD(wParam) != CBN_SELCHANGE) return FALSE; - i = SendMessage(GetDlgItem(optDlg, IDC_OPT_MODE), CB_GETCURSEL, 0, 0); - selectedMode = SendMessage(GetDlgItem(optDlg, IDC_OPT_MODE), CB_GETITEMDATA, i, 0); + i = SendDlgItemMessage(optDlg, IDC_OPT_MODE, CB_GETCURSEL, 0, 0); + selectedMode = SendDlgItemMessage(optDlg, IDC_OPT_MODE, CB_GETITEMDATA, i, 0); buf = (TCHAR*)malloc(buflen*sizeof(TCHAR)); switch (selectedMode) { case SPAMOTRON_MODE_PLAIN: @@ -355,8 +355,8 @@ INT_PTR CALLBACK DlgProcOptionsQuestion(HWND optDlg, UINT msg, WPARAM wParam, LP case WM_NOTIFY: switch (((NMHDR*)lParam)->code) { case PSN_APPLY: - i = SendMessage(GetDlgItem(optDlg, IDC_OPT_MODE), CB_GETCURSEL, 0, 0); - selectedMode = SendMessage(GetDlgItem(optDlg, IDC_OPT_MODE), CB_GETITEMDATA, i, 0); + i = SendDlgItemMessage(optDlg, IDC_OPT_MODE, CB_GETCURSEL, 0, 0); + selectedMode = SendDlgItemMessage(optDlg, IDC_OPT_MODE, CB_GETITEMDATA, i, 0); _setOptB("Mode", selectedMode); _setOptB("ReplyOnSuccess", SendDlgItemMessage(optDlg, IDC_OPT_REPLY_ON_SUCCESS, BM_GETCHECK, 0, 0)); _setOptB("ReplyOnAuth", SendDlgItemMessage(optDlg, IDC_OPT_REPLY_ON_AUTH, BM_GETCHECK, 0, 0)); diff --git a/plugins/StatusPlugins/StartupStatus/options.cpp b/plugins/StatusPlugins/StartupStatus/options.cpp index ca68b447cd..50e90a8f6b 100644 --- a/plugins/StatusPlugins/StartupStatus/options.cpp +++ b/plugins/StatusPlugins/StartupStatus/options.cpp @@ -754,7 +754,7 @@ static INT_PTR CALLBACK StatusProfilesOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wP free(ps->szMsg); ps->szMsg = NULL; } - int len = SendDlgItemMessageA(hwndDlg, IDC_STATUSMSG, WM_GETTEXTLENGTH, 0, 0); + int len = SendDlgItemMessage(hwndDlg, IDC_STATUSMSG, WM_GETTEXTLENGTH, 0, 0); ps->szMsg = (TCHAR*)calloc(sizeof(TCHAR), len+1); SendDlgItemMessage(hwndDlg, IDC_STATUSMSG, WM_GETTEXT, (WPARAM)len+1, (LPARAM)ps->szMsg); } diff --git a/plugins/StatusPlugins/confirmdialog.cpp b/plugins/StatusPlugins/confirmdialog.cpp index 9813826bde..28d917c249 100644 --- a/plugins/StatusPlugins/confirmdialog.cpp +++ b/plugins/StatusPlugins/confirmdialog.cpp @@ -77,7 +77,7 @@ static INT_PTR CALLBACK StatusMessageDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam switch (LOWORD(wParam)) { case IDC_OK: { - int len = SendMessage(GetDlgItem(hwndDlg, IDC_STSMSG), WM_GETTEXTLENGTH, 0, 0); + int len = SendDlgItemMessage(hwndDlg, IDC_STSMSG, WM_GETTEXTLENGTH, 0, 0); if (len > 0) { protoSetting->szMsg = ( TCHAR* )realloc(protoSetting->szMsg, sizeof(TCHAR)*(len+1)); if (protoSetting->szMsg != NULL) diff --git a/plugins/TabSRMM/src/buttonsbar.cpp b/plugins/TabSRMM/src/buttonsbar.cpp index 2b412e2ed4..52f5cc1960 100644 --- a/plugins/TabSRMM/src/buttonsbar.cpp +++ b/plugins/TabSRMM/src/buttonsbar.cpp @@ -784,11 +784,11 @@ void BB_RefreshTheme(const TWindowData *dat) { for (int i = 0; i < RButtonsList.getCount(); i++) { CustomButtonData* cbd = RButtonsList[i]; - SendMessage(GetDlgItem(dat->hwnd, cbd->dwButtonCID), WM_THEMECHANGED, 0, 0); + SendDlgItemMessage(dat->hwnd, cbd->dwButtonCID, WM_THEMECHANGED, 0, 0); } for (int i = 0; i < LButtonsList.getCount(); i++) { CustomButtonData* cbd = LButtonsList[i]; - SendMessage(GetDlgItem(dat->hwnd, cbd->dwButtonCID), WM_THEMECHANGED, 0, 0); + SendDlgItemMessage(dat->hwnd, cbd->dwButtonCID, WM_THEMECHANGED, 0, 0); } } diff --git a/plugins/TabSRMM/src/chat/message.cpp b/plugins/TabSRMM/src/chat/message.cpp index fd20f7e7a5..f303aae897 100644 --- a/plugins/TabSRMM/src/chat/message.cpp +++ b/plugins/TabSRMM/src/chat/message.cpp @@ -344,6 +344,6 @@ char* Chat_Message_GetFromStream(HWND hwndDlg, SESSION_INFO *si) stream.dwCookie = (DWORD_PTR)&pszText; // pass pointer to pointer DWORD dwFlags = SF_RTFNOOBJS | SFF_PLAINRTF | SF_USECODEPAGE | (CP_UTF8 << 16); - SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE), EM_STREAMOUT, dwFlags, (LPARAM)&stream); + SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_STREAMOUT, dwFlags, (LPARAM)&stream); return pszText; // pszText contains the text } diff --git a/plugins/TabSRMM/src/chat/window.cpp b/plugins/TabSRMM/src/chat/window.cpp index aa3a51607e..90c106978e 100644 --- a/plugins/TabSRMM/src/chat/window.cpp +++ b/plugins/TabSRMM/src/chat/window.cpp @@ -752,7 +752,7 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, else if (wParam == VK_DOWN) wp = MAKEWPARAM(SB_LINEDOWN, 0); - SendMessage(GetDlgItem(hwndParent, IDC_CHAT_LOG), WM_VSCROLL, wp, 0); + SendDlgItemMessage(hwndParent, IDC_CHAT_LOG, WM_VSCROLL, wp, 0); return 0; } } @@ -1261,7 +1261,7 @@ static LRESULT CALLBACK LogSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR return DM_WMCopyHandler(hwnd, LogSubclassProc, msg, wParam, lParam); SetFocus(GetDlgItem(hwndParent, IDC_CHAT_MESSAGE)); - SendMessage(GetDlgItem(hwndParent, IDC_CHAT_MESSAGE), WM_CHAR, wParam, lParam); + SendDlgItemMessage(hwndParent, IDC_CHAT_MESSAGE, WM_CHAR, wParam, lParam); break; } @@ -1669,7 +1669,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, GetCursorPos(&pt); ScreenToClient(hwnd, &pt); - DWORD nItemUnderMouse = (DWORD)SendMessage(GetDlgItem(dat->hwnd, IDC_LIST), LB_ITEMFROMPOINT, 0, MAKELPARAM(pt.x, pt.y)); + DWORD nItemUnderMouse = (DWORD)SendDlgItemMessage(dat->hwnd, IDC_LIST, LB_ITEMFROMPOINT, 0, MAKELPARAM(pt.x, pt.y)); if (HIWORD(nItemUnderMouse) == 1) nItemUnderMouse = (DWORD)(-1); else @@ -1819,7 +1819,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar BB_InitDlgButtons(dat); DM_InitTip(dat); - SendMessage(GetDlgItem(hwndDlg,IDC_COLOR), BUTTONSETASPUSHBTN, TRUE, 0); + SendDlgItemMessage(hwndDlg,IDC_COLOR, BUTTONSETASPUSHBTN, TRUE, 0); mir_subclassWindow( GetDlgItem(hwndDlg, IDC_SPLITTERX), SplitterSubclassProc); mir_subclassWindow( GetDlgItem(hwndDlg, IDC_SPLITTERY), SplitterSubclassProc); @@ -1848,7 +1848,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar UpdateTrayMenu(0, dat->wStatus, dat->szProto, dat->szStatus, dat->hContact, FALSE); DM_ThemeChanged(dat); - SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_LOG), EM_HIDESELECTION, TRUE, 0); + SendDlgItemMessage(hwndDlg, IDC_CHAT_LOG, EM_HIDESELECTION, TRUE, 0); CustomizeButton( CreateWindowEx(0, _T("MButtonClass"), _T(""), WS_CHILD | WS_VISIBLE | WS_TABSTOP, 0, 0, 6, DPISCALEY_S(20), hwndDlg, (HMENU)IDC_CHAT_TOGGLESIDEBAR, g_hInst, NULL)); @@ -1903,7 +1903,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar DM_InitRichEdit(dat); SendDlgItemMessage(hwndDlg, IDOK, BUTTONSETASNORMAL, TRUE, 0); - SendMessage(GetDlgItem(hwndDlg, IDC_LIST), LB_SETITEMHEIGHT, 0, (LPARAM)g_Settings.iNickListFontHeight); + SendDlgItemMessage(hwndDlg, IDC_LIST, LB_SETITEMHEIGHT, 0, (LPARAM)g_Settings.iNickListFontHeight); InvalidateRect(GetDlgItem(hwndDlg, IDC_LIST), NULL, TRUE); SendDlgItemMessage(hwndDlg, IDC_FILTER, BUTTONSETOVERLAYICON, @@ -2281,9 +2281,9 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar case GC_UPDATENICKLIST: { - int i = SendMessage(GetDlgItem(hwndDlg, IDC_LIST), LB_GETTOPINDEX, 0, 0); - SendMessage(GetDlgItem(hwndDlg, IDC_LIST), LB_SETCOUNT, si->nUsersInNicklist, 0); - SendMessage(GetDlgItem(hwndDlg, IDC_LIST), LB_SETTOPINDEX, i, 0); + int i = SendDlgItemMessage(hwndDlg, IDC_LIST, LB_GETTOPINDEX, 0, 0); + SendDlgItemMessage(hwndDlg, IDC_LIST, LB_SETCOUNT, si->nUsersInNicklist, 0); + SendDlgItemMessage(hwndDlg, IDC_LIST, LB_SETTOPINDEX, i, 0); SendMessage(hwndDlg, GC_UPDATETITLE, 0, 0); } break; @@ -2496,7 +2496,7 @@ LABEL_SHOWWINDOW: } if (msg == WM_KEYDOWN) { if ((wp == VK_INSERT && isShift && !isCtrl && !isMenu) || (wp == 'V' && !isShift && !isMenu && isCtrl)) { - SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE), EM_PASTESPECIAL, CF_UNICODETEXT, 0); + SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_PASTESPECIAL, CF_UNICODETEXT, 0); ((MSGFILTER*)lParam)->msg = WM_NULL; ((MSGFILTER*)lParam)->wParam = 0; ((MSGFILTER*)lParam)->lParam = 0; @@ -2552,12 +2552,12 @@ LABEL_SHOWWINDOW: pszWord[0] = '\0'; POINTL ptl = { pt.x, pt.y }; ScreenToClient(GetDlgItem(hwndDlg, IDC_CHAT_LOG), (LPPOINT)&ptl); - int iCharIndex = SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_LOG), EM_CHARFROMPOS, 0, (LPARAM)&ptl); + int iCharIndex = SendDlgItemMessage(hwndDlg, IDC_CHAT_LOG, EM_CHARFROMPOS, 0, (LPARAM)&ptl); if (iCharIndex < 0) break; - int start = SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_LOG), EM_FINDWORDBREAK, WB_LEFT, iCharIndex); - int end = SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_LOG), EM_FINDWORDBREAK, WB_RIGHT, iCharIndex); + int start = SendDlgItemMessage(hwndDlg, IDC_CHAT_LOG, EM_FINDWORDBREAK, WB_LEFT, iCharIndex); + int end = SendDlgItemMessage(hwndDlg, IDC_CHAT_LOG, EM_FINDWORDBREAK, WB_RIGHT, iCharIndex); if (end - start > 0) { static char szTrimString[] = ":;,.!?\'\"><()[]- \r\n"; @@ -2569,7 +2569,7 @@ LABEL_SHOWWINDOW: TEXTRANGE tr = { 0 }; tr.chrg = cr; tr.lpstrText = (TCHAR*)pszWord; - int iRes = SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_LOG), EM_GETTEXTRANGE, 0, (LPARAM)&tr); + int iRes = SendDlgItemMessage(hwndDlg, IDC_CHAT_LOG, EM_GETTEXTRANGE, 0, (LPARAM)&tr); if (iRes > 0) { size_t iLen = mir_tstrlen(pszWord) - 1; @@ -2844,11 +2844,11 @@ LABEL_SHOWWINDOW: hti.pt.y = (short)HIWORD(GetMessagePos()); ScreenToClient(GetDlgItem(hwndDlg, IDC_LIST), &hti.pt); - int item = LOWORD(SendMessage(GetDlgItem(hwndDlg, IDC_LIST), LB_ITEMFROMPOINT, 0, MAKELPARAM(hti.pt.x, hti.pt.y))); + int item = LOWORD(SendDlgItemMessage(hwndDlg, IDC_LIST, LB_ITEMFROMPOINT, 0, MAKELPARAM(hti.pt.x, hti.pt.y))); USERINFO *ui = pci->UM_FindUserFromIndex(si->pUsers, item); if (ui) { if (g_Settings.bDoubleClick4Privat ? GetKeyState(VK_SHIFT) & 0x8000 : !(GetKeyState(VK_SHIFT) & 0x8000)) { - LRESULT lResult = (LRESULT)SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE), EM_GETSEL, 0, 0); + LRESULT lResult = (LRESULT)SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_GETSEL, 0, 0); int start = LOWORD(lResult); CMString tszName; if (start == 0) @@ -2856,7 +2856,7 @@ LABEL_SHOWWINDOW: else tszName.Format(_T("%s "), ui->pszNick); - SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE), EM_REPLACESEL, FALSE, (LPARAM)tszName.GetString()); + SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_REPLACESEL, FALSE, (LPARAM)tszName.GetString()); PostMessage(hwndDlg, WM_MOUSEACTIVATE, 0, 0); SetFocus(GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE)); } diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp index 4f3f4c9bc6..d3f5f1136b 100644 --- a/plugins/TabSRMM/src/generic_msghandlers.cpp +++ b/plugins/TabSRMM/src/generic_msghandlers.cpp @@ -1194,7 +1194,7 @@ LRESULT TSAPI DM_MouseWheelHandler(HWND hwnd, HWND hwndParent, TWindowData *mwda RECT rcNicklist; GetWindowRect(GetDlgItem(mwdat->hwnd, IDC_LIST), &rcNicklist); if (PtInRect(&rcNicklist, pt)) { - SendMessage(GetDlgItem(mwdat->hwnd, IDC_LIST), WM_MOUSEWHEEL, wParam, lParam); + SendDlgItemMessage(mwdat->hwnd, IDC_LIST, WM_MOUSEWHEEL, wParam, lParam); return 0; } } @@ -1790,7 +1790,7 @@ void TSAPI DM_UpdateTitle(TWindowData *dat, WPARAM, LPARAM lParam) TranslateT("UID: %s (SHIFT click -> copy to clipboard)\nClick for User's Details\nClick dropdown to change this contact's favorite status."), bHasName ? dat->cache->getUIN() : TranslateT("No UID")); - SendMessage(GetDlgItem(hwndDlg, IDC_NAME), BUTTONADDTOOLTIP, (WPARAM)fulluin, BATF_TCHAR); + SendDlgItemMessage(hwndDlg, IDC_NAME, BUTTONADDTOOLTIP, (WPARAM)fulluin, BATF_TCHAR); } } else _tcsncpy_s(newtitle, _T("Message Session"), _TRUNCATE); diff --git a/plugins/TabSRMM/src/hotkeyhandler.cpp b/plugins/TabSRMM/src/hotkeyhandler.cpp index 084244107a..041ffbf578 100644 --- a/plugins/TabSRMM/src/hotkeyhandler.cpp +++ b/plugins/TabSRMM/src/hotkeyhandler.cpp @@ -502,7 +502,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP ReloadTabConfig(); for (p = pFirstContainer; p; p = p->pNext) { - SendMessage(GetDlgItem(p->hwnd, IDC_MSGTABS), EM_THEMECHANGED, 0, 0); + SendDlgItemMessage(p->hwnd, IDC_MSGTABS, EM_THEMECHANGED, 0, 0); BroadCastContainer(p, EM_THEMECHANGED, 0, 0); } break; diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index 682fb6b67a..b429c066af 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -184,7 +184,7 @@ static void ShowPopupMenu(TWindowData *dat, int idFrom, HWND hwndFrom, POINT pt) ClearLog(dat); break; case ID_LOG_FREEZELOG: - SendMessage(GetDlgItem(hwndDlg, IDC_LOG), WM_KEYDOWN, VK_F12, 0); + SendDlgItemMessage(hwndDlg, IDC_LOG, WM_KEYDOWN, VK_F12, 0); break; case ID_EDITOR_SHOWMESSAGELENGTHINDICATOR: PluginConfig.m_visualMessageSizeIndicator = !PluginConfig.m_visualMessageSizeIndicator; @@ -717,7 +717,7 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPar wp = MAKEWPARAM(SB_LINEDOWN, 0); if (mwdat->hwndIEView == 0 && mwdat->hwndHPP == 0) - SendMessage(GetDlgItem(hwndParent, IDC_LOG), WM_VSCROLL, wp, 0); + SendDlgItemMessage(hwndParent, IDC_LOG, WM_VSCROLL, wp, 0); else SendMessage(mwdat->hwndIWebBrowserControl, WM_VSCROLL, wp, 0); return 0; @@ -1309,8 +1309,8 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP !SkinItems[ID_EXTBKBUTTONSPRESSED].IGNORED && !SkinItems[ID_EXTBKBUTTONSMOUSEOVER].IGNORED) isThemed = FALSE; - SendMessage(GetDlgItem(hwndDlg, IDC_ADD), BUTTONSETASFLATBTN, TRUE, 0); - SendMessage(GetDlgItem(hwndDlg, IDC_CANCELADD), BUTTONSETASFLATBTN, TRUE, 0); + SendDlgItemMessage(hwndDlg, IDC_ADD, BUTTONSETASFLATBTN, TRUE, 0); + SendDlgItemMessage(hwndDlg, IDC_CANCELADD, BUTTONSETASFLATBTN, TRUE, 0); SendDlgItemMessage(hwndDlg, IDC_TOGGLESIDEBAR, BUTTONSETASFLATBTN, TRUE, 0); SendDlgItemMessage(hwndDlg, IDC_TOGGLESIDEBAR, BUTTONSETASTHEMEDBTN, isThemed, 0); @@ -1325,8 +1325,8 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP SetDlgItemText(hwndDlg, IDC_LOGFROZENTEXT, dat->bNotOnList ? TranslateT("Contact not on list. You may add it...") : TranslateT("Auto scrolling is disabled (press F12 to enable it)")); - SendMessage(GetDlgItem(hwndDlg, IDC_SAVE), BUTTONADDTOOLTIP, (WPARAM)pszIDCSAVE_close, BATF_TCHAR); - SendMessage(GetDlgItem(hwndDlg, IDC_PROTOCOL), BUTTONADDTOOLTIP, (WPARAM)TranslateT("Click for contact menu\nClick dropdown for window settings"), BATF_TCHAR); + SendDlgItemMessage(hwndDlg, IDC_SAVE, BUTTONADDTOOLTIP, (WPARAM)pszIDCSAVE_close, BATF_TCHAR); + SendDlgItemMessage(hwndDlg, IDC_PROTOCOL, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Click for contact menu\nClick dropdown for window settings"), BATF_TCHAR); SetWindowText(GetDlgItem(hwndDlg, IDC_RETRY), TranslateT("Retry")); @@ -1825,7 +1825,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP } if (msg == WM_KEYDOWN) { if ((wp == VK_INSERT && isShift && !isCtrl) || (wp == 'V' && isCtrl && !isShift && !isAlt)) { - SendMessage(GetDlgItem(hwndDlg, IDC_MESSAGE), EM_PASTESPECIAL, CF_UNICODETEXT, 0); + SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_PASTESPECIAL, CF_UNICODETEXT, 0); _clrMsgFilter(lParam); return(_dlgReturn(hwndDlg, 1)); } @@ -1899,7 +1899,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (msg == WM_KEYDOWN && wp == VK_TAB) { if (PluginConfig.m_AllowTab) { if (((NMHDR*)lParam)->idFrom == IDC_MESSAGE) - SendMessage(GetDlgItem(hwndDlg, IDC_MESSAGE), EM_REPLACESEL, FALSE, (LPARAM)"\t"); + SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_REPLACESEL, FALSE, (LPARAM)"\t"); _clrMsgFilter(lParam); if (((NMHDR*)lParam)->idFrom != IDC_MESSAGE) SetFocus(GetDlgItem(hwndDlg, IDC_MESSAGE)); @@ -1928,9 +1928,9 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP short wDirection = (short)HIWORD(wp); if (LOWORD(wp) & MK_SHIFT) { if (wDirection < 0) - SendMessage(GetDlgItem(hwndDlg, IDC_LOG), WM_VSCROLL, MAKEWPARAM(SB_PAGEDOWN, 0), 0); + SendDlgItemMessage(hwndDlg, IDC_LOG, WM_VSCROLL, MAKEWPARAM(SB_PAGEDOWN, 0), 0); else if (wDirection > 0) - SendMessage(GetDlgItem(hwndDlg, IDC_LOG), WM_VSCROLL, MAKEWPARAM(SB_PAGEUP, 0), 0); + SendDlgItemMessage(hwndDlg, IDC_LOG, WM_VSCROLL, MAKEWPARAM(SB_PAGEUP, 0), 0); return 0; } return 0; @@ -2003,7 +2003,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP case WM_LBUTTONUP: if (((NMHDR*) lParam)->idFrom == IDC_LOG) { CHARRANGE cr; - SendMessage(GetDlgItem(hwndDlg, IDC_LOG), EM_EXGETSEL, 0, (LPARAM)&cr); + SendDlgItemMessage(hwndDlg, IDC_LOG, EM_EXGETSEL, 0, (LPARAM)&cr); if (cr.cpMax != cr.cpMin) { cr.cpMin = cr.cpMax; if (isCtrl && M.GetByte("autocopy", 1)) { @@ -2015,13 +2015,13 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP streamOut = Message_GetFromStream(GetDlgItem(hwndDlg, IDC_LOG), dat, (CP_UTF8 << 16) | (SF_TEXT | SFF_SELECTION | SF_USECODEPAGE)); if (streamOut) { Utils::FilterEventMarkers(streamOut); - SendMessage(GetDlgItem(hwndDlg, IDC_MESSAGE), EM_SETTEXTEX, (WPARAM)&stx, (LPARAM)streamOut); + SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_SETTEXTEX, (WPARAM)&stx, (LPARAM)streamOut); mir_free(streamOut); } SetFocus(GetDlgItem(hwndDlg, IDC_MESSAGE)); } else if (M.GetByte("autocopy", 1) && !isShift) { - SendMessage(GetDlgItem(hwndDlg, IDC_LOG), WM_COPY, 0, 0); + SendDlgItemMessage(hwndDlg, IDC_LOG, WM_COPY, 0, 0); SetFocus(GetDlgItem(hwndDlg, IDC_MESSAGE)); if (m_pContainer->hwndStatus) SendMessage(m_pContainer->hwndStatus, SB_SETTEXT, 0, (LPARAM)TranslateT("Selection copied to clipboard")); diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp index e084a2dcf2..9c6e91b953 100644 --- a/plugins/TabSRMM/src/msgdlgutils.cpp +++ b/plugins/TabSRMM/src/msgdlgutils.cpp @@ -1439,7 +1439,7 @@ void TSAPI HandlePasteAndSend(const TWindowData *dat) return; // feature disabled } - SendMessage(GetDlgItem(dat->hwnd, ctrlID), EM_PASTESPECIAL, CF_UNICODETEXT, 0); + SendDlgItemMessage(dat->hwnd, ctrlID, EM_PASTESPECIAL, CF_UNICODETEXT, 0); if (GetWindowTextLength(GetDlgItem(dat->hwnd, ctrlID)) > 0) SendMessage(dat->hwnd, WM_COMMAND, IDOK, 0); } @@ -1763,8 +1763,8 @@ LRESULT TSAPI GetSendButtonState(HWND hwnd) void TSAPI EnableSendButton(const TWindowData *dat, int iMode) { - SendMessage(GetDlgItem(dat->hwnd, IDOK), BUTTONSETASNORMAL, iMode, 0); - SendMessage(GetDlgItem(dat->hwnd, IDC_PIC), BUTTONSETASNORMAL, dat->fEditNotesActive ? TRUE : (!iMode && dat->iOpenJobs == 0) ? TRUE : FALSE, 0); + SendDlgItemMessage(dat->hwnd, IDOK, BUTTONSETASNORMAL, iMode, 0); + SendDlgItemMessage(dat->hwnd, IDC_PIC, BUTTONSETASNORMAL, dat->fEditNotesActive ? TRUE : (!iMode && dat->iOpenJobs == 0) ? TRUE : FALSE, 0); HWND hwndOK = GetDlgItem(GetParent(GetParent(dat->hwnd)), IDOK); diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp index 8db04c4f7e..fda6465060 100644 --- a/plugins/TabSRMM/src/msgs.cpp +++ b/plugins/TabSRMM/src/msgs.cpp @@ -302,7 +302,7 @@ INT_PTR SendMessageCommand_Worker(MCONTACT hContact, LPCSTR pszMsg, bool isWchar if (hwnd) { if (pszMsg) { HWND hEdit = GetDlgItem(hwnd, IDC_MESSAGE); - SendMessage(hEdit, EM_SETSEL, -1, SendMessage(hEdit, WM_GETTEXTLENGTH, 0, 0)); + SendMessage(hEdit, EM_SETSEL, -1, GetWindowTextLength(hEdit)); if (isWchar) SendMessageW(hEdit, EM_REPLACESEL, FALSE, (LPARAM)pszMsg); else diff --git a/plugins/TabSRMM/src/templates.cpp b/plugins/TabSRMM/src/templates.cpp index ed9c8119b1..7cdbeaba65 100644 --- a/plugins/TabSRMM/src/templates.cpp +++ b/plugins/TabSRMM/src/templates.cpp @@ -185,7 +185,7 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP SendDlgItemMessage(hwndDlg, IDC_COLOR3, CPM_SETCOLOUR, 0, M.GetDword("cc3", SRMSGDEFSET_BKGCOLOUR)); SendDlgItemMessage(hwndDlg, IDC_COLOR4, CPM_SETCOLOUR, 0, M.GetDword("cc4", SRMSGDEFSET_BKGCOLOUR)); SendDlgItemMessage(hwndDlg, IDC_COLOR5, CPM_SETCOLOUR, 0, M.GetDword("cc5", SRMSGDEFSET_BKGCOLOUR)); - SendMessage(GetDlgItem(hwndDlg, IDC_EDITTEMPLATE), EM_SETREADONLY, TRUE, 0); + SendDlgItemMessage(hwndDlg, IDC_EDITTEMPLATE, EM_SETREADONLY, TRUE, 0); } return TRUE; @@ -217,7 +217,7 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP teInfo->changed = FALSE; teInfo->selchanging = FALSE; SetFocus(GetDlgItem(hwndDlg, IDC_EDITTEMPLATE)); - SendMessage(GetDlgItem(hwndDlg, IDC_EDITTEMPLATE), EM_SETREADONLY, FALSE, 0); + SendDlgItemMessage(hwndDlg, IDC_EDITTEMPLATE, EM_SETREADONLY, FALSE, 0); } break; @@ -229,7 +229,7 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP teInfo->inEdit = iIndex; teInfo->changed = FALSE; } - SendMessage(GetDlgItem(hwndDlg, IDC_EDITTEMPLATE), EM_SETREADONLY, TRUE, 0); + SendDlgItemMessage(hwndDlg, IDC_EDITTEMPLATE, EM_SETREADONLY, TRUE, 0); } break; @@ -264,7 +264,7 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP Utils::enableDlgControl(hwndDlg, IDC_REVERT, FALSE); InvalidateRect(GetDlgItem(hwndDlg, IDC_TEMPLATELIST), NULL, FALSE); db_set_ts(teInfo->hContact, teInfo->rtl ? RTLTEMPLATES_MODULE : TEMPLATES_MODULE, TemplateNames[teInfo->inEdit], newTemplate); - SendMessage(GetDlgItem(hwndDlg, IDC_EDITTEMPLATE), EM_SETREADONLY, TRUE, 0); + SendDlgItemMessage(hwndDlg, IDC_EDITTEMPLATE, EM_SETREADONLY, TRUE, 0); } break; @@ -280,7 +280,7 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP Utils::enableDlgControl(hwndDlg, IDC_TEMPLATELIST, TRUE); Utils::enableDlgControl(hwndDlg, IDC_REVERT, FALSE); teInfo->selchanging = FALSE; - SendMessage(GetDlgItem(hwndDlg, IDC_EDITTEMPLATE), EM_SETREADONLY, TRUE, 0); + SendDlgItemMessage(hwndDlg, IDC_EDITTEMPLATE, EM_SETREADONLY, TRUE, 0); break; case IDC_REVERT: @@ -297,7 +297,7 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP Utils::enableDlgControl(hwndDlg, IDC_REVERT, FALSE); Utils::enableDlgControl(hwndDlg, IDC_FORGET, FALSE); Utils::enableDlgControl(hwndDlg, IDC_TEMPLATELIST, TRUE); - SendMessage(GetDlgItem(hwndDlg, IDC_EDITTEMPLATE), EM_SETREADONLY, TRUE, 0); + SendDlgItemMessage(hwndDlg, IDC_EDITTEMPLATE, EM_SETREADONLY, TRUE, 0); break; case IDC_UPDATEPREVIEW: diff --git a/plugins/Variables/src/help.cpp b/plugins/Variables/src/help.cpp index 62cce73d33..53c313b153 100644 --- a/plugins/Variables/src/help.cpp +++ b/plugins/Variables/src/help.cpp @@ -58,17 +58,17 @@ static INT_PTR CALLBACK extratextDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPA case VARM_SETEXTRATEXT: SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, - SendMessage(GetDlgItem(hwndDlg, IDC_EXTRATEXT), WM_SETTEXT, wParam, lParam)); + SendDlgItemMessage(hwndDlg, IDC_EXTRATEXT, WM_SETTEXT, wParam, lParam)); return TRUE; case VARM_GETEXTRATEXTLENGTH: SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, - SendMessage(GetDlgItem(hwndDlg, IDC_EXTRATEXT), WM_GETTEXTLENGTH, wParam, lParam)); + SendDlgItemMessage(hwndDlg, IDC_EXTRATEXT, WM_GETTEXTLENGTH, wParam, lParam)); return TRUE; case VARM_GETEXTRATEXT: SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, - SendMessage(GetDlgItem(hwndDlg, IDC_EXTRATEXT), WM_GETTEXT, wParam, lParam)); + SendDlgItemMessage(hwndDlg, IDC_EXTRATEXT, WM_GETTEXT, wParam, lParam)); return TRUE; case WM_SIZE: @@ -737,17 +737,17 @@ static INT_PTR CALLBACK inputDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM case VARM_SETINPUTTEXT: SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, - SendMessage(GetDlgItem(hwndDlg, IDC_TESTSTRING), WM_SETTEXT, wParam, lParam)); + SendDlgItemMessage(hwndDlg, IDC_TESTSTRING, WM_SETTEXT, wParam, lParam)); return TRUE; case VARM_GETINPUTTEXTLENGTH: SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, - SendMessage(GetDlgItem(hwndDlg, IDC_TESTSTRING), WM_GETTEXTLENGTH, wParam, lParam)); + SendDlgItemMessage(hwndDlg, IDC_TESTSTRING, WM_GETTEXTLENGTH, wParam, lParam)); return TRUE; case VARM_GETINPUTTEXT: SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, - SendMessage(GetDlgItem(hwndDlg, IDC_TESTSTRING), WM_GETTEXT, wParam, lParam)); + SendDlgItemMessage(hwndDlg, IDC_TESTSTRING, WM_GETTEXT, wParam, lParam)); return TRUE; case WM_TIMER: diff --git a/plugins/Variables/src/parse_system.cpp b/plugins/Variables/src/parse_system.cpp index c6d1fdb765..6c18b39846 100644 --- a/plugins/Variables/src/parse_system.cpp +++ b/plugins/Variables/src/parse_system.cpp @@ -347,7 +347,7 @@ static TCHAR *parseFindWindow(ARGUMENTSINFO *ai) if (hWin == NULL) return NULL; - int len = SendMessage(hWin, WM_GETTEXTLENGTH, 0, 0); + int len = GetWindowTextLength(hWin); if (len == 0) return NULL; diff --git a/plugins/Weather/src/weather_ini.cpp b/plugins/Weather/src/weather_ini.cpp index bf4296c4dc..e11085f272 100644 --- a/plugins/Weather/src/weather_ini.cpp +++ b/plugins/Weather/src/weather_ini.cpp @@ -540,10 +540,10 @@ INT_PTR CALLBACK DlgProcSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar TranslateDialogDefault(hwndDlg); // make the buttons flat - SendMessage(GetDlgItem(hwndDlg,IDC_STEP1), BUTTONSETASFLATBTN, TRUE, 0); - SendMessage(GetDlgItem(hwndDlg,IDC_STEP2), BUTTONSETASFLATBTN, TRUE, 0); - SendMessage(GetDlgItem(hwndDlg,IDC_STEP3), BUTTONSETASFLATBTN, TRUE, 0); - SendMessage(GetDlgItem(hwndDlg,IDC_STEP4), BUTTONSETASFLATBTN, TRUE, 0); + SendDlgItemMessage(hwndDlg,IDC_STEP1, BUTTONSETASFLATBTN, TRUE, 0); + SendDlgItemMessage(hwndDlg,IDC_STEP2, BUTTONSETASFLATBTN, TRUE, 0); + SendDlgItemMessage(hwndDlg,IDC_STEP3, BUTTONSETASFLATBTN, TRUE, 0); + SendDlgItemMessage(hwndDlg,IDC_STEP4, BUTTONSETASFLATBTN, TRUE, 0); // set icons SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)LoadIconEx("main", TRUE)); diff --git a/plugins/Weather/src/weather_opt.cpp b/plugins/Weather/src/weather_opt.cpp index fa2baba340..c43ddbd60b 100644 --- a/plugins/Weather/src/weather_opt.cpp +++ b/plugins/Weather/src/weather_opt.cpp @@ -476,16 +476,16 @@ INT_PTR CALLBACK DlgProcText(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) SetDlgItemText(hdlg, IDC_VARLIST, str); // make the more variable and other buttons flat - SendMessage(GetDlgItem(hdlg, IDC_MORE), BUTTONSETASFLATBTN, TRUE, 0); - SendMessage(GetDlgItem(hdlg, IDC_TM1), BUTTONSETASFLATBTN, TRUE, 0); - SendMessage(GetDlgItem(hdlg, IDC_TM2), BUTTONSETASFLATBTN, TRUE, 0); - SendMessage(GetDlgItem(hdlg, IDC_TM3), BUTTONSETASFLATBTN, TRUE, 0); - SendMessage(GetDlgItem(hdlg, IDC_TM4), BUTTONSETASFLATBTN, TRUE, 0); - SendMessage(GetDlgItem(hdlg, IDC_TM5), BUTTONSETASFLATBTN, TRUE, 0); - SendMessage(GetDlgItem(hdlg, IDC_TM6), BUTTONSETASFLATBTN, TRUE, 0); - SendMessage(GetDlgItem(hdlg, IDC_TM7), BUTTONSETASFLATBTN, TRUE, 0); - SendMessage(GetDlgItem(hdlg, IDC_TM8), BUTTONSETASFLATBTN, TRUE, 0); - SendMessage(GetDlgItem(hdlg, IDC_RESET), BUTTONSETASFLATBTN, TRUE, 0); + SendDlgItemMessage(hdlg, IDC_MORE, BUTTONSETASFLATBTN, TRUE, 0); + SendDlgItemMessage(hdlg, IDC_TM1, BUTTONSETASFLATBTN, TRUE, 0); + SendDlgItemMessage(hdlg, IDC_TM2, BUTTONSETASFLATBTN, TRUE, 0); + SendDlgItemMessage(hdlg, IDC_TM3, BUTTONSETASFLATBTN, TRUE, 0); + SendDlgItemMessage(hdlg, IDC_TM4, BUTTONSETASFLATBTN, TRUE, 0); + SendDlgItemMessage(hdlg, IDC_TM5, BUTTONSETASFLATBTN, TRUE, 0); + SendDlgItemMessage(hdlg, IDC_TM6, BUTTONSETASFLATBTN, TRUE, 0); + SendDlgItemMessage(hdlg, IDC_TM7, BUTTONSETASFLATBTN, TRUE, 0); + SendDlgItemMessage(hdlg, IDC_TM8, BUTTONSETASFLATBTN, TRUE, 0); + SendDlgItemMessage(hdlg, IDC_RESET, BUTTONSETASFLATBTN, TRUE, 0); // load the settings LoadTextSettings(hdlg); opt_startup = FALSE; diff --git a/plugins/Weather/src/weather_popup.cpp b/plugins/Weather/src/weather_popup.cpp index 81fda09026..f74c570f1a 100644 --- a/plugins/Weather/src/weather_popup.cpp +++ b/plugins/Weather/src/weather_popup.cpp @@ -282,19 +282,19 @@ INT_PTR CALLBACK DlgPopupOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) else CheckRadioButton(hdlg, IDC_PD1, IDC_PD3, IDC_PD3); //Colours. First step is configuring the colours. - SendDlgItemMessage(hdlg,IDC_BGCOLOUR,CPM_SETCOLOUR,0,opt.BGColour); - SendDlgItemMessage(hdlg,IDC_TEXTCOLOUR,CPM_SETCOLOUR,0,opt.TextColour); + SendDlgItemMessage(hdlg, IDC_BGCOLOUR, CPM_SETCOLOUR, 0, opt.BGColour); + SendDlgItemMessage(hdlg, IDC_TEXTCOLOUR, CPM_SETCOLOUR, 0, opt.TextColour); //Second step is disabling them if we want to use default Windows ones. - CheckDlgButton(hdlg, IDC_USEWINCOLORS,opt.UseWinColors?BST_CHECKED:BST_UNCHECKED); + CheckDlgButton(hdlg, IDC_USEWINCOLORS, opt.UseWinColors ? BST_CHECKED : BST_UNCHECKED); EnableWindow(GetDlgItem(hdlg, IDC_BGCOLOUR), !opt.UseWinColors); EnableWindow(GetDlgItem(hdlg, IDC_TEXTCOLOUR), !opt.UseWinColors); // buttons - SendMessage(GetDlgItem(hdlg,IDC_PREVIEW), BUTTONSETASFLATBTN, TRUE, 0); - SendMessage(GetDlgItem(hdlg,IDC_PDEF), BUTTONSETASFLATBTN, TRUE, 0); - SendMessage(GetDlgItem(hdlg,IDC_LeftClick), BUTTONSETASFLATBTN, TRUE, 0); - SendMessage(GetDlgItem(hdlg,IDC_RightClick), BUTTONSETASFLATBTN, TRUE, 0); - SendMessage(GetDlgItem(hdlg,IDC_VAR3), BUTTONSETASFLATBTN, TRUE, 0); + SendDlgItemMessage(hdlg, IDC_PREVIEW, BUTTONSETASFLATBTN, TRUE, 0); + SendDlgItemMessage(hdlg, IDC_PDEF, BUTTONSETASFLATBTN, TRUE, 0); + SendDlgItemMessage(hdlg, IDC_LeftClick, BUTTONSETASFLATBTN, TRUE, 0); + SendDlgItemMessage(hdlg, IDC_RightClick, BUTTONSETASFLATBTN, TRUE, 0); + SendDlgItemMessage(hdlg, IDC_VAR3, BUTTONSETASFLATBTN, TRUE, 0); return TRUE; case WM_COMMAND: diff --git a/plugins/Weather/src/weather_userinfo.cpp b/plugins/Weather/src/weather_userinfo.cpp index d1e0404fb1..10479f95e5 100644 --- a/plugins/Weather/src/weather_userinfo.cpp +++ b/plugins/Weather/src/weather_userinfo.cpp @@ -68,7 +68,7 @@ INT_PTR CALLBACK DlgProcUIPage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa switch (msg) { case WM_INITDIALOG: TranslateDialogDefault(hwndDlg); - SendMessage(GetDlgItem(hwndDlg,IDC_MOREDETAIL), BUTTONSETASFLATBTN, TRUE, 0); + SendDlgItemMessage(hwndDlg, IDC_MOREDETAIL, BUTTONSETASFLATBTN, TRUE, 0); // save the contact handle for later use hContact = lParam; SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)hContact); diff --git a/plugins/WebView/src/webview.cpp b/plugins/WebView/src/webview.cpp index 560b577c2d..1e4d2b8cdd 100644 --- a/plugins/WebView/src/webview.cpp +++ b/plugins/WebView/src/webview.cpp @@ -117,7 +117,7 @@ void BGclrLoop() for (MCONTACT hContact = db_find_first(MODULENAME); hContact != NULL; hContact = db_find_next(hContact, MODULENAME)) { HWND hwndDlg = (WindowList_Find(hWindowList, hContact)); SetDlgItemText(hwndDlg, IDC_DATA, _T("")); - SendMessage(GetDlgItem(hwndDlg, IDC_DATA), EM_SETBKGNDCOLOR, 0, BackgoundClr); + SendDlgItemMessage(hwndDlg, IDC_DATA, EM_SETBKGNDCOLOR, 0, BackgoundClr); InvalidateRect(hwndDlg, NULL, 1); } } diff --git a/plugins/WebView/src/webview_datawnd.cpp b/plugins/WebView/src/webview_datawnd.cpp index 5e37235911..256a1bf093 100644 --- a/plugins/WebView/src/webview_datawnd.cpp +++ b/plugins/WebView/src/webview_datawnd.cpp @@ -99,7 +99,7 @@ INT_PTR CALLBACK DlgProcFind(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara } CHARRANGE sel2 = {startsel, endsel}; - SendMessage(GetDlgItem(ParentHwnd, IDC_DATA), EM_EXSETSEL, 0, (LPARAM) & sel2); + SendDlgItemMessage(ParentHwnd, IDC_DATA, EM_EXSETSEL, 0, (LPARAM)&sel2); SetFocus(GetDlgItem(ParentHwnd, IDC_DATA)); } return TRUE; @@ -216,8 +216,8 @@ INT_PTR CALLBACK DlgProcDisplayData(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA InvalidateRect(hwndDlg, NULL, 1); - SendMessage(GetDlgItem(hwndDlg, IDC_DATA), EM_AUTOURLDETECT, 1, 0); - int mask = (int) SendMessage(GetDlgItem(hwndDlg, IDC_DATA), EM_GETEVENTMASK, 0, 0); + SendDlgItemMessage(hwndDlg, IDC_DATA, EM_AUTOURLDETECT, 1, 0); + int mask = (int)SendDlgItemMessage(hwndDlg, IDC_DATA, EM_GETEVENTMASK, 0, 0); SendDlgItemMessage(hwndDlg, IDC_DATA, EM_SETEVENTMASK, 0, mask | ENM_LINK | ENM_MOUSEEVENTS); @@ -368,8 +368,8 @@ INT_PTR CALLBACK DlgProcDisplayData(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA hTopmost = HWND_TOPMOST; ptszToolTip = TranslateT("Disable stick to the front"); } - SendDlgItemMessage(hwndDlg, IDC_STICK_BUTTON, BM_SETIMAGE, IMAGE_ICON, (LPARAM) LoadImage(hInst, MAKEINTRESOURCE(IDI_UNSTICK), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0)); - SendMessage(GetDlgItem(hwndDlg, IDC_STICK_BUTTON), BUTTONADDTOOLTIP, (WPARAM)ptszToolTip, BATF_TCHAR); + SendDlgItemMessage(hwndDlg, IDC_STICK_BUTTON, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadImage(hInst, MAKEINTRESOURCE(IDI_UNSTICK), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0)); + SendDlgItemMessage(hwndDlg, IDC_STICK_BUTTON, BUTTONADDTOOLTIP, (WPARAM)ptszToolTip, BATF_TCHAR); SetWindowPos(hwndDlg, hTopmost, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE); } break; diff --git a/plugins/WebView/src/webview_getdata.cpp b/plugins/WebView/src/webview_getdata.cpp index df85b2d813..3b5fe09db2 100644 --- a/plugins/WebView/src/webview_getdata.cpp +++ b/plugins/WebView/src/webview_getdata.cpp @@ -492,7 +492,7 @@ LBL_Stop: TCHAR *statusText = TranslateT("Processing data stopped by user."); if (eventIndex == 2) { CHARRANGE sel2 = {location, location2}; - SendMessage(GetDlgItem(hwndDlg, IDC_DATA), EM_EXSETSEL, 0, (LPARAM) & sel2); + SendDlgItemMessage(hwndDlg, IDC_DATA, EM_EXSETSEL, 0, (LPARAM)&sel2); SetFocus(GetDlgItem(hwndDlg, IDC_DATA)); DWORD HiBackgoundClr = db_get_dw(NULL, MODULENAME, BG_COLOR_KEY, Def_color_bg); @@ -505,14 +505,14 @@ LBL_Stop: TCHAR *statusText = TranslateT("Processing data stopped by user."); Format.dwEffects = CFE_BOLD; Format.crBackColor = ((~HiBackgoundClr) & 0x00ffffff); Format.crTextColor = ((~HiTextClr) & 0x00ffffff); - SendMessage(GetDlgItem(hwndDlg, IDC_DATA), EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM) & Format); + SendDlgItemMessage(hwndDlg, IDC_DATA, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&Format); } } SetDlgItemTextA(hwndDlg, IDC_STATUSBAR, timestring); sprintf(BytesString, "%s: %d | %s: %lu", (Translate("Bytes in display")), (GetWindowTextLength(GetDlgItem(hwndDlg, IDC_DATA))), (Translate("Bytes downloaded")), downloadsize); - SendMessage(GetDlgItem(hwndDlg, IDC_STATUSBAR), SB_SETTEXT, 1, (LPARAM) BytesString); + SendDlgItemMessage(hwndDlg, IDC_STATUSBAR, SB_SETTEXT, 1, (LPARAM)BytesString); } else SetDlgItemText(hwndDlg, IDC_STATUSBAR, TranslateT("Alert test conditions not met; press the refresh button to view content.")); } diff --git a/plugins/WhenWasIt/src/dlg_handlers.cpp b/plugins/WhenWasIt/src/dlg_handlers.cpp index 7aed4a3a61..718c897944 100644 --- a/plugins/WhenWasIt/src/dlg_handlers.cpp +++ b/plugins/WhenWasIt/src/dlg_handlers.cpp @@ -99,18 +99,18 @@ int AddInfoToComboBoxes(HWND hWnd) int i; for (i = 0; i < cShowAgeMode; i++) - SendMessage(GetDlgItem(hWnd, IDC_AGE_COMBOBOX), CB_ADDSTRING, 0, (LPARAM) TranslateTS(szShowAgeMode[i])); + SendDlgItemMessage(hWnd, IDC_AGE_COMBOBOX, CB_ADDSTRING, 0, (LPARAM) TranslateTS(szShowAgeMode[i])); for (i = 0; i < cSaveModule; i++) - SendMessage(GetDlgItem(hWnd, IDC_DEFAULT_MODULE), CB_ADDSTRING, 0, (LPARAM) TranslateTS(szSaveModule[i])); + SendDlgItemMessage(hWnd, IDC_DEFAULT_MODULE, CB_ADDSTRING, 0, (LPARAM) TranslateTS(szSaveModule[i])); for (i = 0; i < cPopupClick; i++) { - SendMessage(GetDlgItem(hWnd, IDC_LEFT_CLICK), CB_ADDSTRING, 0, (LPARAM) TranslateTS(szPopupClick[i])); - SendMessage(GetDlgItem(hWnd, IDC_RIGHT_CLICK), CB_ADDSTRING, 0, (LPARAM) TranslateTS(szPopupClick[i])); + SendDlgItemMessage(hWnd, IDC_LEFT_CLICK, CB_ADDSTRING, 0, (LPARAM) TranslateTS(szPopupClick[i])); + SendDlgItemMessage(hWnd, IDC_RIGHT_CLICK, CB_ADDSTRING, 0, (LPARAM) TranslateTS(szPopupClick[i])); } for (i = 0; i < cNotifyFor; i++) - SendMessage(GetDlgItem(hWnd, IDC_NOTIFYFOR), CB_ADDSTRING, 0, (LPARAM) TranslateTS(szNotifyFor[i])); + SendDlgItemMessage(hWnd, IDC_NOTIFYFOR, CB_ADDSTRING, 0, (LPARAM) TranslateTS(szNotifyFor[i])); return i; } @@ -177,16 +177,16 @@ INT_PTR CALLBACK DlgProcOptions(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara AddInfoToComboBoxes(hWnd); - SendMessage(GetDlgItem(hWnd, IDC_FOREGROUND), CPM_SETDEFAULTCOLOUR, 0, FOREGROUND_COLOR); - SendMessage(GetDlgItem(hWnd, IDC_BACKGROUND), CPM_SETDEFAULTCOLOUR, 0, BACKGROUND_COLOR); + SendDlgItemMessage(hWnd, IDC_FOREGROUND, CPM_SETDEFAULTCOLOUR, 0, FOREGROUND_COLOR); + SendDlgItemMessage(hWnd, IDC_BACKGROUND, CPM_SETDEFAULTCOLOUR, 0, BACKGROUND_COLOR); - SendMessage(GetDlgItem(hWnd, IDC_FOREGROUND), CPM_SETCOLOUR, 0, commonData.foreground); - SendMessage(GetDlgItem(hWnd, IDC_BACKGROUND), CPM_SETCOLOUR, 0, commonData.background); + SendDlgItemMessage(hWnd, IDC_FOREGROUND, CPM_SETCOLOUR, 0, commonData.foreground); + SendDlgItemMessage(hWnd, IDC_BACKGROUND, CPM_SETCOLOUR, 0, commonData.background); - SendMessage(GetDlgItem(hWnd, IDC_DEFAULT_MODULE), CB_SETCURSEL, commonData.cDefaultModule, 0); - SendMessage(GetDlgItem(hWnd, IDC_LEFT_CLICK), CB_SETCURSEL, commonData.lPopupClick, 0); - SendMessage(GetDlgItem(hWnd, IDC_RIGHT_CLICK), CB_SETCURSEL, commonData.rPopupClick, 0); - SendMessage(GetDlgItem(hWnd, IDC_NOTIFYFOR), CB_SETCURSEL, commonData.notifyFor, 0); + SendDlgItemMessage(hWnd, IDC_DEFAULT_MODULE, CB_SETCURSEL, commonData.cDefaultModule, 0); + SendDlgItemMessage(hWnd, IDC_LEFT_CLICK, CB_SETCURSEL, commonData.lPopupClick, 0); + SendDlgItemMessage(hWnd, IDC_RIGHT_CLICK, CB_SETCURSEL, commonData.rPopupClick, 0); + SendDlgItemMessage(hWnd, IDC_NOTIFYFOR, CB_SETCURSEL, commonData.notifyFor, 0); CreateToolTip(GetDlgItem(hWnd, IDC_POPUP_TIMEOUT), TranslateT("Set popup delay when notifying of upcoming birthdays.\nFormat: default delay [ | delay for birthdays occurring today]"), 400); @@ -207,7 +207,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara CheckDlgButton(hWnd, IDC_OPENINBACKGROUND, (commonData.bOpenInBackground) ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hWnd, IDC_NOBIRTHDAYS_POPUP, (commonData.bNoBirthdaysPopup) ? BST_CHECKED : BST_UNCHECKED); - SendMessage(GetDlgItem(hWnd, IDC_AGE_COMBOBOX), CB_SETCURSEL, commonData.cShowAgeMode, 0); + SendDlgItemMessage(hWnd, IDC_AGE_COMBOBOX, CB_SETCURSEL, commonData.cShowAgeMode, 0); CheckDlgButton(hWnd, IDC_IGNORE_SUBCONTACTS, (commonData.bIgnoreSubcontacts) ? BST_CHECKED : BST_UNCHECKED); @@ -287,20 +287,20 @@ INT_PTR CALLBACK DlgProcOptions(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara case 0: switch (((LPNMHDR)lParam)->code) { case PSN_APPLY: - commonData.foreground = SendMessage(GetDlgItem(hWnd, IDC_FOREGROUND), CPM_GETCOLOUR, 0, 0); - commonData.background = SendMessage(GetDlgItem(hWnd, IDC_BACKGROUND), CPM_GETCOLOUR, 0, 0); + commonData.foreground = SendDlgItemMessage(hWnd, IDC_FOREGROUND, CPM_GETCOLOUR, 0, 0); + commonData.background = SendDlgItemMessage(hWnd, IDC_BACKGROUND, CPM_GETCOLOUR, 0, 0); commonData.popupTimeout = POPUP_TIMEOUT; commonData.popupTimeoutToday = POPUP_TIMEOUT; commonData.bUsePopups = IsDlgButtonChecked(hWnd, IDC_USE_POPUPS); commonData.bUseDialog = IsDlgButtonChecked(hWnd, IDC_USE_DIALOG); commonData.bIgnoreSubcontacts = IsDlgButtonChecked(hWnd, IDC_IGNORE_SUBCONTACTS); commonData.bNoBirthdaysPopup = IsDlgButtonChecked(hWnd, IDC_NOBIRTHDAYS_POPUP); - commonData.cShowAgeMode = SendMessage(GetDlgItem(hWnd, IDC_AGE_COMBOBOX), CB_GETCURSEL, 0, 0); - commonData.cDefaultModule = SendMessage(GetDlgItem(hWnd, IDC_DEFAULT_MODULE), CB_GETCURSEL, 0, 0); - commonData.lPopupClick = SendMessage(GetDlgItem(hWnd, IDC_LEFT_CLICK), CB_GETCURSEL, 0, 0); - commonData.rPopupClick = SendMessage(GetDlgItem(hWnd, IDC_RIGHT_CLICK), CB_GETCURSEL, 0, 0); + commonData.cShowAgeMode = SendDlgItemMessage(hWnd, IDC_AGE_COMBOBOX, CB_GETCURSEL, 0, 0); + commonData.cDefaultModule = SendDlgItemMessage(hWnd, IDC_DEFAULT_MODULE, CB_GETCURSEL, 0, 0); + commonData.lPopupClick = SendDlgItemMessage(hWnd, IDC_LEFT_CLICK, CB_GETCURSEL, 0, 0); + commonData.rPopupClick = SendDlgItemMessage(hWnd, IDC_RIGHT_CLICK, CB_GETCURSEL, 0, 0); commonData.bOncePerDay = IsDlgButtonChecked(hWnd, IDC_ONCE_PER_DAY); - commonData.notifyFor = SendMessage(GetDlgItem(hWnd, IDC_NOTIFYFOR), CB_GETCURSEL, 0, 0); + commonData.notifyFor = SendDlgItemMessage(hWnd, IDC_NOTIFYFOR, CB_GETCURSEL, 0, 0); commonData.bOpenInBackground = IsDlgButtonChecked(hWnd, IDC_OPENINBACKGROUND); { const int maxSize = 1024; @@ -406,9 +406,9 @@ INT_PTR CALLBACK DlgProcAddBirthday(HWND hWnd, UINT msg, WPARAM wParam, LPARAM l SendMessage(hWnd, WM_SETICON, ICON_BIG, (LPARAM)Skin_GetIconByHandle(hAddBirthdayContact, 1)); { for (int i = 0; i < cSaveModule; i++) - SendMessage(GetDlgItem(hWnd, IDC_COMPATIBILITY), CB_ADDSTRING, 0, (LPARAM) TranslateTS(szSaveModule[i])); + SendDlgItemMessage(hWnd, IDC_COMPATIBILITY, CB_ADDSTRING, 0, (LPARAM)TranslateTS(szSaveModule[i])); - SendMessage(GetDlgItem(hWnd, IDC_COMPATIBILITY), CB_SETCURSEL, commonData.cDefaultModule, 0); + SendDlgItemMessage(hWnd, IDC_COMPATIBILITY, CB_SETCURSEL, commonData.cDefaultModule, 0); } break; @@ -491,7 +491,7 @@ INT_PTR CALLBACK DlgProcAddBirthday(HWND hWnd, UINT msg, WPARAM wParam, LPARAM l MCONTACT hContact = (MCONTACT)GetWindowLongPtr(hWnd, GWLP_USERDATA); HWND hDate = GetDlgItem(hWnd, IDC_DATE); if (DateTime_GetSystemtime(hDate, &st) == GDT_VALID) { - int mode = SendMessage(GetDlgItem(hWnd, IDC_COMPATIBILITY), CB_GETCURSEL, 0, 0); //SAVE modes in date_utils.h are synced + int mode = SendDlgItemMessage(hWnd, IDC_COMPATIBILITY, CB_GETCURSEL, 0, 0); //SAVE modes in date_utils.h are synced SaveBirthday(hContact, st.wYear, st.wMonth, st.wDay, mode); } else SaveBirthday(hContact, 0, 0, 0, SAVE_MODE_DELETEALL); diff --git a/plugins/XSoundNotify/src/options.cpp b/plugins/XSoundNotify/src/options.cpp index 8edc81db96..d23769da94 100644 --- a/plugins/XSoundNotify/src/options.cpp +++ b/plugins/XSoundNotify/src/options.cpp @@ -33,7 +33,7 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l ProtoEnumAccounts(&count, &protos); for (int i = 0; i < count; i++) if (IsSuitableProto(protos[i])) - SendMessage(GetDlgItem(hwndDlg, IDC_OPT_COMBO_PROTO), CB_SETITEMDATA, SendMessage(GetDlgItem(hwndDlg, IDC_OPT_COMBO_PROTO), CB_ADDSTRING, 0, (LPARAM)protos[i]->tszAccountName), (LPARAM)protos[i]); + SendDlgItemMessage(hwndDlg, IDC_OPT_COMBO_PROTO, CB_SETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_OPT_COMBO_PROTO, CB_ADDSTRING, 0, (LPARAM)protos[i]->tszAccountName), (LPARAM)protos[i]); return TRUE; case WM_COMMAND: @@ -78,7 +78,7 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l size_t value_max_len = (_tcslen(uid) + _tcslen(nick) + 4); TCHAR *value = (TCHAR *)mir_alloc(sizeof(TCHAR) * value_max_len); mir_sntprintf(value, value_max_len, _T("%s (%s)"), nick, uid); - SendMessage(GetDlgItem(hwndDlg, IDC_OPT_COMBO_USERS), CB_SETITEMDATA, SendMessage(GetDlgItem(hwndDlg, IDC_OPT_COMBO_USERS), CB_ADDSTRING, 0, (LPARAM)value), hContact); + SendDlgItemMessage(hwndDlg, IDC_OPT_COMBO_USERS, CB_SETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_OPT_COMBO_USERS, CB_ADDSTRING, 0, (LPARAM)value), hContact); mir_free(value); db_free(&dbvuid); } diff --git a/plugins/YAMN/src/browser/mailbrowser.cpp b/plugins/YAMN/src/browser/mailbrowser.cpp index b3bbdc880c..cf98b113f0 100644 --- a/plugins/YAMN/src/browser/mailbrowser.cpp +++ b/plugins/YAMN/src/browser/mailbrowser.cpp @@ -1981,7 +1981,7 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg,UINT msg,WPARAM wParam,LPARAM case WM_YAMN_SHOWSELECTED: { int iSelect; - iSelect=SendMessage(GetDlgItem(hDlg,IDC_LISTMAILS),LVM_GETNEXTITEM,-1,MAKELPARAM((UINT)LVNI_FOCUSED,0)); // return item selected + iSelect = SendDlgItemMessage(hDlg, IDC_LISTMAILS, LVM_GETNEXTITEM, -1, MAKELPARAM((UINT)LVNI_FOCUSED, 0)); // return item selected if (iSelect != -1) { diff --git a/plugins/YAMN/src/proto/pop3/pop3opt.cpp b/plugins/YAMN/src/proto/pop3/pop3opt.cpp index 0f580ad863..1ae443d709 100644 --- a/plugins/YAMN/src/proto/pop3/pop3opt.cpp +++ b/plugins/YAMN/src/proto/pop3/pop3opt.cpp @@ -397,11 +397,11 @@ BOOL DlgShowAccount(HWND hDlg,WPARAM wParam,LPARAM lParam) for (i=0;i<=CPLENSUPP;i++) if ((iCP)) { - SendMessage(GetDlgItem(hDlg,IDC_COMBOCP),CB_SETCURSEL,(WPARAM)i,0); + SendDlgItemMessage(hDlg, IDC_COMBOCP, CB_SETCURSEL, (WPARAM)i, 0); break; } if (i==CPLENSUPP) - SendMessage(GetDlgItem(hDlg,IDC_COMBOCP),CB_SETCURSEL,(WPARAM)CPDEFINDEX,0); + SendDlgItemMessage(hDlg, IDC_COMBOCP, CB_SETCURSEL, (WPARAM)CPDEFINDEX, 0); CheckDlgButton(hDlg,IDC_CHECK,ActualAccount->Flags & YAMN_ACC_ENA ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hDlg,IDC_CHECKSND,ActualAccount->NewMailN.Flags & YAMN_ACC_SND ? BST_CHECKED : BST_UNCHECKED); @@ -471,7 +471,7 @@ BOOL DlgShowAccount(HWND hDlg,WPARAM wParam,LPARAM lParam) SetDlgItemInt(hDlg,IDC_EDITPOPS,0,FALSE); SetDlgItemInt(hDlg,IDC_EDITNPOPS,0,FALSE); SetDlgItemInt(hDlg,IDC_EDITFPOPS,0,FALSE); - SendMessage(GetDlgItem(hDlg,IDC_COMBOCP),CB_SETCURSEL,(WPARAM)CPDEFINDEX,0); + SendDlgItemMessage(hDlg, IDC_COMBOCP, CB_SETCURSEL, (WPARAM)CPDEFINDEX, 0); CheckDlgButton(hDlg,IDC_CHECK,BST_CHECKED); CheckDlgButton(hDlg,IDC_CHECKSND,BST_CHECKED); CheckDlgButton(hDlg,IDC_CHECKMSG,BST_UNCHECKED); @@ -689,7 +689,7 @@ INT_PTR CALLBACK DlgProcPOP3AccOpt(HWND hDlg,UINT msg,WPARAM wParam,LPARAM lPara SendDlgItemMessage(hDlg,IDC_COMBOCP,CB_ADDSTRING,0,(LPARAM)(info.CodePageName+7)); } - SendMessage(GetDlgItem(hDlg,IDC_COMBOCP),CB_SETCURSEL,(WPARAM)CPDEFINDEX,0); + SendDlgItemMessage(hDlg, IDC_COMBOCP, CB_SETCURSEL, (WPARAM)CPDEFINDEX, 0); ActualAccount=NULL; TranslateDialogDefault(hDlg); SendMessage(GetParent(hDlg),PSM_UNCHANGED,(WPARAM)hDlg,0); diff --git a/plugins/YARelay/src/options.cpp b/plugins/YARelay/src/options.cpp index 3cc678c36d..e7444393a6 100644 --- a/plugins/YARelay/src/options.cpp +++ b/plugins/YARelay/src/options.cpp @@ -57,53 +57,54 @@ static INT_PTR CALLBACK OptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, TranslateDialogDefault(hwndDlg); // fill FROM and TO comboboxes - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_FROM), CB_RESETCONTENT, 0, 0); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_TO), CB_RESETCONTENT, 0, 0); + SendDlgItemMessage(hwndDlg, IDC_COMBO_FROM, CB_RESETCONTENT, 0, 0); + SendDlgItemMessage(hwndDlg, IDC_COMBO_TO, CB_RESETCONTENT, 0, 0); - idx = SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_FROM), CB_ADDSTRING, 0, (LPARAM) TranslateT("!EVERYONE!")); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_FROM), CB_SETITEMDATA, (WPARAM)idx, 0); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_FROM), CB_SETCURSEL, (WPARAM)idx, 0); + idx = SendDlgItemMessage(hwndDlg, IDC_COMBO_FROM, CB_ADDSTRING, 0, (LPARAM)TranslateT("!EVERYONE!")); + SendDlgItemMessage(hwndDlg, IDC_COMBO_FROM, CB_SETITEMDATA, (WPARAM)idx, 0); + SendDlgItemMessage(hwndDlg, IDC_COMBO_FROM, CB_SETCURSEL, (WPARAM)idx, 0); - idx = SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_TO), CB_ADDSTRING, 0, (LPARAM) TranslateT("!DON'T FORWARD!")); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_TO), CB_SETITEMDATA, (WPARAM)idx, 0); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_TO), CB_SETCURSEL, (WPARAM)idx, 0); + idx = SendDlgItemMessage(hwndDlg, IDC_COMBO_TO, CB_ADDSTRING, 0, (LPARAM)TranslateT("!DON'T FORWARD!")); + SendDlgItemMessage(hwndDlg, IDC_COMBO_TO, CB_SETITEMDATA, (WPARAM)idx, 0); + SendDlgItemMessage(hwndDlg, IDC_COMBO_TO, CB_SETCURSEL, (WPARAM)idx, 0); for (hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { TCHAR *ptszNick = pcli->pfnGetContactDisplayName(hContact, 0); if (ptszNick){ - idx = SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_TO), CB_ADDSTRING, 0, (LPARAM)ptszNick); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_TO), CB_SETITEMDATA, (WPARAM)idx, hContact); + idx = SendDlgItemMessage(hwndDlg, IDC_COMBO_TO, CB_ADDSTRING, 0, (LPARAM)ptszNick); + SendDlgItemMessage(hwndDlg, IDC_COMBO_TO, CB_SETITEMDATA, (WPARAM)idx, hContact); - idx = SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_FROM), CB_ADDSTRING, 0, (LPARAM)ptszNick); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_FROM), CB_SETITEMDATA, (WPARAM)idx, hContact); + idx = SendDlgItemMessage(hwndDlg, IDC_COMBO_FROM, CB_ADDSTRING, 0, (LPARAM)ptszNick); + SendDlgItemMessage(hwndDlg, IDC_COMBO_FROM, CB_SETITEMDATA, (WPARAM)idx, hContact); if (hContact == hForwardTo) - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_TO), CB_SETCURSEL, (WPARAM)idx, 0); + SendDlgItemMessage(hwndDlg, IDC_COMBO_TO, CB_SETCURSEL, (WPARAM)idx, 0); if (hContact == hForwardFrom) - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_FROM), CB_SETCURSEL, (WPARAM)idx, 0); + SendDlgItemMessage(hwndDlg, IDC_COMBO_FROM, CB_SETCURSEL, (WPARAM)idx, 0); } } if (hForwardFrom == 0) - SendMessage(GetDlgItem(hwndDlg, IDC_RADIO_ALL), BM_SETCHECK, BST_CHECKED, 0); + SendDlgItemMessage(hwndDlg, IDC_RADIO_ALL, BM_SETCHECK, BST_CHECKED, 0); else - SendMessage(GetDlgItem(hwndDlg, IDC_RADIO_CUSTOM), BM_SETCHECK, BST_CHECKED, 0); + SendDlgItemMessage(hwndDlg, IDC_RADIO_CUSTOM, BM_SETCHECK, BST_CHECKED, 0); // forward on statuses - if (iForwardOnStatus & STATUS_OFFLINE ) SendMessage(GetDlgItem(hwndDlg, IDC_CHECK1), BM_SETCHECK, BST_CHECKED, 0); - if (iForwardOnStatus & STATUS_ONLINE ) SendMessage(GetDlgItem(hwndDlg, IDC_CHECK2), BM_SETCHECK, BST_CHECKED, 0); - if (iForwardOnStatus & STATUS_AWAY ) SendMessage(GetDlgItem(hwndDlg, IDC_CHECK3), BM_SETCHECK, BST_CHECKED, 0); - if (iForwardOnStatus & STATUS_NA ) SendMessage(GetDlgItem(hwndDlg, IDC_CHECK4), BM_SETCHECK, BST_CHECKED, 0); - if (iForwardOnStatus & STATUS_OCCUPIED ) SendMessage(GetDlgItem(hwndDlg, IDC_CHECK5), BM_SETCHECK, BST_CHECKED, 0); - if (iForwardOnStatus & STATUS_DND ) SendMessage(GetDlgItem(hwndDlg, IDC_CHECK6), BM_SETCHECK, BST_CHECKED, 0); - if (iForwardOnStatus & STATUS_FREECHAT ) SendMessage(GetDlgItem(hwndDlg, IDC_CHECK7), BM_SETCHECK, BST_CHECKED, 0); - if (iForwardOnStatus & STATUS_INVISIBLE) SendMessage(GetDlgItem(hwndDlg, IDC_CHECK8), BM_SETCHECK, BST_CHECKED, 0); + if (iForwardOnStatus & STATUS_OFFLINE ) SendDlgItemMessage(hwndDlg, IDC_CHECK1, BM_SETCHECK, BST_CHECKED, 0); + if (iForwardOnStatus & STATUS_ONLINE ) SendDlgItemMessage(hwndDlg, IDC_CHECK2, BM_SETCHECK, BST_CHECKED, 0); + if (iForwardOnStatus & STATUS_AWAY ) SendDlgItemMessage(hwndDlg, IDC_CHECK3, BM_SETCHECK, BST_CHECKED, 0); + if (iForwardOnStatus & STATUS_NA ) SendDlgItemMessage(hwndDlg, IDC_CHECK4, BM_SETCHECK, BST_CHECKED, 0); + if (iForwardOnStatus & STATUS_OCCUPIED ) SendDlgItemMessage(hwndDlg, IDC_CHECK5, BM_SETCHECK, BST_CHECKED, 0); + if (iForwardOnStatus & STATUS_DND ) SendDlgItemMessage(hwndDlg, IDC_CHECK6, BM_SETCHECK, BST_CHECKED, 0); + if (iForwardOnStatus & STATUS_FREECHAT ) SendDlgItemMessage(hwndDlg, IDC_CHECK7, BM_SETCHECK, BST_CHECKED, 0); + if (iForwardOnStatus & STATUS_INVISIBLE) SendDlgItemMessage(hwndDlg, IDC_CHECK8, BM_SETCHECK, BST_CHECKED, 0); // template SetDlgItemText(hwndDlg, IDC_EDIT_TEMPLATE, tszForwardTemplate); // split - if (iSplit>0) SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_SPLIT), BM_SETCHECK, BST_CHECKED, 0); + if (iSplit > 0) + SendDlgItemMessage(hwndDlg, IDC_CHECK_SPLIT, BM_SETCHECK, BST_CHECKED, 0); // max size SetDlgItemInt(hwndDlg, IDC_EDIT_MAXSIZE, iSplitMaxSize, FALSE); @@ -112,10 +113,12 @@ static INT_PTR CALLBACK OptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, SetDlgItemInt(hwndDlg, IDC_EDIT_SENDPARTS, iSendParts, FALSE); // mark 'read' - if (iMarkRead>0) SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_MARKREAD), BM_SETCHECK, BST_CHECKED, 0); + if (iMarkRead > 0) + SendDlgItemMessage(hwndDlg, IDC_CHECK_MARKREAD, BM_SETCHECK, BST_CHECKED, 0); // send and save - if (iSendAndHistory>0) SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_SAVEHISTORY), BM_SETCHECK, BST_CHECKED, 0); + if (iSendAndHistory > 0) + SendDlgItemMessage(hwndDlg, IDC_CHECK_SAVEHISTORY, BM_SETCHECK, BST_CHECKED, 0); // enable/disable controls OptionsFrameEnableControls(hwndDlg); @@ -141,27 +144,27 @@ static INT_PTR CALLBACK OptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, case PSN_KILLACTIVE: // read all data from options frame - if (SendMessage(GetDlgItem(hwndDlg, IDC_RADIO_ALL), BM_GETCHECK, 0, 0) == BST_CHECKED) + if (SendDlgItemMessage(hwndDlg, IDC_RADIO_ALL, BM_GETCHECK, 0, 0) == BST_CHECKED) hForwardFrom = 0; else - hForwardFrom = (MCONTACT)SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_FROM), CB_GETITEMDATA, SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_FROM), CB_GETCURSEL, 0, 0), 0); + hForwardFrom = (MCONTACT)SendDlgItemMessage(hwndDlg, IDC_COMBO_FROM, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_COMBO_FROM, CB_GETCURSEL, 0, 0), 0); - hForwardTo = (MCONTACT)SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_TO), CB_GETITEMDATA, SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_TO), CB_GETCURSEL, 0, 0), 0); + hForwardTo = (MCONTACT)SendDlgItemMessage(hwndDlg, IDC_COMBO_TO, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_COMBO_TO, CB_GETCURSEL, 0, 0), 0); iForwardOnStatus = 0; - if (SendMessage(GetDlgItem(hwndDlg, IDC_CHECK1), BM_GETCHECK, 0, 0) == BST_CHECKED) iForwardOnStatus |= STATUS_OFFLINE; - if (SendMessage(GetDlgItem(hwndDlg, IDC_CHECK2), BM_GETCHECK, 0, 0) == BST_CHECKED) iForwardOnStatus |= STATUS_ONLINE; - if (SendMessage(GetDlgItem(hwndDlg, IDC_CHECK3), BM_GETCHECK, 0, 0) == BST_CHECKED) iForwardOnStatus |= STATUS_AWAY; - if (SendMessage(GetDlgItem(hwndDlg, IDC_CHECK4), BM_GETCHECK, 0, 0) == BST_CHECKED) iForwardOnStatus |= STATUS_NA; - if (SendMessage(GetDlgItem(hwndDlg, IDC_CHECK5), BM_GETCHECK, 0, 0) == BST_CHECKED) iForwardOnStatus |= STATUS_OCCUPIED; - if (SendMessage(GetDlgItem(hwndDlg, IDC_CHECK6), BM_GETCHECK, 0, 0) == BST_CHECKED) iForwardOnStatus |= STATUS_DND; - if (SendMessage(GetDlgItem(hwndDlg, IDC_CHECK7), BM_GETCHECK, 0, 0) == BST_CHECKED) iForwardOnStatus |= STATUS_FREECHAT; - if (SendMessage(GetDlgItem(hwndDlg, IDC_CHECK8), BM_GETCHECK, 0, 0) == BST_CHECKED) iForwardOnStatus |= STATUS_INVISIBLE; + if (SendDlgItemMessage(hwndDlg, IDC_CHECK1, BM_GETCHECK, 0, 0) == BST_CHECKED) iForwardOnStatus |= STATUS_OFFLINE; + if (SendDlgItemMessage(hwndDlg, IDC_CHECK2, BM_GETCHECK, 0, 0) == BST_CHECKED) iForwardOnStatus |= STATUS_ONLINE; + if (SendDlgItemMessage(hwndDlg, IDC_CHECK3, BM_GETCHECK, 0, 0) == BST_CHECKED) iForwardOnStatus |= STATUS_AWAY; + if (SendDlgItemMessage(hwndDlg, IDC_CHECK4, BM_GETCHECK, 0, 0) == BST_CHECKED) iForwardOnStatus |= STATUS_NA; + if (SendDlgItemMessage(hwndDlg, IDC_CHECK5, BM_GETCHECK, 0, 0) == BST_CHECKED) iForwardOnStatus |= STATUS_OCCUPIED; + if (SendDlgItemMessage(hwndDlg, IDC_CHECK6, BM_GETCHECK, 0, 0) == BST_CHECKED) iForwardOnStatus |= STATUS_DND; + if (SendDlgItemMessage(hwndDlg, IDC_CHECK7, BM_GETCHECK, 0, 0) == BST_CHECKED) iForwardOnStatus |= STATUS_FREECHAT; + if (SendDlgItemMessage(hwndDlg, IDC_CHECK8, BM_GETCHECK, 0, 0) == BST_CHECKED) iForwardOnStatus |= STATUS_INVISIBLE; GetDlgItemText(hwndDlg, IDC_EDIT_TEMPLATE, tszForwardTemplate, SIZEOF(tszForwardTemplate)); - if (SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_SPLIT), BM_GETCHECK, 0, 0) == BST_CHECKED) iSplit = 1; else iSplit = 0; + if (SendDlgItemMessage(hwndDlg, IDC_CHECK_SPLIT, BM_GETCHECK, 0, 0) == BST_CHECKED) iSplit = 1; else iSplit = 0; iSplitMaxSize = GetDlgItemInt(hwndDlg, IDC_EDIT_MAXSIZE, NULL, FALSE); iSendParts = GetDlgItemInt(hwndDlg, IDC_EDIT_SENDPARTS, NULL, FALSE); - if (SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_MARKREAD), BM_GETCHECK, 0, 0) == BST_CHECKED) iMarkRead = 1; else iMarkRead = 0; - if (SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_SAVEHISTORY), BM_GETCHECK, 0, 0) == BST_CHECKED) iSendAndHistory = 1; else iSendAndHistory = 0; + if (SendDlgItemMessage(hwndDlg, IDC_CHECK_MARKREAD, BM_GETCHECK, 0, 0) == BST_CHECKED) iMarkRead = 1; else iMarkRead = 0; + if (SendDlgItemMessage(hwndDlg, IDC_CHECK_SAVEHISTORY, BM_GETCHECK, 0, 0) == BST_CHECKED) iSendAndHistory = 1; else iSendAndHistory = 0; if (iSplitMaxSize <= 0) iSplitMaxSize = 1; diff --git a/plugins/helpers/gen_helpers.cpp b/plugins/helpers/gen_helpers.cpp index d076626c15..11af4a257a 100644 --- a/plugins/helpers/gen_helpers.cpp +++ b/plugins/helpers/gen_helpers.cpp @@ -44,7 +44,7 @@ TCHAR *Hlp_GetDlgItemText(HWND hwndDlg, int nIDDlgItem) { TCHAR *Hlp_GetWindowText(HWND hwndDlg) { - int len = SendMessage(hwndDlg, WM_GETTEXTLENGTH, 0, 0); + int len = GetWindowTextLength(hwndDlg); if (len < 0) return NULL; diff --git a/protocols/FacebookRM/src/dialogs.cpp b/protocols/FacebookRM/src/dialogs.cpp index 81103ed166..e8a64db4fb 100644 --- a/protocols/FacebookRM/src/dialogs.cpp +++ b/protocols/FacebookRM/src/dialogs.cpp @@ -60,8 +60,8 @@ INT_PTR CALLBACK FBAccountProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp if (!proto->isOffline()) { - SendMessage(GetDlgItem(hwnd, IDC_UN), EM_SETREADONLY, 1, 0); - SendMessage(GetDlgItem(hwnd, IDC_PW), EM_SETREADONLY, 1, 0); + SendDlgItemMessage(hwnd, IDC_UN, EM_SETREADONLY, 1, 0); + SendDlgItemMessage(hwnd, IDC_PW, EM_SETREADONLY, 1, 0); } return TRUE; } @@ -356,10 +356,9 @@ INT_PTR CALLBACK FBOptionsProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp if (password!= NULL) SetDlgItemTextA(hwnd, IDC_PW, password); - if (!proto->isOffline()) - { - SendMessage(GetDlgItem(hwnd,IDC_UN),EM_SETREADONLY,TRUE,0); - SendMessage(GetDlgItem(hwnd,IDC_PW),EM_SETREADONLY,TRUE,0); + if (!proto->isOffline()) { + SendDlgItemMessage(hwnd, IDC_UN, EM_SETREADONLY, TRUE, 0); + SendDlgItemMessage(hwnd, IDC_PW, EM_SETREADONLY, TRUE, 0); } LoadDBCheckState(proto, hwnd, IDC_SECURE, FACEBOOK_KEY_FORCE_HTTPS, DEFAULT_FORCE_HTTPS); diff --git a/protocols/GTalkExt/src/options.cpp b/protocols/GTalkExt/src/options.cpp index 9fb1f144d4..f75d6cbe3f 100644 --- a/protocols/GTalkExt/src/options.cpp +++ b/protocols/GTalkExt/src/options.cpp @@ -44,7 +44,7 @@ void CheckControlsEnabled(HWND wnd) EnableWindow(GetDlgItem(wnd, IDC_POPUPSINFULLSCREEN), PopupsEnabled); EnableWindow(GetDlgItem(wnd, IDC_POPUPSINFULLSCREENLABEL), PopupsEnabled); - BOOL CListEnabled = (SendMessage(GetDlgItem(wnd, IDC_PSEUDOCONTACTENABLED), BM_GETSTATE, 0, 0) & BST_CHECKED) == BST_CHECKED; + BOOL CListEnabled = (SendDlgItemMessage(wnd, IDC_PSEUDOCONTACTENABLED, BM_GETSTATE, 0, 0) & BST_CHECKED) == BST_CHECKED; EnableWindow(GetDlgItem(wnd, IDC_CLEARPSEUDOCONTACTLOG), CListEnabled); EnableWindow(GetDlgItem(wnd, IDC_MARKEVENTREAD), PopupsEnabled && CListEnabled); diff --git a/protocols/IRCG/src/services.cpp b/protocols/IRCG/src/services.cpp index 3ec6a34b87..af4c916629 100644 --- a/protocols/IRCG/src/services.cpp +++ b/protocols/IRCG/src/services.cpp @@ -353,7 +353,7 @@ INT_PTR __cdecl CIrcProto::OnJoinMenuCommand(WPARAM, LPARAM) SetDlgItemText(m_joinDlg->GetHwnd(), IDC_CAPTION, TranslateT("Join channel")); SetWindowText(GetDlgItem(m_joinDlg->GetHwnd(), IDC_TEXT), TranslateT("Please enter a channel to join")); - SendMessage(GetDlgItem(m_joinDlg->GetHwnd(), IDC_ENICK), EM_SETSEL, 0, MAKELPARAM(0, -1)); + SendDlgItemMessage(m_joinDlg->GetHwnd(), IDC_ENICK, EM_SETSEL, 0, MAKELPARAM(0, -1)); ShowWindow(m_joinDlg->GetHwnd(), SW_SHOW); SetActiveWindow(m_joinDlg->GetHwnd()); return 0; diff --git a/protocols/IcqOscarJ/src/icq_xstatus.cpp b/protocols/IcqOscarJ/src/icq_xstatus.cpp index b324720994..d56b9ee957 100644 --- a/protocols/IcqOscarJ/src/icq_xstatus.cpp +++ b/protocols/IcqOscarJ/src/icq_xstatus.cpp @@ -660,8 +660,8 @@ static INT_PTR CALLBACK SetXStatusDlgProc(HWND hwndDlg,UINT message,WPARAM wPara dat->hContact = init->hContact; dat->bXStatus = dat->ppro->getContactXStatus(dat->hContact); dat->okButtonFormat = NULL; - SendMessage(GetDlgItem(hwndDlg, IDC_XTITLE), EM_SETREADONLY, 1, 0); - SendMessage(GetDlgItem(hwndDlg, IDC_XMSG), EM_SETREADONLY, 1, 0); + SendDlgItemMessage(hwndDlg, IDC_XTITLE, EM_SETREADONLY, 1, 0); + SendDlgItemMessage(hwndDlg, IDC_XMSG, EM_SETREADONLY, 1, 0); if (dat->ppro->CheckContactCapabilities(dat->hContact, CAPF_XSTATUS) && !dat->ppro->getByte("XStatusAuto", DEFAULT_XSTATUS_AUTO)) { SetDlgItemText(hwndDlg,IDOK,TranslateT("Cancel")); diff --git a/protocols/JabberG/src/jabber_agent.cpp b/protocols/JabberG/src/jabber_agent.cpp index 0fdb48fb5f..b46a0d7249 100644 --- a/protocols/JabberG/src/jabber_agent.cpp +++ b/protocols/JabberG/src/jabber_agent.cpp @@ -56,7 +56,7 @@ public: else SetDlgItemText(m_hwnd, IDC_REG_STATUS, (TCHAR*)lParam); if (wParam >= 0) - SendMessage(GetDlgItem(m_hwnd, IDC_PROGRESS_REG), PBM_SETPOS, wParam, 0); + SendDlgItemMessage(m_hwnd, IDC_PROGRESS_REG, PBM_SETPOS, wParam, 0); if (wParam >= 100) m_ok.SetText(TranslateT("OK")); } diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp index 29cb943a52..77a96ba14a 100644 --- a/protocols/JabberG/src/jabber_chat.cpp +++ b/protocols/JabberG/src/jabber_chat.cpp @@ -726,7 +726,7 @@ public: SetWindowLongPtr(GetDlgItem(m_hwnd, IDC_CLIST), GWL_STYLE, GetWindowLongPtr(GetDlgItem(m_hwnd, IDC_CLIST), GWL_STYLE)|CLS_HIDEOFFLINE|CLS_CHECKBOXES|CLS_HIDEEMPTYGROUPS|CLS_USEGROUPS|CLS_GREYALTERNATE|CLS_GROUPCHECKBOXES); - SendMessage(GetDlgItem(m_hwnd, IDC_CLIST), CLM_SETEXSTYLE, CLS_EX_DISABLEDRAGDROP|CLS_EX_TRACKSELECT, 0); + SendDlgItemMessage(m_hwnd, IDC_CLIST, CLM_SETEXSTYLE, CLS_EX_DISABLEDRAGDROP|CLS_EX_TRACKSELECT, 0); ResetListOptions(&m_clc); FilterList(&m_clc); } diff --git a/protocols/JabberG/src/jabber_opt.cpp b/protocols/JabberG/src/jabber_opt.cpp index 5c64d179c0..ec1062bc46 100644 --- a/protocols/JabberG/src/jabber_opt.cpp +++ b/protocols/JabberG/src/jabber_opt.cpp @@ -255,7 +255,7 @@ protected: else SetDlgItemText(m_hwnd, IDC_REG_STATUS, (TCHAR*)lParam); - SendMessage(GetDlgItem(m_hwnd, IDC_PROGRESS_REG), PBM_SETPOS, wParam, 0); + SendDlgItemMessage(m_hwnd, IDC_PROGRESS_REG, PBM_SETPOS, wParam, 0); if (wParam >= 100) m_btnOk.SetText(TranslateT("Close")); else diff --git a/protocols/JabberG/src/jabber_search.cpp b/protocols/JabberG/src/jabber_search.cpp index 49cde56897..aa6cabcbda 100644 --- a/protocols/JabberG/src/jabber_search.cpp +++ b/protocols/JabberG/src/jabber_search.cpp @@ -431,7 +431,7 @@ static void JabberSearchFreeData(HWND hwndDlg, JabberSearchData * dat) if (dat->xNode) xi.destroyNode(dat->xNode); - SendMessage(GetDlgItem(hwndDlg,IDC_FRAME), WM_SETFONT, (WPARAM)SendMessage(hwndDlg, WM_GETFONT, 0, 0),0); + SendDlgItemMessage(hwndDlg,IDC_FRAME, WM_SETFONT, (WPARAM)SendMessage(hwndDlg, WM_GETFONT, 0, 0),0); dat->nJSInfCount=0; ShowWindow(GetDlgItem(hwndDlg,IDC_VSCROLL),SW_HIDE); SetDlgItemText(hwndDlg,IDC_INSTRUCTIONS,TranslateT("Select/type search service URL above and press ")); @@ -481,7 +481,7 @@ int CJabberProto::SearchRenewFields(HWND hwndDlg, JabberSearchData * dat) static void JabberSearchAddUrlToRecentCombo(HWND hwndDlg, const TCHAR *szAddr) { - int lResult = SendMessage(GetDlgItem(hwndDlg,IDC_SERVER), (UINT) CB_FINDSTRING, 0, (LPARAM)szAddr); + int lResult = SendDlgItemMessage(hwndDlg, IDC_SERVER, (UINT) CB_FINDSTRING, 0, (LPARAM)szAddr); if (lResult == -1) SendDlgItemMessage(hwndDlg, IDC_SERVER, CB_ADDSTRING, 0, (LPARAM)szAddr); } diff --git a/protocols/JabberG/src/jabber_vcard.cpp b/protocols/JabberG/src/jabber_vcard.cpp index 259c4f25dd..590b341425 100644 --- a/protocols/JabberG/src/jabber_vcard.cpp +++ b/protocols/JabberG/src/jabber_vcard.cpp @@ -63,8 +63,8 @@ static INT_PTR CALLBACK PersonalDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L if (lParam) { ppro = (CJabberProto*)lParam; TranslateDialogDefault(hwndDlg); - SendMessage(GetDlgItem(hwndDlg, IDC_GENDER), CB_ADDSTRING, 0, (LPARAM)TranslateT("Male")); - SendMessage(GetDlgItem(hwndDlg, IDC_GENDER), CB_ADDSTRING, 0, (LPARAM)TranslateT("Female")); + SendDlgItemMessage(hwndDlg, IDC_GENDER, CB_ADDSTRING, 0, (LPARAM)TranslateT("Male")); + SendDlgItemMessage(hwndDlg, IDC_GENDER, CB_ADDSTRING, 0, (LPARAM)TranslateT("Female")); SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam); SendMessage(hwndDlg, WM_JABBER_REFRESH_VCARD, 0, 0); ppro->WindowSubscribe(hwndDlg); @@ -127,7 +127,7 @@ static INT_PTR CALLBACK HomeDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA for (int i=0; i < g_cbCountries; i++) { if (g_countries[i].id != 0xFFFF && g_countries[i].id != 0) { TCHAR *country = mir_a2t(g_countries[i].szName); - SendMessage(GetDlgItem(hwndDlg, IDC_COUNTRY), CB_ADDSTRING, 0, (LPARAM)TranslateTS(country)); + SendDlgItemMessage(hwndDlg, IDC_COUNTRY, CB_ADDSTRING, 0, (LPARAM)TranslateTS(country)); mir_free(country); } } @@ -190,7 +190,7 @@ static INT_PTR CALLBACK WorkDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA for (int i=0; i < g_cbCountries; i++) { if (g_countries[i].id != 0xFFFF && g_countries[i].id != 0) { TCHAR *country = mir_a2t(g_countries[i].szName); - SendMessage(GetDlgItem(hwndDlg, IDC_COUNTRY), CB_ADDSTRING, 0, (LPARAM)TranslateTS(country)); + SendDlgItemMessage(hwndDlg, IDC_COUNTRY, CB_ADDSTRING, 0, (LPARAM)TranslateTS(country)); mir_free(country); } } @@ -932,7 +932,7 @@ void CJabberProto::SaveVcardToDB(HWND hwndPage, int iPage) setTString("LastName", text); GetDlgItemText(hwndPage, IDC_BIRTH, text, SIZEOF(text)); setTString("BirthDate", text); - switch(SendMessage(GetDlgItem(hwndPage, IDC_GENDER), CB_GETCURSEL, 0, 0)) { + switch (SendDlgItemMessage(hwndPage, IDC_GENDER, CB_GETCURSEL, 0, 0)) { case 0: setString("GenderString", "Male"); break; case 1: setString("GenderString", "Female"); break; default: setString("GenderString", ""); break; @@ -956,7 +956,7 @@ void CJabberProto::SaveVcardToDB(HWND hwndPage, int iPage) GetDlgItemText(hwndPage, IDC_ZIP, text, SIZEOF(text)); setTString("ZIP", text); { - int i = SendMessage(GetDlgItem(hwndPage, IDC_COUNTRY), CB_GETCURSEL, 0, 0); + int i = SendDlgItemMessage(hwndPage, IDC_COUNTRY, CB_GETCURSEL, 0, 0); TCHAR *country = mir_a2t((i) ? g_countries[i+2].szName : g_countries[1].szName); setTString("Country", country); mir_free(country); @@ -982,7 +982,7 @@ void CJabberProto::SaveVcardToDB(HWND hwndPage, int iPage) GetDlgItemText(hwndPage, IDC_ZIP, text, SIZEOF(text)); setTString("CompanyZIP", text); { - int i = SendMessage(GetDlgItem(hwndPage, IDC_COUNTRY), CB_GETCURSEL, 0, 0); + int i = SendDlgItemMessage(hwndPage, IDC_COUNTRY, CB_GETCURSEL, 0, 0); TCHAR *country = mir_a2t((i) ? g_countries[i+2].szName : g_countries[1].szName); setTString("CompanyCountry", country); mir_free(country); diff --git a/protocols/MRA/src/MraAdvancedSearch.cpp b/protocols/MRA/src/MraAdvancedSearch.cpp index aa3aa43b99..d3a41ba564 100644 --- a/protocols/MRA/src/MraAdvancedSearch.cpp +++ b/protocols/MRA/src/MraAdvancedSearch.cpp @@ -182,9 +182,9 @@ INT_PTR CALLBACK AdvancedSearchDlgProc(HWND hWndDlg, UINT message, WPARAM wParam DWORD dwAgeTo = GET_CURRENT_COMBO_DATA(hWndDlg, IDC_AGERANGE_TO); if (dwAgeFrom == 0) dwAgeFrom++; InitComboBoxNumders(GetDlgItem(hWndDlg, IDC_AGERANGE_TO), dwAgeFrom, 100); - SendMessage(GetDlgItem(hWndDlg, IDC_AGERANGE_TO), CB_SETCURSEL, ((dwAgeTo - dwAgeFrom) + 1), 0); + SendDlgItemMessage(hWndDlg, IDC_AGERANGE_TO, CB_SETCURSEL, ((dwAgeTo - dwAgeFrom) + 1), 0); } - SendMessage(GetDlgItem(hWndDlg, IDC_BIRTHDAY_YEAR), CB_SETCURSEL, 0, 0); + SendDlgItemMessage(hWndDlg, IDC_BIRTHDAY_YEAR, CB_SETCURSEL, 0, 0); } break; @@ -199,9 +199,9 @@ INT_PTR CALLBACK AdvancedSearchDlgProc(HWND hWndDlg, UINT message, WPARAM wParam stTime.wDay = (WORD)GET_CURRENT_COMBO_DATA(hWndDlg, IDC_BIRTHDAY_DAY); DWORD dwAge = GetYears(&stTime); - SendMessage(GetDlgItem(hWndDlg, IDC_AGERANGE_FROM), CB_SETCURSEL, dwAge, 0); - SendMessage(GetDlgItem(hWndDlg, IDC_AGERANGE_TO), CB_SETCURSEL, dwAge, 0); - SendMessage(GetDlgItem(hWndDlg, IDC_ZODIAK), CB_SETCURSEL, 0, 0); + SendDlgItemMessage(hWndDlg, IDC_AGERANGE_FROM, CB_SETCURSEL, dwAge, 0); + SendDlgItemMessage(hWndDlg, IDC_AGERANGE_TO, CB_SETCURSEL, dwAge, 0); + SendDlgItemMessage(hWndDlg, IDC_ZODIAK, CB_SETCURSEL, 0, 0); } break; diff --git a/protocols/MRA/src/MraSelectEMail.cpp b/protocols/MRA/src/MraSelectEMail.cpp index 645ee14475..0696b6e619 100644 --- a/protocols/MRA/src/MraSelectEMail.cpp +++ b/protocols/MRA/src/MraSelectEMail.cpp @@ -95,7 +95,7 @@ INT_PTR CALLBACK MraSelectEMailDlgProc(HWND hWndDlg, UINT message, WPARAM wParam CMStringA szEmail; WCHAR wszBuff[MAX_PATH]; - SendMessage(GetDlgItem(hWndDlg, IDC_LIST_EMAILS), LB_GETTEXT, SendMessage(GetDlgItem(hWndDlg, IDC_LIST_EMAILS), LB_GETCURSEL, 0, 0), (LPARAM)wszBuff); + SendDlgItemMessage(hWndDlg, IDC_LIST_EMAILS, LB_GETTEXT, SendDlgItemMessage(hWndDlg, IDC_LIST_EMAILS, LB_GETCURSEL, 0, 0), (LPARAM)wszBuff); szEmail = wszBuff; szEmail.MakeLower(); diff --git a/protocols/MSN/src/msn_menu.cpp b/protocols/MSN/src/msn_menu.cpp index 948a5b03e5..6af7d01a5e 100644 --- a/protocols/MSN/src/msn_menu.cpp +++ b/protocols/MSN/src/msn_menu.cpp @@ -206,7 +206,7 @@ static INT_PTR CALLBACK DlgProcSetNickname(HWND hwndDlg, UINT msg, WPARAM wParam SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)LoadIconEx("main", true)); SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)LoadIconEx("main")); - SendMessage(GetDlgItem(hwndDlg, IDC_NICKNAME), EM_LIMITTEXT, 129, 0); + SendDlgItemMessage(hwndDlg, IDC_NICKNAME, EM_LIMITTEXT, 129, 0); DBVARIANT dbv; if (!proto->getTString("Nick", &dbv)) { diff --git a/protocols/Sametime/src/session_announce_win.cpp b/protocols/Sametime/src/session_announce_win.cpp index fbc163677b..77c82c58ad 100644 --- a/protocols/Sametime/src/session_announce_win.cpp +++ b/protocols/Sametime/src/session_announce_win.cpp @@ -18,7 +18,7 @@ INT_PTR CALLBACK SessionAnnounceDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wPara proto = arg->proto; proto->debugLog(_T("SessionAnnounceDialogProc WM_INITDIALOG")); - SendMessage(GetDlgItem(hwndDlg, IDC_LST_ANTO), LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_FULLROWSELECT | LVS_EX_CHECKBOXES); + SendDlgItemMessage(hwndDlg, IDC_LST_ANTO, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_FULLROWSELECT | LVS_EX_CHECKBOXES); { LVCOLUMN lvc; // Initialize the LVCOLUMN structure. diff --git a/protocols/SkypeClassic/src/skypeopt.cpp b/protocols/SkypeClassic/src/skypeopt.cpp index 69dc438c2a..48c54273dd 100644 --- a/protocols/SkypeClassic/src/skypeopt.cpp +++ b/protocols/SkypeClassic/src/skypeopt.cpp @@ -399,8 +399,8 @@ INT_PTR CALLBACK OptionsProxyDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPA GetDlgItemTextA(hwndDlg, IDC_HOST, buf, SIZEOF(buf)); db_set_s(NULL, SKYPE_PROTONAME, "Host", buf); db_set_w(NULL, SKYPE_PROTONAME, "Port", (unsigned short)GetDlgItemInt(hwndDlg, IDC_PORT, NULL, FALSE)); - db_set_b(NULL, SKYPE_PROTONAME, "RequiresPassword", (BYTE)(SendMessage(GetDlgItem(hwndDlg, IDC_REQPASS), BM_GETCHECK,0,0))); - db_set_b (NULL, SKYPE_PROTONAME, "UseSkype2Socket", (BYTE)(SendMessage(GetDlgItem(hwndDlg, IDC_USES2S), BM_GETCHECK,0,0))); + db_set_b(NULL, SKYPE_PROTONAME, "RequiresPassword", (BYTE)(SendDlgItemMessage(hwndDlg, IDC_REQPASS, BM_GETCHECK, 0, 0))); + db_set_b (NULL, SKYPE_PROTONAME, "UseSkype2Socket", (BYTE)(SendDlgItemMessage(hwndDlg, IDC_USES2S, BM_GETCHECK, 0, 0))); memset(buf, 0, sizeof(buf)); GetDlgItemTextA(hwndDlg, IDC_PASSWORD, buf, SIZEOF(buf)); db_set_s(NULL, SKYPE_PROTONAME, "Password", buf); @@ -413,12 +413,12 @@ INT_PTR CALLBACK OptionsProxyDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPA switch (LOWORD(wParam)) { case IDC_USES2S: for (i=0; i < SIZEOF(Skype2SocketControls); i++) - EnableWindow(GetDlgItem(hwndDlg, Skype2SocketControls[i]), SendMessage(GetDlgItem(hwndDlg, LOWORD(wParam)), BM_GETCHECK,0,0)); - if (SendMessage(GetDlgItem(hwndDlg, LOWORD(wParam)), BM_GETCHECK,0,0)) + EnableWindow(GetDlgItem(hwndDlg, Skype2SocketControls[i]), SendDlgItemMessage(hwndDlg, LOWORD(wParam), BM_GETCHECK, 0, 0)); + if (SendDlgItemMessage(hwndDlg, LOWORD(wParam), BM_GETCHECK, 0, 0)) SendMessage(hwndDlg, WM_COMMAND, IDC_REQPASS, 0); break; case IDC_REQPASS: - EnableWindow(GetDlgItem(hwndDlg, IDC_PASSWORD), SendMessage(GetDlgItem(hwndDlg, LOWORD(wParam)), BM_GETCHECK,0,0)); + EnableWindow(GetDlgItem(hwndDlg, IDC_PASSWORD), SendDlgItemMessage(hwndDlg, LOWORD(wParam), BM_GETCHECK, 0, 0)); break; } @@ -480,19 +480,19 @@ INT_PTR CALLBACK OptionsAdvancedDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, switch (nmhdr->code){ case PSN_APPLY: case PSN_KILLACTIVE: - db_set_b (NULL, SKYPE_PROTONAME, "EnableMenu", (BYTE)(SendMessage(GetDlgItem(hwndDlg, IDC_ENABLEMENU), BM_GETCHECK,0,0))); - db_set_b (NULL, SKYPE_PROTONAME, "UsePopup", (BYTE)(SendMessage(GetDlgItem(hwndDlg, IDC_USEPOPUP), BM_GETCHECK,0,0))); - db_set_b (NULL, SKYPE_PROTONAME, "UseGroupchat", (BYTE)(SendMessage(GetDlgItem(hwndDlg, IDC_GROUPCHAT), BM_GETCHECK,0,0))); - db_set_b (NULL, SKYPE_PROTONAME, "MarkGroupchatRead", (BYTE)(SendMessage(GetDlgItem(hwndDlg, IDC_GROUPCHATREAD), BM_GETCHECK,0,0))); - db_set_b (NULL, SKYPE_PROTONAME, "SuppressErrors", (BYTE)(SendMessage(GetDlgItem(hwndDlg, IDC_NOERRORS), BM_GETCHECK,0,0))); - db_set_b (NULL, SKYPE_PROTONAME, "KeepState", (BYTE)(SendMessage(GetDlgItem(hwndDlg, IDC_KEEPSTATE), BM_GETCHECK,0,0))); - db_set_dw(NULL, SKYPE_PROTONAME, "SkypeOutStatusMode", SendDlgItemMessage(hwndDlg,IDC_SKYPEOUTSTAT,CB_GETITEMDATA,SendDlgItemMessage(hwndDlg,IDC_SKYPEOUTSTAT,CB_GETCURSEL,0,0),0)); - db_set_b (NULL, SKYPE_PROTONAME, "UseTimeZonePatch", (BYTE)(SendMessage(GetDlgItem(hwndDlg, IDC_TIMEZONE), BM_GETCHECK,0,0))); - db_set_b (NULL, SKYPE_PROTONAME, "IgnoreTimeZones", (BYTE)(SendMessage(GetDlgItem(hwndDlg, IDC_IGNTZ), BM_GETCHECK,0,0))); - db_set_b (NULL, SKYPE_PROTONAME, "ShowDefaultSkypeAvatar", (BYTE)(SendMessage(GetDlgItem(hwndDlg, IDC_SHOWDEFAULTAVATAR), BM_GETCHECK,0,0))); - db_set_b (NULL, SKYPE_PROTONAME, "SuppressCallSummaryMessage", (BYTE)(SendMessage(GetDlgItem(hwndDlg, IDC_SUPPRESSCALLSUMMARYMESSAGE), BM_GETCHECK,0,0))); - db_set_b (NULL, SKYPE_PROTONAME, "NoSkype3Stats", (BYTE)(SendMessage(GetDlgItem(hwndDlg, IDC_NOSKYPE3STATS), BM_GETCHECK,0,0))); - db_set_b (NULL, SKYPE_PROTONAME, "ShowFullname", (BYTE)(SendMessage(GetDlgItem(hwndDlg, IDC_SHOWFULLNAME), BM_GETCHECK,0,0))); + db_set_b (NULL, SKYPE_PROTONAME, "EnableMenu", (BYTE)(SendDlgItemMessage(hwndDlg, IDC_ENABLEMENU, BM_GETCHECK, 0, 0))); + db_set_b (NULL, SKYPE_PROTONAME, "UsePopup", (BYTE)(SendDlgItemMessage(hwndDlg, IDC_USEPOPUP, BM_GETCHECK, 0, 0))); + db_set_b (NULL, SKYPE_PROTONAME, "UseGroupchat", (BYTE)(SendDlgItemMessage(hwndDlg, IDC_GROUPCHAT, BM_GETCHECK, 0, 0))); + db_set_b (NULL, SKYPE_PROTONAME, "MarkGroupchatRead", (BYTE)(SendDlgItemMessage(hwndDlg, IDC_GROUPCHATREAD, BM_GETCHECK, 0, 0))); + db_set_b (NULL, SKYPE_PROTONAME, "SuppressErrors", (BYTE)(SendDlgItemMessage(hwndDlg, IDC_NOERRORS, BM_GETCHECK, 0, 0))); + db_set_b (NULL, SKYPE_PROTONAME, "KeepState", (BYTE)(SendDlgItemMessage(hwndDlg, IDC_KEEPSTATE, BM_GETCHECK, 0, 0))); + db_set_dw(NULL, SKYPE_PROTONAME, "SkypeOutStatusMode", SendDlgItemMessage(hwndDlg, IDC_SKYPEOUTSTAT, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_SKYPEOUTSTAT, CB_GETCURSEL, 0, 0), 0)); + db_set_b (NULL, SKYPE_PROTONAME, "UseTimeZonePatch", (BYTE)(SendDlgItemMessage(hwndDlg, IDC_TIMEZONE, BM_GETCHECK, 0, 0))); + db_set_b (NULL, SKYPE_PROTONAME, "IgnoreTimeZones", (BYTE)(SendDlgItemMessage(hwndDlg, IDC_IGNTZ, BM_GETCHECK, 0, 0))); + db_set_b (NULL, SKYPE_PROTONAME, "ShowDefaultSkypeAvatar", (BYTE)(SendDlgItemMessage(hwndDlg, IDC_SHOWDEFAULTAVATAR, BM_GETCHECK, 0, 0))); + db_set_b (NULL, SKYPE_PROTONAME, "SuppressCallSummaryMessage", (BYTE)(SendDlgItemMessage(hwndDlg, IDC_SUPPRESSCALLSUMMARYMESSAGE, BM_GETCHECK, 0, 0))); + db_set_b (NULL, SKYPE_PROTONAME, "NoSkype3Stats", (BYTE)(SendDlgItemMessage(hwndDlg, IDC_NOSKYPE3STATS, BM_GETCHECK, 0, 0))); + db_set_b (NULL, SKYPE_PROTONAME, "ShowFullname", (BYTE)(SendDlgItemMessage(hwndDlg, IDC_SHOWFULLNAME, BM_GETCHECK, 0, 0))); return TRUE; } break; @@ -573,11 +573,11 @@ INT_PTR CALLBACK OptionsDefaultDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L for(i=0; i < sizeof(skypeLaunchControls)/sizeof(skypeLaunchControls[0]); i++) EnableWindow(GetDlgItem(hwndDlg, skypeLaunchControls[i]), startSkype); - EnableWindow(GetDlgItem(hwndDlg, IDC_BROWSECMDL), startSkype && SendMessage(GetDlgItem(hwndDlg, IDC_CUSTOMCOMMAND), BM_GETCHECK,0,0)); - EnableWindow(GetDlgItem(hwndDlg, IDC_COMMANDLINE), startSkype && SendMessage(GetDlgItem(hwndDlg, IDC_CUSTOMCOMMAND), BM_GETCHECK,0,0)); + EnableWindow(GetDlgItem(hwndDlg, IDC_BROWSECMDL), startSkype && SendDlgItemMessage(hwndDlg, IDC_CUSTOMCOMMAND, BM_GETCHECK, 0, 0)); + EnableWindow(GetDlgItem(hwndDlg, IDC_COMMANDLINE), startSkype && SendDlgItemMessage(hwndDlg, IDC_CUSTOMCOMMAND, BM_GETCHECK, 0, 0)); - EnableWindow(GetDlgItem(hwndDlg, IDC_BROWSEDP), startSkype && SendMessage(GetDlgItem(hwndDlg, IDC_DATAPATHO), BM_GETCHECK,0,0)); - EnableWindow(GetDlgItem(hwndDlg, IDC_DATAPATH), startSkype && SendMessage(GetDlgItem(hwndDlg, IDC_DATAPATHO), BM_GETCHECK,0,0)); + EnableWindow(GetDlgItem(hwndDlg, IDC_BROWSEDP), startSkype && SendDlgItemMessage(hwndDlg, IDC_DATAPATHO, BM_GETCHECK, 0, 0)); + EnableWindow(GetDlgItem(hwndDlg, IDC_DATAPATH), startSkype && SendDlgItemMessage(hwndDlg, IDC_DATAPATHO, BM_GETCHECK, 0, 0)); // LoginUserName if(!db_get_ts(NULL,SKYPE_PROTONAME,"LoginUserName",&dbv)) @@ -607,20 +607,20 @@ INT_PTR CALLBACK OptionsDefaultDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L case PSN_KILLACTIVE: { char text[500]; - TCHAR wtext[500]; + TCHAR wtext[500]; char szRelativePath[MAX_PATH]; - db_set_b (NULL, SKYPE_PROTONAME, "StartSkype", (BYTE)(SendMessage(GetDlgItem(hwndDlg, IDC_STARTSKYPE), BM_GETCHECK,0,0))); - db_set_b (NULL, SKYPE_PROTONAME, "nosplash", (BYTE)(SendMessage(GetDlgItem(hwndDlg, IDC_NOSPLASH), BM_GETCHECK,0,0))); - db_set_b (NULL, SKYPE_PROTONAME, "minimized", (BYTE)(SendMessage(GetDlgItem(hwndDlg, IDC_MINIMIZED), BM_GETCHECK,0,0))); - db_set_b (NULL, SKYPE_PROTONAME, "notray", (BYTE)(SendMessage(GetDlgItem(hwndDlg, IDC_NOTRAY), BM_GETCHECK,0,0))); - db_set_b (NULL, SKYPE_PROTONAME, "Shutdown", (BYTE)(SendMessage(GetDlgItem(hwndDlg, IDC_SHUTDOWN), BM_GETCHECK,0,0))); - db_set_b (NULL, SKYPE_PROTONAME, "UnloadOnOffline", (BYTE)(SendMessage(GetDlgItem(hwndDlg, IDC_UNLOADOFFLINE), BM_GETCHECK,0,0))); + db_set_b (NULL, SKYPE_PROTONAME, "StartSkype", (BYTE)(SendDlgItemMessage(hwndDlg, IDC_STARTSKYPE, BM_GETCHECK,0,0))); + db_set_b (NULL, SKYPE_PROTONAME, "nosplash", (BYTE)(SendDlgItemMessage(hwndDlg, IDC_NOSPLASH, BM_GETCHECK,0,0))); + db_set_b (NULL, SKYPE_PROTONAME, "minimized", (BYTE)(SendDlgItemMessage(hwndDlg, IDC_MINIMIZED, BM_GETCHECK,0,0))); + db_set_b (NULL, SKYPE_PROTONAME, "notray", (BYTE)(SendDlgItemMessage(hwndDlg, IDC_NOTRAY, BM_GETCHECK,0,0))); + db_set_b (NULL, SKYPE_PROTONAME, "Shutdown", (BYTE)(SendDlgItemMessage(hwndDlg, IDC_SHUTDOWN, BM_GETCHECK,0,0))); + db_set_b (NULL, SKYPE_PROTONAME, "UnloadOnOffline", (BYTE)(SendDlgItemMessage(hwndDlg, IDC_UNLOADOFFLINE, BM_GETCHECK,0,0))); db_set_w (NULL, SKYPE_PROTONAME, "ConnectionAttempts", (unsigned short)GetDlgItemInt(hwndDlg, IDC_CONNATTEMPTS, NULL, FALSE)); - db_set_b (NULL, SKYPE_PROTONAME, "UseCustomCommand", (BYTE)(SendMessage(GetDlgItem(hwndDlg, IDC_CUSTOMCOMMAND), BM_GETCHECK,0,0))); - db_set_b (NULL, SKYPE_PROTONAME, "datapath:", (BYTE)(SendMessage(GetDlgItem(hwndDlg, IDC_DATAPATHO), BM_GETCHECK,0,0))); - db_set_b (NULL, SKYPE_PROTONAME, "removable", (BYTE)(SendMessage(GetDlgItem(hwndDlg, IDC_REMOVEABLE), BM_GETCHECK,0,0))); - db_set_b (NULL, SKYPE_PROTONAME, "secondary", (BYTE)(SendMessage(GetDlgItem(hwndDlg, IDC_SECONDARY), BM_GETCHECK,0,0))); + db_set_b (NULL, SKYPE_PROTONAME, "UseCustomCommand", (BYTE)(SendDlgItemMessage(hwndDlg, IDC_CUSTOMCOMMAND, BM_GETCHECK,0,0))); + db_set_b (NULL, SKYPE_PROTONAME, "datapath:", (BYTE)(SendDlgItemMessage(hwndDlg, IDC_DATAPATHO, BM_GETCHECK,0,0))); + db_set_b (NULL, SKYPE_PROTONAME, "removable", (BYTE)(SendDlgItemMessage(hwndDlg, IDC_REMOVEABLE, BM_GETCHECK,0,0))); + db_set_b (NULL, SKYPE_PROTONAME, "secondary", (BYTE)(SendDlgItemMessage(hwndDlg, IDC_SECONDARY, BM_GETCHECK,0,0))); GetDlgItemTextA(hwndDlg,IDC_COMMANDLINE,text,SIZEOF(text)); strncpy(szRelativePath, text, sizeof(szRelativePath)-1); @@ -650,27 +650,27 @@ INT_PTR CALLBACK OptionsDefaultDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L BOOL startSkype; int i; case IDC_STARTSKYPE: - startSkype=SendMessage(GetDlgItem(hwndDlg, IDC_STARTSKYPE), BM_GETCHECK,0,0); + startSkype = SendDlgItemMessage(hwndDlg, IDC_STARTSKYPE, BM_GETCHECK,0,0); - for(i=0; i < sizeof(skypeLaunchControls)/sizeof(skypeLaunchControls[0]); i++) + for (i = 0; i < SIZEOF(skypeLaunchControls); i ++) EnableWindow(GetDlgItem(hwndDlg, skypeLaunchControls[i]), startSkype); - EnableWindow(GetDlgItem(hwndDlg, IDC_BROWSECMDL), startSkype && SendMessage(GetDlgItem(hwndDlg, IDC_CUSTOMCOMMAND), BM_GETCHECK,0,0)); - EnableWindow(GetDlgItem(hwndDlg, IDC_COMMANDLINE), startSkype && SendMessage(GetDlgItem(hwndDlg, IDC_CUSTOMCOMMAND), BM_GETCHECK,0,0)); + EnableWindow(GetDlgItem(hwndDlg, IDC_BROWSECMDL), startSkype && SendDlgItemMessage(hwndDlg, IDC_CUSTOMCOMMAND, BM_GETCHECK,0,0)); + EnableWindow(GetDlgItem(hwndDlg, IDC_COMMANDLINE), startSkype && SendDlgItemMessage(hwndDlg, IDC_CUSTOMCOMMAND, BM_GETCHECK,0,0)); - EnableWindow(GetDlgItem(hwndDlg, IDC_BROWSEDP), startSkype && SendMessage(GetDlgItem(hwndDlg, IDC_DATAPATHO), BM_GETCHECK,0,0)); - EnableWindow(GetDlgItem(hwndDlg, IDC_DATAPATH), startSkype && SendMessage(GetDlgItem(hwndDlg, IDC_DATAPATHO), BM_GETCHECK,0,0)); + EnableWindow(GetDlgItem(hwndDlg, IDC_BROWSEDP), startSkype && SendDlgItemMessage(hwndDlg, IDC_DATAPATHO, BM_GETCHECK,0,0)); + EnableWindow(GetDlgItem(hwndDlg, IDC_DATAPATH), startSkype && SendDlgItemMessage(hwndDlg, IDC_DATAPATHO, BM_GETCHECK,0,0)); break; case IDC_CLEANUP: pthread_create(( pThreadFunc )CleanupNicknames, NULL); break; case IDC_DATAPATHO: - EnableWindow(GetDlgItem(hwndDlg, IDC_DATAPATH), SendMessage(GetDlgItem(hwndDlg, IDC_DATAPATHO), BM_GETCHECK,0,0)); - EnableWindow(GetDlgItem(hwndDlg, IDC_BROWSEDP), SendMessage(GetDlgItem(hwndDlg, IDC_DATAPATHO), BM_GETCHECK,0,0)); + EnableWindow(GetDlgItem(hwndDlg, IDC_DATAPATH), SendDlgItemMessage(hwndDlg, IDC_DATAPATHO, BM_GETCHECK,0,0)); + EnableWindow(GetDlgItem(hwndDlg, IDC_BROWSEDP), SendDlgItemMessage(hwndDlg, IDC_DATAPATHO, BM_GETCHECK,0,0)); break; case IDC_CUSTOMCOMMAND: - EnableWindow(GetDlgItem(hwndDlg, IDC_COMMANDLINE), SendMessage(GetDlgItem(hwndDlg, IDC_CUSTOMCOMMAND), BM_GETCHECK,0,0)); - EnableWindow(GetDlgItem(hwndDlg, IDC_BROWSECMDL), SendMessage(GetDlgItem(hwndDlg, IDC_CUSTOMCOMMAND), BM_GETCHECK,0,0)); + EnableWindow(GetDlgItem(hwndDlg, IDC_COMMANDLINE), SendDlgItemMessage(hwndDlg, IDC_CUSTOMCOMMAND, BM_GETCHECK,0,0)); + EnableWindow(GetDlgItem(hwndDlg, IDC_BROWSECMDL), SendDlgItemMessage(hwndDlg, IDC_CUSTOMCOMMAND, BM_GETCHECK,0,0)); break; case IDC_BROWSECMDL: { @@ -886,7 +886,7 @@ INT_PTR CALLBACK DetailsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM) GetDlgItemTextA(hwndDlg,IDC_OFFICEPHONE,myProfile.OfficePhone,SIZEOF(myProfile.OfficePhone)); GetDlgItemText(hwndDlg,IDC_CITY,myProfile.City,SIZEOF(myProfile.City)); GetDlgItemText(hwndDlg,IDC_PROVINCE,myProfile.Province,SIZEOF(myProfile.Province)); - sex = SendMessage(GetDlgItem(hwndDlg,IDC_SEX),CB_GETCURSEL,0,0); + sex = SendDlgItemMessage(hwndDlg, IDC_SEX, CB_GETCURSEL, 0, 0); myProfile.Sex = 0; if(sex == sexF) myProfile.Sex = 0x46; else diff --git a/protocols/Steam/src/steam_dialogs.cpp b/protocols/Steam/src/steam_dialogs.cpp index 033625757a..83c4178b63 100644 --- a/protocols/Steam/src/steam_dialogs.cpp +++ b/protocols/Steam/src/steam_dialogs.cpp @@ -277,7 +277,7 @@ LRESULT CALLBACK CSteamProto::BlockListOptionsSubProc(HWND hwnd, UINT msg, WPARA ListView_DeleteItem(hwnd, lvi.iItem); int nItem = SendMessage(::GetDlgItem(GetParent(hwnd), IDC_CONTACTS), CB_ADDSTRING, 0, (LPARAM)sid); - SendMessage(GetDlgItem(GetParent(hwnd), IDC_CONTACTS), CB_SETITEMDATA, nItem, hContact); + SendDlgItemMessage(GetParent(hwnd), IDC_CONTACTS, CB_SETITEMDATA, nItem, hContact); }*/ } } @@ -397,7 +397,7 @@ INT_PTR CALLBACK CSteamProto::BlockListOptionsProc(HWND hwndDlg, UINT msg, WPARA { int i = ::SendMessage(::GetDlgItem(hwndDlg, IDC_CONTACTS), CB_GETCURSEL, 0, 0); - MCONTACT hContact = (MCONTACT)::SendMessage(GetDlgItem(hwndDlg, IDC_CONTACTS), CB_GETITEMDATA, i, 0); + MCONTACT hContact = (MCONTACT)::SendDlgItemMessage(hwndDlg, IDC_CONTACTS, CB_GETITEMDATA, i, 0); if (!hContact) break; diff --git a/protocols/Xfire/src/options.cpp b/protocols/Xfire/src/options.cpp index c790906dfd..3926eaeb6e 100644 --- a/protocols/Xfire/src/options.cpp +++ b/protocols/Xfire/src/options.cpp @@ -625,7 +625,7 @@ static INT_PTR CALLBACK DlgProcOpts4(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR dbces.lParam = (LPARAM)hwndDlg; CallService(MS_DB_CONTACT_ENUMSETTINGS, 0, (LPARAM)&dbces); - SendMessage(GetDlgItem(hwndDlg, IDC_REMUSER), BM_SETIMAGE, IMAGE_ICON, (WPARAM)LoadSkinnedIcon(SKINICON_OTHER_DELETE)); + SendDlgItemMessage(hwndDlg, IDC_REMUSER, BM_SETIMAGE, IMAGE_ICON, (WPARAM)LoadSkinnedIcon(SKINICON_OTHER_DELETE)); strcpy(inipath, XFireGetFoldersPath("IniFile")); SetDlgItemTextA(hwndDlg, IDC_FILESSHOULDBE, inipath); @@ -777,7 +777,7 @@ static INT_PTR CALLBACK DlgProcOpts6(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR //gamelist füllen SendMessage(hwndDlg, WM_FILLGAMELIST, 0, 0); - //SendMessage(GetDlgItem(hwndDlg,IDC_CREATETXTLIST),BM_SETIMAGE,IMAGE_ICON,(WPARAM)LoadSkinnedIcon(SKINICON_OTHER_USERDETAILS)); + //SendDlgItemMessage(hwndDlg, IDC_CREATETXTLIST), BM_SETIMAGE, IMAGE_ICON, (WPARAM)LoadSkinnedIcon(SKINICON_OTHER_USERDETAILS)); return TRUE; } @@ -975,10 +975,7 @@ static INT_PTR CALLBACK DlgProcOpts6(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR HICON hicon = xgamelist.iconmngr.getGameIcon(gameid); //iconhandle holen und setzen - if (hicon) - SendMessage(GetDlgItem(hwndDlg, IDC_GAMEICO), STM_SETICON, (WPARAM)hicon, 0); - else - SendMessage(GetDlgItem(hwndDlg, IDC_GAMEICO), STM_SETICON, 0, 0); + SendDlgItemMessage(hwndDlg, IDC_GAMEICO, STM_SETICON, (WPARAM)hicon, 0); //elemente aktivieren EnableDlgItem(hwndDlg, IDC_DONTDETECT, TRUE); diff --git a/protocols/Xfire/src/userdetails.cpp b/protocols/Xfire/src/userdetails.cpp index 7f23afb3c7..bd0957ac42 100644 --- a/protocols/Xfire/src/userdetails.cpp +++ b/protocols/Xfire/src/userdetails.cpp @@ -56,7 +56,7 @@ void LoadProfilStatus(LPVOID lparam) { HBITMAP hbitmap = xgamelist.createHBITMAPfromdata(buf, size); //speicher freigeben delete[] buf; - SendMessage(GetDlgItem(ghwndDlg, IDC_PROFILIMG), STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)hbitmap); + SendDlgItemMessage(ghwndDlg, IDC_PROFILIMG, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)hbitmap); } delete[] lparam; } @@ -293,12 +293,12 @@ static INT_PTR CALLBACK DlgProcUserDetails(HWND hwndDlg, UINT msg, WPARAM wParam if (!db_get(hContact, protocolname, "GameId", &dbv)) { - SendMessage(GetDlgItem(hwndDlg, IDC_GAMEICO), STM_SETICON, (WPARAM)xgamelist.iconmngr.getGameIcon(dbv.wVal), 0); + SendDlgItemMessage(hwndDlg, IDC_GAMEICO, STM_SETICON, (WPARAM)xgamelist.iconmngr.getGameIcon(dbv.wVal), 0); db_free(&dbv); } if (!db_get(hContact, protocolname, "VoiceId", &dbv)) { - SendMessage(GetDlgItem(hwndDlg, IDC_VOICEICO), STM_SETICON, (WPARAM)xgamelist.iconmngr.getGameIcon(dbv.wVal), 0); + SendDlgItemMessage(hwndDlg, IDC_VOICEICO, STM_SETICON, (WPARAM)xgamelist.iconmngr.getGameIcon(dbv.wVal), 0); db_free(&dbv); } diff --git a/protocols/Yahoo/src/options.cpp b/protocols/Yahoo/src/options.cpp index 8ca0eef48a..fecb7a631d 100644 --- a/protocols/Yahoo/src/options.cpp +++ b/protocols/Yahoo/src/options.cpp @@ -331,7 +331,7 @@ static INT_PTR CALLBACK DlgProcYahooOptsIgnore(HWND hwndDlg, UINT msg, WPARAM wP break; } - i = SendMessage(GetDlgItem(hwndDlg,IDC_YIGN_LIST), LB_GETCURSEL, 0, 0); + i = SendDlgItemMessage(hwndDlg,IDC_YIGN_LIST, LB_GETCURSEL, 0, 0); if (i == LB_ERR) { MessageBox(hwndDlg, TranslateT("Please select a buddy on the ignore list to remove."), TranslateT("Yahoo Ignore"), MB_OK| MB_ICONINFORMATION); break; @@ -340,7 +340,7 @@ static INT_PTR CALLBACK DlgProcYahooOptsIgnore(HWND hwndDlg, UINT msg, WPARAM wP SendMessageA(GetDlgItem(hwndDlg,IDC_YIGN_LIST), LB_GETTEXT, i, (LPARAM)id); ppro->IgnoreBuddy(id, 1); - SendMessage(GetDlgItem(hwndDlg,IDC_YIGN_LIST), LB_DELETESTRING, i, 0); + SendDlgItemMessage(hwndDlg,IDC_YIGN_LIST, LB_DELETESTRING, i, 0); } } break; diff --git a/src/core/stdchat/src/window.cpp b/src/core/stdchat/src/window.cpp index f3dbde1bb6..4327e73287 100644 --- a/src/core/stdchat/src/window.cpp +++ b/src/core/stdchat/src/window.cpp @@ -90,17 +90,17 @@ static void InitButtons(HWND hwndDlg, SESSION_INFO *si) SendDlgItemMessage( hwndDlg, IDC_FILTER, BUTTONSETASFLATBTN, TRUE, 0 ); SendDlgItemMessage( hwndDlg, IDC_CLOSE, BUTTONSETASFLATBTN, TRUE, 0 ); - SendMessage(GetDlgItem(hwndDlg, IDC_SMILEY), BUTTONADDTOOLTIP, (WPARAM)LPGEN("Insert a smiley"), 0); - SendMessage(GetDlgItem(hwndDlg, IDC_BOLD), BUTTONADDTOOLTIP, (WPARAM)LPGEN("Make the text bold (CTRL+B)"), 0); - SendMessage(GetDlgItem(hwndDlg, IDC_ITALICS), BUTTONADDTOOLTIP, (WPARAM)LPGEN("Make the text italicized (CTRL+I)"), 0); - SendMessage(GetDlgItem(hwndDlg, IDC_UNDERLINE), BUTTONADDTOOLTIP, (WPARAM)LPGEN("Make the text underlined (CTRL+U)"), 0); - SendMessage(GetDlgItem(hwndDlg, IDC_BKGCOLOR), BUTTONADDTOOLTIP, (WPARAM)LPGEN("Select a background color for the text (CTRL+L)"), 0); - SendMessage(GetDlgItem(hwndDlg, IDC_COLOR), BUTTONADDTOOLTIP, (WPARAM)LPGEN("Select a foreground color for the text (CTRL+K)"), 0); - SendMessage(GetDlgItem(hwndDlg, IDC_HISTORY), BUTTONADDTOOLTIP, (WPARAM)LPGEN("Show the history (CTRL+H)"), 0); - SendMessage(GetDlgItem(hwndDlg, IDC_SHOWNICKLIST), BUTTONADDTOOLTIP, (WPARAM)LPGEN("Show/hide the nick list (CTRL+N)"), 0); - SendMessage(GetDlgItem(hwndDlg, IDC_CHANMGR), BUTTONADDTOOLTIP, (WPARAM)LPGEN("Control this room (CTRL+O)"), 0); - SendMessage(GetDlgItem(hwndDlg, IDC_FILTER), BUTTONADDTOOLTIP, (WPARAM)LPGEN("Enable/disable the event filter (CTRL+F)"), 0); - SendMessage(GetDlgItem(hwndDlg, IDC_CLOSE), BUTTONADDTOOLTIP, (WPARAM)LPGEN("Close current tab (CTRL+F4)"), 0); + SendDlgItemMessage(hwndDlg, IDC_SMILEY, BUTTONADDTOOLTIP, (WPARAM)LPGEN("Insert a smiley"), 0); + SendDlgItemMessage(hwndDlg, IDC_BOLD, BUTTONADDTOOLTIP, (WPARAM)LPGEN("Make the text bold (CTRL+B)"), 0); + SendDlgItemMessage(hwndDlg, IDC_ITALICS, BUTTONADDTOOLTIP, (WPARAM)LPGEN("Make the text italicized (CTRL+I)"), 0); + SendDlgItemMessage(hwndDlg, IDC_UNDERLINE, BUTTONADDTOOLTIP, (WPARAM)LPGEN("Make the text underlined (CTRL+U)"), 0); + SendDlgItemMessage(hwndDlg, IDC_BKGCOLOR, BUTTONADDTOOLTIP, (WPARAM)LPGEN("Select a background color for the text (CTRL+L)"), 0); + SendDlgItemMessage(hwndDlg, IDC_COLOR, BUTTONADDTOOLTIP, (WPARAM)LPGEN("Select a foreground color for the text (CTRL+K)"), 0); + SendDlgItemMessage(hwndDlg, IDC_HISTORY, BUTTONADDTOOLTIP, (WPARAM)LPGEN("Show the history (CTRL+H)"), 0); + SendDlgItemMessage(hwndDlg, IDC_SHOWNICKLIST, BUTTONADDTOOLTIP, (WPARAM)LPGEN("Show/hide the nick list (CTRL+N)"), 0); + SendDlgItemMessage(hwndDlg, IDC_CHANMGR, BUTTONADDTOOLTIP, (WPARAM)LPGEN("Control this room (CTRL+O)"), 0); + SendDlgItemMessage(hwndDlg, IDC_FILTER, BUTTONADDTOOLTIP, (WPARAM)LPGEN("Enable/disable the event filter (CTRL+F)"), 0); + SendDlgItemMessage(hwndDlg, IDC_CLOSE, BUTTONADDTOOLTIP, (WPARAM)LPGEN("Close current tab (CTRL+F4)"), 0); SendDlgItemMessage(hwndDlg, IDC_BOLD, BUTTONSETASPUSHBTN, TRUE, 0); SendDlgItemMessage(hwndDlg, IDC_ITALICS, BUTTONSETASPUSHBTN, TRUE, 0); SendDlgItemMessage(hwndDlg, IDC_UNDERLINE, BUTTONSETASPUSHBTN, TRUE, 0); @@ -263,7 +263,7 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, return 0; case WM_MOUSEWHEEL: - SendMessage(GetDlgItem(GetParent(hwnd), IDC_LOG), WM_MOUSEWHEEL, wParam, lParam); + SendDlgItemMessage(GetParent(hwnd), IDC_LOG, WM_MOUSEWHEEL, wParam, lParam); dat->lastEnterTime = 0; return TRUE; @@ -837,7 +837,7 @@ static LRESULT CALLBACK LogSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR case WM_CHAR: SetFocus(GetDlgItem(GetParent(hwnd), IDC_MESSAGE)); - SendMessage(GetDlgItem(GetParent(hwnd), IDC_MESSAGE), WM_CHAR, wParam, lParam); + SendDlgItemMessage(GetParent(hwnd), IDC_MESSAGE, WM_CHAR, wParam, lParam); break; } @@ -1027,7 +1027,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, } else ScreenToClient(hwnd, &hti.pt); - int item = LOWORD(SendMessage(GetDlgItem(GetParent(hwnd), IDC_LIST), LB_ITEMFROMPOINT, 0, MAKELPARAM(hti.pt.x, hti.pt.y))); + int item = LOWORD(SendDlgItemMessage(GetParent(hwnd), IDC_LIST, LB_ITEMFROMPOINT, 0, MAKELPARAM(hti.pt.x, hti.pt.y))); USERINFO *ui = pci->SM_GetUserFromIndex(parentdat->ptszID, parentdat->pszModule, item); if (ui) { USERINFO uinew; @@ -1187,7 +1187,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam) EnableWindow(GetDlgItem(hwndDlg, IDC_SMILEY), TRUE); - SendMessage(GetDlgItem(hwndDlg, IDC_LOG), EM_HIDESELECTION, TRUE, 0); + SendDlgItemMessage(hwndDlg, IDC_LOG, EM_HIDESELECTION, TRUE, 0); SendMessage(hwndDlg, GC_SETWNDPROPS, 0, 0); SendMessage(hwndDlg, GC_UPDATESTATUSBAR, 0, 0); @@ -1214,7 +1214,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam) SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)LoadIconEx( "window", TRUE )); SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)LoadIconEx( "window", FALSE )); - SendMessage(GetDlgItem(hwndDlg, IDC_LOG), EM_SETBKGNDCOLOR , 0, g_Settings.crLogBackground); + SendDlgItemMessage(hwndDlg, IDC_LOG, EM_SETBKGNDCOLOR, 0, g_Settings.crLogBackground); if (g_Settings.bTabsEnable) { LONG_PTR mask = GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TAB), GWL_STYLE); @@ -1231,9 +1231,9 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam) cf.dwEffects = 0; cf.crTextColor = g_Settings.MessageAreaColor; cf.crBackColor = (COLORREF)db_get_dw(NULL, CHAT_MODULE, "ColorMessageBG", GetSysColor(COLOR_WINDOW)); - SendMessage(GetDlgItem(hwndDlg, IDC_MESSAGE), EM_SETBKGNDCOLOR , 0, db_get_dw(NULL, CHAT_MODULE, "ColorMessageBG", GetSysColor(COLOR_WINDOW))); - SendDlgItemMessage(hwndDlg, IDC_MESSAGE, WM_SETFONT, (WPARAM) g_Settings.MessageAreaFont, MAKELPARAM(TRUE, 0)); - SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_SETCHARFORMAT, (WPARAM)SCF_ALL , (LPARAM)&cf); + SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_SETBKGNDCOLOR, 0, db_get_dw(NULL, CHAT_MODULE, "ColorMessageBG", GetSysColor(COLOR_WINDOW))); + SendDlgItemMessage(hwndDlg, IDC_MESSAGE, WM_SETFONT, (WPARAM)g_Settings.MessageAreaFont, MAKELPARAM(TRUE, 0)); + SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_SETCHARFORMAT, (WPARAM)SCF_ALL, (LPARAM)&cf); // nicklist int ih = GetTextPixelSize( _T("AQGglo"), g_Settings.UserListFont,FALSE); @@ -1245,7 +1245,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam) if (g_Settings.bShowContactStatus) font = font > 16 ? font : 16; - SendMessage(GetDlgItem(hwndDlg, IDC_LIST), LB_SETITEMHEIGHT, 0, (LPARAM)height > font ? height : font); + SendDlgItemMessage(hwndDlg, IDC_LIST, LB_SETITEMHEIGHT, 0, (LPARAM)height > font ? height : font); InvalidateRect(GetDlgItem(hwndDlg, IDC_LIST), NULL, TRUE); } SendMessage(hwndDlg, WM_SIZE, 0, 0); @@ -1806,9 +1806,9 @@ END_REMOVETAB: case GC_UPDATENICKLIST: { - int i = SendMessage(GetDlgItem(hwndDlg, IDC_LIST), LB_GETTOPINDEX, 0, 0); - SendMessage(GetDlgItem(hwndDlg, IDC_LIST), LB_SETCOUNT, si->nUsersInNicklist, 0); - SendMessage(GetDlgItem(hwndDlg, IDC_LIST), LB_SETTOPINDEX, i, 0); + int i = SendDlgItemMessage(hwndDlg, IDC_LIST, LB_GETTOPINDEX, 0, 0); + SendDlgItemMessage(hwndDlg, IDC_LIST, LB_SETCOUNT, si->nUsersInNicklist, 0); + SendDlgItemMessage(hwndDlg, IDC_LIST, LB_SETTOPINDEX, i, 0); SendMessage(hwndDlg, GC_UPDATETITLE, 0, 0); } break; @@ -1964,7 +1964,7 @@ LABEL_SHOWWINDOW: CHARRANGE sel; sel.cpMin = sel.cpMax = GetRichTextLength(GetDlgItem(hwndDlg, IDC_LOG)); - SendMessage(GetDlgItem(hwndDlg, IDC_LOG), EM_EXSETSEL, 0, (LPARAM) &sel); + SendDlgItemMessage(hwndDlg, IDC_LOG, EM_EXSETSEL, 0, (LPARAM) &sel); PostMessage(GetDlgItem(hwndDlg, IDC_LOG), WM_VSCROLL, MAKEWPARAM(SB_BOTTOM, 0), 0); } break; @@ -2102,14 +2102,14 @@ LABEL_SHOWWINDOW: POINTL ptl = { (LONG)pt.x, (LONG)pt.y }; ScreenToClient(GetDlgItem(hwndDlg, IDC_LOG), (LPPOINT)&ptl); - long iCharIndex = SendMessage(GetDlgItem(hwndDlg, IDC_LOG), EM_CHARFROMPOS, 0, (LPARAM)&ptl); + long iCharIndex = SendDlgItemMessage(hwndDlg, IDC_LOG, EM_CHARFROMPOS, 0, (LPARAM)&ptl); if (iCharIndex < 0) break; - long iLineIndex = SendMessage(GetDlgItem(hwndDlg, IDC_LOG), EM_EXLINEFROMCHAR, 0, (LPARAM)iCharIndex); - long iChars = SendMessage(GetDlgItem(hwndDlg, IDC_LOG), EM_LINEINDEX, (WPARAM)iLineIndex, 0); - long start = SendMessage(GetDlgItem(hwndDlg, IDC_LOG), EM_FINDWORDBREAK, WB_LEFT, iCharIndex);//-iChars; - long end = SendMessage(GetDlgItem(hwndDlg, IDC_LOG), EM_FINDWORDBREAK, WB_RIGHT, iCharIndex);//-iChars; + long iLineIndex = SendDlgItemMessage(hwndDlg, IDC_LOG, EM_EXLINEFROMCHAR, 0, (LPARAM)iCharIndex); + long iChars = SendDlgItemMessage(hwndDlg, IDC_LOG, EM_LINEINDEX, (WPARAM)iLineIndex, 0); + long start = SendDlgItemMessage(hwndDlg, IDC_LOG, EM_FINDWORDBREAK, WB_LEFT, iCharIndex);//-iChars; + long end = SendDlgItemMessage(hwndDlg, IDC_LOG, EM_FINDWORDBREAK, WB_RIGHT, iCharIndex);//-iChars; if (end - start > 0) { TEXTRANGE tr; @@ -2120,7 +2120,7 @@ LABEL_SHOWWINDOW: cr.cpMax = end; tr.chrg = cr; tr.lpstrText = pszWord; - long iRes = SendMessage(GetDlgItem(hwndDlg, IDC_LOG), EM_GETTEXTRANGE, 0, (LPARAM)&tr); + long iRes = SendDlgItemMessage(hwndDlg, IDC_LOG, EM_GETTEXTRANGE, 0, (LPARAM)&tr); if (iRes > 0) { int iLen = (int)mir_tstrlen(pszWord)-1; while (iLen >= 0 && _tcschr(szTrimString, pszWord[iLen])) { @@ -2252,7 +2252,7 @@ LABEL_SHOWWINDOW: POINT p; GetCursorPos(&p); ScreenToClient(GetDlgItem(hwndDlg, IDC_LIST), &p); - int item = LOWORD(SendMessage(GetDlgItem(hwndDlg, IDC_LIST), LB_ITEMFROMPOINT, 0, MAKELPARAM(p.x, p.y))); + int item = LOWORD(SendDlgItemMessage(hwndDlg, IDC_LIST, LB_ITEMFROMPOINT, 0, MAKELPARAM(p.x, p.y))); USERINFO *ui = pci->SM_GetUserFromIndex(parentdat->ptszID, parentdat->pszModule, item); if (ui != NULL) { static TCHAR ptszBuf[1024]; @@ -2275,11 +2275,11 @@ LABEL_SHOWWINDOW: hti.pt.y = (short)HIWORD(GetMessagePos()); ScreenToClient(GetDlgItem(hwndDlg, IDC_LIST), &hti.pt); - int item = LOWORD(SendMessage(GetDlgItem(hwndDlg, IDC_LIST), LB_ITEMFROMPOINT, 0, MAKELPARAM(hti.pt.x, hti.pt.y))); + int item = LOWORD(SendDlgItemMessage(hwndDlg, IDC_LIST, LB_ITEMFROMPOINT, 0, MAKELPARAM(hti.pt.x, hti.pt.y))); USERINFO *ui = pci->SM_GetUserFromIndex(si->ptszID, si->pszModule, item); if (ui) { if (GetKeyState(VK_SHIFT) & 0x8000) { - LRESULT lResult = (LRESULT)SendMessage(GetDlgItem(hwndDlg, IDC_MESSAGE), EM_GETSEL, 0, 0); + LRESULT lResult = (LRESULT)SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_GETSEL, 0, 0); int start = LOWORD(lResult); size_t dwNameLenMax = (mir_tstrlen(ui->pszUID) + 3); TCHAR* pszName = (TCHAR*)alloca(sizeof(TCHAR) * dwNameLenMax); @@ -2288,7 +2288,7 @@ LABEL_SHOWWINDOW: else mir_sntprintf(pszName, dwNameLenMax, _T("%s "), ui->pszUID); - SendMessage(GetDlgItem(hwndDlg, IDC_MESSAGE), EM_REPLACESEL, FALSE, (LPARAM)pszName); + SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_REPLACESEL, FALSE, (LPARAM)pszName); PostMessage(hwndDlg, WM_MOUSEACTIVATE, 0, 0); } else pci->DoEventHookAsync(hwndDlg, si->ptszID, si->pszModule, GC_USER_PRIVMESS, ui->pszUID, NULL, 0); diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index e566a650ec..4cb95cbec3 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -547,7 +547,7 @@ static int MessageDialogResize(HWND hwndDlg, LPARAM lParam, UTILRESIZECONTROL * GetWindowText(h, buf, SIZEOF(buf)); HDC hdc = GetDC(h); - HFONT hFont = (HFONT)SelectObject(hdc, (HFONT)SendMessage(GetDlgItem(hwndDlg, IDOK), WM_GETFONT, 0, 0)); + HFONT hFont = (HFONT)SelectObject(hdc, (HFONT)SendDlgItemMessage(hwndDlg, IDOK, WM_GETFONT, 0, 0)); SIZE textSize; GetTextExtentPoint32(hdc, buf, (int)mir_tstrlen(buf), &textSize); diff --git a/src/modules/metacontacts/meta_addto.cpp b/src/modules/metacontacts/meta_addto.cpp index d50a4ae0fb..9311ff97d5 100644 --- a/src/modules/metacontacts/meta_addto.cpp +++ b/src/modules/metacontacts/meta_addto.cpp @@ -175,7 +175,7 @@ static INT_PTR CALLBACK Meta_SelectDialogProc(HWND hwndDlg, UINT msg, WPARAM wPa return IDOK == MessageBox(hwndDlg, TranslateT("Please select a metacontact"), TranslateT("No metacontact selected"), MB_ICONHAND); MCONTACT hContact = (MCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); - MCONTACT hMeta = (MCONTACT)SendMessage(GetDlgItem(hwndDlg, IDC_METALIST), LB_GETITEMDATA, item, 0); + MCONTACT hMeta = (MCONTACT)SendDlgItemMessage(hwndDlg, IDC_METALIST, LB_GETITEMDATA, item, 0); if (!Meta_Assign(hContact, hMeta, FALSE)) MessageBox(hwndDlg, TranslateT("Assignment to the metacontact failed."), TranslateT("Assignment failure"), MB_ICONERROR); } diff --git a/src/modules/options/options.cpp b/src/modules/options/options.cpp index 21818343e7..3fd4cbae16 100644 --- a/src/modules/options/options.cpp +++ b/src/modules/options/options.cpp @@ -526,9 +526,9 @@ static void RebuildPageTree(HWND hdlg, OptionsDlgData *dat) _tcsncpy(dat->szFilterString, pos, SIZEOF(dat->szFilterString)); } else { - int sel = SendMessage(GetDlgItem(hdlg, IDC_KEYWORD_FILTER), (UINT)CB_GETCURSEL, 0, 0); + int sel = SendDlgItemMessage(hdlg, IDC_KEYWORD_FILTER, (UINT)CB_GETCURSEL, 0, 0); if (sel != -1) { - HINSTANCE hinst = (HINSTANCE)SendMessage(GetDlgItem(hdlg, IDC_KEYWORD_FILTER), (UINT)CB_GETITEMDATA, sel, 0); + HINSTANCE hinst = (HINSTANCE)SendDlgItemMessage(hdlg, IDC_KEYWORD_FILTER, (UINT)CB_GETITEMDATA, sel, 0); TCHAR szFileName[300]; GetModuleFileName(hinst, szFileName, SIZEOF(szFileName)); TCHAR *pos = _tcsrchr(szFileName, _T('\\')); -- cgit v1.2.3