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/TabSRMM | |
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/TabSRMM')
-rw-r--r-- | plugins/TabSRMM/src/buttonsbar.cpp | 4 | ||||
-rw-r--r-- | plugins/TabSRMM/src/chat/message.cpp | 2 | ||||
-rw-r--r-- | plugins/TabSRMM/src/chat/window.cpp | 34 | ||||
-rw-r--r-- | plugins/TabSRMM/src/generic_msghandlers.cpp | 4 | ||||
-rw-r--r-- | plugins/TabSRMM/src/hotkeyhandler.cpp | 2 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgdialog.cpp | 26 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgdlgutils.cpp | 6 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgs.cpp | 2 | ||||
-rw-r--r-- | plugins/TabSRMM/src/templates.cpp | 12 |
9 files changed, 46 insertions, 46 deletions
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: |