diff options
author | Rozhuk Ivan <rozhuk.im@gmail.com> | 2014-12-13 21:56:47 +0000 |
---|---|---|
committer | Rozhuk Ivan <rozhuk.im@gmail.com> | 2014-12-13 21:56:47 +0000 |
commit | 86ecbad7907401648a49139d196559a2d27ec53a (patch) | |
tree | 194b002c2bf6f188709d81cb286375615614f09f /plugins/YARelay | |
parent | bd9841778fdcf06c87ddcad19669779ea15c6111 (diff) |
SendMessage(GetDlgItem -> SendDlgItemMessage
git-svn-id: http://svn.miranda-ng.org/main/trunk@11383 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/YARelay')
-rw-r--r-- | plugins/YARelay/src/options.cpp | 85 |
1 files changed, 44 insertions, 41 deletions
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;
|