summaryrefslogtreecommitdiff
path: root/plugins/TabSRMM/src
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/TabSRMM/src')
-rw-r--r--plugins/TabSRMM/src/container.cpp217
-rw-r--r--plugins/TabSRMM/src/generic_msghandlers.cpp8
-rw-r--r--plugins/TabSRMM/src/infopanel.cpp6
-rw-r--r--plugins/TabSRMM/src/infopanel.h2
-rw-r--r--plugins/TabSRMM/src/msgdialog.cpp170
-rw-r--r--plugins/TabSRMM/src/msgdlgother.cpp113
-rw-r--r--plugins/TabSRMM/src/msgs.h20
-rw-r--r--plugins/TabSRMM/src/sendqueue.cpp8
-rw-r--r--plugins/TabSRMM/src/tabctrl.cpp10
-rw-r--r--plugins/TabSRMM/src/userprefs.cpp2
10 files changed, 272 insertions, 284 deletions
diff --git a/plugins/TabSRMM/src/container.cpp b/plugins/TabSRMM/src/container.cpp
index 1b8bfd118b..3fc97f38f9 100644
--- a/plugins/TabSRMM/src/container.cpp
+++ b/plugins/TabSRMM/src/container.cpp
@@ -51,12 +51,118 @@ HWND TSAPI GetTabWindow(HWND hwndTab, int i)
return (TabCtrl_GetItem(hwndTab, i, &tci)) ? (HWND)tci.lParam: nullptr;
}
+void TContainerData::CloseTabByMouse(POINT *pt)
+{
+ HWND hwndTab = GetDlgItem(m_hwnd, IDC_MSGTABS);
+ if (HWND hDlg = GetTabWindow(hwndTab, GetTabItemFromMouse(hwndTab, pt))) {
+ if (hDlg != m_hwndActive) {
+ m_bDontSmartClose = true;
+ SendMessage(hDlg, WM_CLOSE, 0, 1);
+ RedrawWindow(m_hwnd, nullptr, nullptr, RDW_INVALIDATE);
+ m_bDontSmartClose = false;
+ }
+ else SendMessage(hDlg, WM_CLOSE, 0, 1);
+ }
+}
+
void TContainerData::InitRedraw()
{
::KillTimer(m_hwnd, (UINT_PTR)this);
::SetTimer(m_hwnd, (UINT_PTR)this, 100, nullptr);
}
+// search tab with either next or most recent unread message and select it
+void TContainerData::QueryPending(int iCommand)
+{
+ RECENTINFO ri;
+
+ SendMessage(m_hwnd, DM_QUERYRECENT, 0, (LPARAM)&ri);
+
+ NMHDR nmhdr;
+ nmhdr.code = TCN_SELCHANGE;
+
+ HWND hwndTab = GetDlgItem(m_hwnd, IDC_MSGTABS);
+ if (iCommand == DM_QUERY_NEXT && ri.iFirstIndex != -1) {
+ TabCtrl_SetCurSel(hwndTab, ri.iFirstIndex);
+ SendMessage(m_hwnd, WM_NOTIFY, 0, (LPARAM)&nmhdr);
+ }
+ if (iCommand == DM_QUERY_MOSTRECENT && ri.iMostRecent != -1) {
+ TabCtrl_SetCurSel(hwndTab, ri.iMostRecent);
+ SendMessage(m_hwnd, WM_NOTIFY, 0, (LPARAM)&nmhdr);
+ }
+}
+
+// retrieve the container window geometry information from the database.
+void TContainerData::RestoreWindowPos()
+{
+ if (m_isCloned && m_hContactFrom != 0 && !(m_dwFlags & CNT_GLOBALSIZE)) {
+ if (Utils_RestoreWindowPosition(m_hwnd, m_hContactFrom, SRMSGMOD_T, "split")) {
+ if (Utils_RestoreWindowPositionNoMove(m_hwnd, m_hContactFrom, SRMSGMOD_T, "split"))
+ if (Utils_RestoreWindowPosition(m_hwnd, 0, SRMSGMOD_T, "split"))
+ if (Utils_RestoreWindowPositionNoMove(m_hwnd, 0, SRMSGMOD_T, "split"))
+ SetWindowPos(m_hwnd, nullptr, 50, 50, 450, 300, SWP_NOZORDER | SWP_NOACTIVATE);
+ }
+ }
+ else {
+ if (m_dwFlags & CNT_GLOBALSIZE) {
+ if (Utils_RestoreWindowPosition(m_hwnd, 0, SRMSGMOD_T, "split"))
+ if (Utils_RestoreWindowPositionNoMove(m_hwnd, 0, SRMSGMOD_T, "split"))
+ SetWindowPos(m_hwnd, nullptr, 50, 50, 450, 300, SWP_NOZORDER | SWP_NOACTIVATE);
+ }
+ else {
+ char szCName[CONTAINER_NAMELEN + 20];
+ mir_snprintf(szCName, "%s%d", CONTAINER_PREFIX, m_iContainerIndex);
+ if (Utils_RestoreWindowPosition(m_hwnd, 0, SRMSGMOD_T, szCName)) {
+ if (Utils_RestoreWindowPositionNoMove(m_hwnd, 0, SRMSGMOD_T, szCName))
+ if (Utils_RestoreWindowPosition(m_hwnd, 0, SRMSGMOD_T, "split"))
+ if (Utils_RestoreWindowPositionNoMove(m_hwnd, 0, SRMSGMOD_T, "split"))
+ SetWindowPos(m_hwnd, nullptr, 50, 50, 450, 300, SWP_NOZORDER | SWP_NOACTIVATE);
+ }
+ }
+ }
+}
+
+void TContainerData::SelectTab(int iCommand, int idx)
+{
+ HWND hwndTab = GetDlgItem(m_hwnd, IDC_MSGTABS);
+
+ switch (iCommand) {
+ case DM_SELECT_BY_HWND:
+ ActivateTabFromHWND(hwndTab, (HWND)idx);
+ break;
+
+ case DM_SELECT_NEXT:
+ case DM_SELECT_PREV:
+ case DM_SELECT_BY_INDEX:
+ int iItems = TabCtrl_GetItemCount(hwndTab);
+ if (iItems == 1)
+ break;
+
+ int iCurrent = TabCtrl_GetCurSel(hwndTab), iNewTab;
+
+ if (iCommand == DM_SELECT_PREV)
+ iNewTab = iCurrent ? iCurrent - 1 : iItems - 1; // cycle if current is already the leftmost tab..
+ else if (iCommand == DM_SELECT_NEXT)
+ iNewTab = (iCurrent == (iItems - 1)) ? 0 : iCurrent + 1;
+ else {
+ if (idx > iItems)
+ break;
+ iNewTab = idx - 1;
+ }
+
+ if (iNewTab != iCurrent) {
+ if (HWND hDlg = GetTabWindow(hwndTab, iNewTab)) {
+ TabCtrl_SetCurSel(hwndTab, iNewTab);
+ ShowWindow(m_hwndActive, SW_HIDE);
+ m_hwndActive = hDlg;
+ ShowWindow(hDlg, SW_SHOW);
+ SetFocus(m_hwndActive);
+ }
+ }
+ break;
+ }
+}
+
void TContainerData::SetIcon(CMsgDialog *pDlg, HICON hIcon)
{
HICON hIconMsg = PluginConfig.g_IconMsgEvent;
@@ -673,21 +779,21 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam,
else pContainer->m_hwndTip = nullptr;
if (pContainer->m_dwFlags & CNT_CREATE_MINIMIZED) {
- WINDOWPLACEMENT wp = { 0 };
- wp.length = sizeof(wp);
-
SetWindowLongPtr(hwndDlg, GWL_STYLE, GetWindowLongPtr(hwndDlg, GWL_STYLE) & ~WS_VISIBLE);
ShowWindow(hwndDlg, SW_SHOWMINNOACTIVE);
- SendMessage(hwndDlg, DM_RESTOREWINDOWPOS, 0, 0);
+ pContainer->RestoreWindowPos();
//GetClientRect(hwndDlg, &pContainer->m_rcSaved);
ShowWindow(hwndDlg, SW_SHOWMINNOACTIVE);
+
+ WINDOWPLACEMENT wp = {};
+ wp.length = sizeof(wp);
GetWindowPlacement(hwndDlg, &wp);
pContainer->m_rcSaved.left = pContainer->m_rcSaved.top = 0;
pContainer->m_rcSaved.right = wp.rcNormalPosition.right - wp.rcNormalPosition.left;
pContainer->m_rcSaved.bottom = wp.rcNormalPosition.bottom - wp.rcNormalPosition.top;
}
else {
- SendMessage(hwndDlg, DM_RESTOREWINDOWPOS, 0, 0);
+ pContainer->RestoreWindowPos();
ShowWindow(hwndDlg, SW_SHOWNORMAL);
}
}
@@ -699,35 +805,6 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam,
}
return TRUE;
- case DM_RESTOREWINDOWPOS:
- // retrieve the container window geometry information from the database.
- if (pContainer->m_isCloned && pContainer->m_hContactFrom != 0 && !(pContainer->m_dwFlags & CNT_GLOBALSIZE)) {
- if (Utils_RestoreWindowPosition(hwndDlg, pContainer->m_hContactFrom, SRMSGMOD_T, "split")) {
- if (Utils_RestoreWindowPositionNoMove(hwndDlg, pContainer->m_hContactFrom, SRMSGMOD_T, "split"))
- if (Utils_RestoreWindowPosition(hwndDlg, 0, SRMSGMOD_T, "split"))
- if (Utils_RestoreWindowPositionNoMove(hwndDlg, 0, SRMSGMOD_T, "split"))
- SetWindowPos(hwndDlg, nullptr, 50, 50, 450, 300, SWP_NOZORDER | SWP_NOACTIVATE);
- }
- }
- else {
- if (pContainer->m_dwFlags & CNT_GLOBALSIZE) {
- if (Utils_RestoreWindowPosition(hwndDlg, 0, SRMSGMOD_T, "split"))
- if (Utils_RestoreWindowPositionNoMove(hwndDlg, 0, SRMSGMOD_T, "split"))
- SetWindowPos(hwndDlg, nullptr, 50, 50, 450, 300, SWP_NOZORDER | SWP_NOACTIVATE);
- }
- else {
- char szCName[CONTAINER_NAMELEN + 20];
- mir_snprintf(szCName, "%s%d", CONTAINER_PREFIX, pContainer->m_iContainerIndex);
- if (Utils_RestoreWindowPosition(hwndDlg, 0, SRMSGMOD_T, szCName)) {
- if (Utils_RestoreWindowPositionNoMove(hwndDlg, 0, SRMSGMOD_T, szCName))
- if (Utils_RestoreWindowPosition(hwndDlg, 0, SRMSGMOD_T, "split"))
- if (Utils_RestoreWindowPositionNoMove(hwndDlg, 0, SRMSGMOD_T, "split"))
- SetWindowPos(hwndDlg, nullptr, 50, 50, 450, 300, SWP_NOZORDER | SWP_NOACTIVATE);
- }
- }
- }
- return 0;
-
case WM_SIZE:
if (IsIconic(hwndDlg))
pContainer->m_dwFlags |= CNT_DEFERREDSIZEREQUEST;
@@ -933,7 +1010,7 @@ panel_found:
if (fFromSidebar && dat)
SendMessage(dat->GetHwnd(), WM_CLOSE, 1, 0);
else
- SendMessage(hwndDlg, DM_CLOSETABATMOUSE, 0, (LPARAM)&pt);
+ pContainer->CloseTabByMouse(&pt);
break;
case ID_TABMENU_CLOSEOTHERTABS:
if (dat)
@@ -1309,44 +1386,6 @@ panel_found:
}
break;
- case DM_SELECTTAB:
- switch (wParam) {
- case DM_SELECT_BY_HWND:
- ActivateTabFromHWND(hwndTab, (HWND)lParam);
- break;
-
- case DM_SELECT_NEXT:
- case DM_SELECT_PREV:
- case DM_SELECT_BY_INDEX:
- int iItems = TabCtrl_GetItemCount(hwndTab);
- if (iItems == 1)
- break;
-
- int iCurrent = TabCtrl_GetCurSel(hwndTab), iNewTab;
-
- if (wParam == DM_SELECT_PREV)
- iNewTab = iCurrent ? iCurrent - 1 : iItems - 1; // cycle if current is already the leftmost tab..
- else if (wParam == DM_SELECT_NEXT)
- iNewTab = (iCurrent == (iItems - 1)) ? 0 : iCurrent + 1;
- else {
- if ((int)lParam > iItems)
- break;
- iNewTab = lParam - 1;
- }
-
- if (iNewTab != iCurrent) {
- if (HWND hDlg = GetTabWindow(hwndTab, iNewTab)) {
- TabCtrl_SetCurSel(hwndTab, iNewTab);
- ShowWindow(pContainer->m_hwndActive, SW_HIDE);
- pContainer->m_hwndActive = hDlg;
- ShowWindow(hDlg, SW_SHOW);
- SetFocus(pContainer->m_hwndActive);
- }
- }
- break;
- }
- break;
-
case WM_INITMENUPOPUP:
pContainer->m_pMenuBar->setActive(reinterpret_cast<HMENU>(wParam));
break;
@@ -1445,18 +1484,6 @@ panel_found:
SendMessage(hwndTab, WM_MOUSEMOVE, wParam, (LPARAM)&pt);
break;
- case DM_CLOSETABATMOUSE:
- if (HWND hDlg = GetTabWindow(hwndTab, GetTabItemFromMouse(hwndTab, (POINT*)lParam))) {
- if (hDlg != pContainer->m_hwndActive) {
- pContainer->m_bDontSmartClose = TRUE;
- SendMessage(hDlg, WM_CLOSE, 0, 1);
- RedrawWindow(hwndDlg, nullptr, nullptr, RDW_INVALIDATE);
- pContainer->m_bDontSmartClose = FALSE;
- }
- else SendMessage(hDlg, WM_CLOSE, 0, 1);
- }
- break;
-
case WM_PAINT:
if (bSkinned || M.isAero()) {
PAINTSTRUCT ps;
@@ -1670,26 +1697,6 @@ panel_found:
}
return 0;
- // search tab with either next or most recent unread message and select it
- case DM_QUERYPENDING:
- RECENTINFO ri;
- {
- SendMessage(hwndDlg, DM_QUERYRECENT, 0, (LPARAM)&ri);
-
- NMHDR nmhdr;
- nmhdr.code = TCN_SELCHANGE;
-
- if (wParam == DM_QUERY_NEXT && ri.iFirstIndex != -1) {
- TabCtrl_SetCurSel(hwndTab, ri.iFirstIndex);
- SendMessage(hwndDlg, WM_NOTIFY, 0, (LPARAM)&nmhdr);
- }
- if (wParam == DM_QUERY_MOSTRECENT && ri.iMostRecent != -1) {
- TabCtrl_SetCurSel(hwndTab, ri.iMostRecent);
- SendMessage(hwndDlg, WM_NOTIFY, 0, (LPARAM)&nmhdr);
- }
- }
- return 0;
-
case WM_DRAWITEM:
{
DRAWITEMSTRUCT *dis = (DRAWITEMSTRUCT *)lParam;
diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp
index 7b2f90c0e9..22b795a3ef 100644
--- a/plugins/TabSRMM/src/generic_msghandlers.cpp
+++ b/plugins/TabSRMM/src/generic_msghandlers.cpp
@@ -232,7 +232,7 @@ LRESULT CMsgDialog::DM_MsgWindowCmdHandler(UINT cmd, WPARAM wParam, LPARAM lPara
case IDC_NAME:
if (GetKeyState(VK_SHIFT) & 0x8000) // copy UIN
- SendMessage(m_hwnd, DM_UINTOCLIPBOARD, 0, 0);
+ Utils::CopyToClipBoard(m_cache->getUIN(), m_hwnd);
else
CallService(MS_USERINFO_SHOWDIALOG, (WPARAM)(m_cache->getActiveContact()), 0);
break;
@@ -433,7 +433,7 @@ LRESULT CMsgDialog::DM_MsgWindowCmdHandler(UINT cmd, WPARAM wParam, LPARAM lPara
if (m_bEditNotesActive) {
int iLen = GetWindowTextLength(m_message.GetHwnd());
if (iLen != 0) {
- SendMessage(m_hwnd, DM_ACTIVATETOOLTIP, IDC_SRMM_MESSAGE, (LPARAM)TranslateT("You cannot edit user notes when there are unsent messages"));
+ ActivateTooltip(IDC_SRMM_MESSAGE, TranslateT("You cannot edit user notes when there are unsent messages"));
m_bEditNotesActive = false;
break;
}
@@ -971,7 +971,7 @@ void CMsgDialog::DM_OptionsApplied(WPARAM, LPARAM lParam)
if (IsIconic(m_pContainer->m_hwnd))
m_dwFlags |= MWF_DEFERREDREMAKELOG;
else
- SendMessage(m_hwnd, DM_REMAKELOG, 0, 0);
+ RemakeLog();
}
ShowWindow(m_hwndPanelPicParent, SW_SHOW);
@@ -1195,7 +1195,7 @@ void CMsgDialog::DM_EventAdded(WPARAM hContact, LPARAM lParam)
RedrawWindow(GetDlgItem(m_hwnd, IDC_LOGFROZENTEXT), nullptr, nullptr, RDW_INVALIDATE);
}
}
- else SendMessage(m_hwnd, DM_REMAKELOG, 0, 0);
+ else RemakeLog();
// handle tab flashing
if (!bDisableNotify && !bIsStatusChangeEvent)
diff --git a/plugins/TabSRMM/src/infopanel.cpp b/plugins/TabSRMM/src/infopanel.cpp
index 434b097b2a..638af4c505 100644
--- a/plugins/TabSRMM/src/infopanel.cpp
+++ b/plugins/TabSRMM/src/infopanel.cpp
@@ -861,7 +861,7 @@ void CInfoPanel::trackMouse(POINT &pt)
// @param ctrlId : control id
// @param lParam : typically a wchar_t * for the tooltip text
-void CInfoPanel::showTip(UINT ctrlId, const LPARAM lParam)
+void CInfoPanel::showTip(UINT ctrlId, const wchar_t *pwszTip)
{
if (!m_active || !m_dat->m_hwndTip)
return;
@@ -872,8 +872,8 @@ void CInfoPanel::showTip(UINT ctrlId, const LPARAM lParam)
::GetWindowRect(GetDlgItem(hwndDlg, ctrlId), &rc);
::SendMessage(m_dat->m_hwndTip, TTM_TRACKPOSITION, 0, (LPARAM)MAKELONG(rc.left, rc.bottom));
}
- if (lParam)
- m_dat->ti.lpszText = reinterpret_cast<wchar_t *>(lParam);
+ if (pwszTip)
+ m_dat->ti.lpszText = (wchar_t*)pwszTip;
else {
if (m_hwndConfig)
return;
diff --git a/plugins/TabSRMM/src/infopanel.h b/plugins/TabSRMM/src/infopanel.h
index 9e925ba511..d76a7e8898 100644
--- a/plugins/TabSRMM/src/infopanel.h
+++ b/plugins/TabSRMM/src/infopanel.h
@@ -152,7 +152,7 @@ public:
void trackMouse(POINT& pt);
int hitTest(POINT pt);
void handleClick(const POINT& pt);
- void showTip(UINT ctrlId, const LPARAM lParam);
+ void showTip(UINT ctrlId, const wchar_t *pwszTip);
void hideTip(const HWND hWndNew);
int invokeConfigDialog(const POINT& pt);
void dismissConfig(bool fForced = false);
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp
index 48cedc8320..a34638f835 100644
--- a/plugins/TabSRMM/src/msgdialog.cpp
+++ b/plugins/TabSRMM/src/msgdialog.cpp
@@ -221,7 +221,7 @@ LRESULT CALLBACK SplitterSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
case WM_MOUSEMOVE:
if (GetCapture() == hwnd) {
GetClientRect(hwnd, &rc);
- SendMessage(hwndParent, DM_SPLITTERMOVED, rc.right > rc.bottom ? (short)HIWORD(GetMessagePos()) + rc.bottom / 2 : (short)LOWORD(GetMessagePos()) + rc.right / 2, (LPARAM)hwnd);
+ dat->SplitterMoved(rc.right > rc.bottom ? (short)HIWORD(GetMessagePos()) + rc.bottom / 2 : (short)LOWORD(GetMessagePos()) + rc.right / 2, hwnd);
}
return 0;
@@ -822,7 +822,7 @@ void CMsgDialog::OnDestroy()
void CMsgDialog::onClick_Ok(CCtrlButton *)
{
if (m_bEditNotesActive) {
- SendMessage(m_hwnd, DM_ACTIVATETOOLTIP, IDC_PIC, (LPARAM)TranslateT("You are editing the user notes. Click the button again or use the hotkey (default: Alt+N) to save the notes and return to normal messaging mode"));
+ ActivateTooltip(IDC_PIC, TranslateT("You are editing the user notes. Click the button again or use the hotkey (default: Alt+N) to save the notes and return to normal messaging mode"));
return;
}
@@ -1518,7 +1518,7 @@ int CMsgDialog::OnFilter(MSGFILTER *pFilter)
db_unset(m_hContact, SRMSGMOD_T, "mwflags");
}
DM_OptionsApplied(0, 0);
- SendMessage(m_hwnd, DM_DEFERREDREMAKELOG, (WPARAM)m_hwnd, 0);
+ RemakeLog();
}
return _dlgReturn(m_hwnd, 1);
@@ -1572,14 +1572,14 @@ int CMsgDialog::OnFilter(MSGFILTER *pFilter)
}
if (isCtrl && isShift) {
if (wp == 0x9) { // ctrl-shift tab
- SendMessage(m_hwnd, DM_SELECTTAB, DM_SELECT_PREV, 0);
+ m_pContainer->SelectTab(DM_SELECT_PREV);
_clrMsgFilter(pFilter);
return _dlgReturn(m_hwnd, 1);
}
}
if (isCtrl && !isShift && !isAlt) {
if (wp == VK_TAB) {
- SendMessage(m_hwnd, DM_SELECTTAB, DM_SELECT_NEXT, 0);
+ m_pContainer->SelectTab(DM_SELECT_NEXT);
_clrMsgFilter(pFilter);
return _dlgReturn(m_hwnd, 1);
}
@@ -1588,18 +1588,18 @@ int CMsgDialog::OnFilter(MSGFILTER *pFilter)
return _dlgReturn(m_hwnd, 1);
}
if (wp == VK_PRIOR) {
- SendMessage(m_hwnd, DM_SELECTTAB, DM_SELECT_PREV, 0);
+ m_pContainer->SelectTab(DM_SELECT_PREV);
return _dlgReturn(m_hwnd, 1);
}
if (wp == VK_NEXT) {
- SendMessage(m_hwnd, DM_SELECTTAB, DM_SELECT_NEXT, 0);
+ m_pContainer->SelectTab(DM_SELECT_NEXT);
return _dlgReturn(m_hwnd, 1);
}
}
}
if (msg == WM_SYSKEYDOWN && isAlt) {
if (wp == 0x52) {
- SendMessage(m_hwnd, DM_QUERYPENDING, DM_QUERY_MOSTRECENT, 0);
+ m_pContainer->QueryPending(DM_QUERY_MOSTRECENT);
return _dlgReturn(m_hwnd, 1);
}
if (wp == VK_MULTIPLY) {
@@ -1611,11 +1611,11 @@ int CMsgDialog::OnFilter(MSGFILTER *pFilter)
return _dlgReturn(m_hwnd, 1);
}
if (wp == VK_ADD) {
- SendMessage(m_pContainer->m_hwnd, DM_SELECTTAB, DM_SELECT_NEXT, 0);
+ m_pContainer->SelectTab(DM_SELECT_NEXT);
return _dlgReturn(m_hwnd, 1);
}
if (wp == VK_SUBTRACT) {
- SendMessage(m_pContainer->m_hwnd, DM_SELECTTAB, DM_SELECT_PREV, 0);
+ m_pContainer->SelectTab(DM_SELECT_PREV);
return _dlgReturn(m_hwnd, 1);
}
}
@@ -2125,7 +2125,7 @@ LRESULT CMsgDialog::WndProc_Message(UINT msg, WPARAM wParam, LPARAM lParam)
mir_snwprintf(szBuffer, TranslateT("WARNING: The message you are trying to paste exceeds the message size limit for the active protocol. It will be sent in chunks of max %d characters"), m_nMax - 10);
else
mir_snwprintf(szBuffer, TranslateT("The message you are trying to paste exceeds the message size limit for the active protocol. Only the first %d characters will be sent."), m_nMax);
- SendMessage(m_hwnd, DM_ACTIVATETOOLTIP, IDC_SRMM_MESSAGE, (LPARAM)szBuffer);
+ ActivateTooltip(IDC_SRMM_MESSAGE, szBuffer);
}
}
else if (hClip = GetClipboardData(CF_BITMAP))
@@ -2256,13 +2256,13 @@ LRESULT CMsgDialog::WndProc_Message(UINT msg, WPARAM wParam, LPARAM lParam)
KbdState(isShift, isCtrl, isAlt);
if ((wParam >= '0' && wParam <= '9') && isAlt) { // ALT-1 -> ALT-0 direct tab selection
BYTE bChar = (BYTE)wParam;
- int iIndex;
+ int iIndex;
if (bChar == '0')
iIndex = 10;
else
iIndex = bChar - (BYTE)'0';
- SendMessage(m_pContainer->m_hwnd, DM_SELECTTAB, DM_SELECT_BY_INDEX, (LPARAM)iIndex);
+ m_pContainer->SelectTab(DM_SELECT_BY_INDEX, iIndex);
return 0;
}
break;
@@ -2914,120 +2914,16 @@ INT_PTR CMsgDialog::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
}
return 0;
- case DM_SPLITTERMOVED:
- if ((HWND)lParam == GetDlgItem(m_hwnd, IDC_MULTISPLITTER)) {
- GetClientRect(m_hwnd, &rc);
- pt.x = wParam;
- pt.y = 0;
- ScreenToClient(m_hwnd, &pt);
- int oldSplitterX = m_iMultiSplit;
- m_iMultiSplit = rc.right - pt.x;
- if (m_iMultiSplit < 25)
- m_iMultiSplit = 25;
-
- if (m_iMultiSplit > ((rc.right - rc.left) - 80))
- m_iMultiSplit = oldSplitterX;
- Resize();
- }
- else if ((HWND)lParam == GetDlgItem(m_hwnd, IDC_SPLITTERX)) {
- GetClientRect(m_hwnd, &rc);
- pt.x = wParam, pt.y = 0;
- ScreenToClient(m_hwnd, &pt);
-
- int iSplitterX = rc.right - pt.x + 1;
- if (iSplitterX < 35)
- iSplitterX = 35;
- if (iSplitterX > rc.right - rc.left - 35)
- iSplitterX = rc.right - rc.left - 35;
- m_pContainer->m_pSettings->iSplitterX = iSplitterX;
- Resize();
- }
- else if ((HWND)lParam == GetDlgItem(m_hwnd, IDC_SPLITTERY) || lParam == -1) {
- GetClientRect(m_hwnd, &rc);
- rc.top += (m_pPanel.isActive() ? m_pPanel.getHeight() + 40 : 30);
- pt.x = 0;
- pt.y = wParam;
- ScreenToClient(m_hwnd, &pt);
-
- int oldSplitterY = m_iSplitterY;
- int oldDynaSplitter = m_dynaSplitter;
-
- m_iSplitterY = rc.bottom - pt.y + DPISCALEY_S(23);
-
- // attempt to fix splitter troubles..
- // hardcoded limits... better solution is possible, but this works for now
- int bottomtoolbarH = 0;
- if (m_pContainer->m_dwFlags & CNT_BOTTOMTOOLBAR)
- bottomtoolbarH = 22;
-
- if (m_iSplitterY < (DPISCALEY_S(MINSPLITTERY) + 5 + bottomtoolbarH)) { // min splitter size
- m_iSplitterY = (DPISCALEY_S(MINSPLITTERY) + 5 + bottomtoolbarH);
- m_dynaSplitter = m_iSplitterY - DPISCALEY_S(34);
- DM_RecalcPictureSize();
- }
- else if (m_iSplitterY >(rc.bottom - rc.top)) {
- m_iSplitterY = oldSplitterY;
- m_dynaSplitter = oldDynaSplitter;
- DM_RecalcPictureSize();
- }
- else {
- m_dynaSplitter = (rc.bottom - pt.y) - DPISCALEY_S(11);
- DM_RecalcPictureSize();
- }
- UpdateToolbarBG();
- Resize();
- }
- else if ((HWND)lParam == GetDlgItem(m_hwnd, IDC_PANELSPLITTER)) {
- GetClientRect(m_log.GetHwnd(), &rc);
-
- POINT pnt = { 0, (int)wParam };
- ScreenToClient(m_hwnd, &pnt);
- if ((pnt.y + 2 >= MIN_PANELHEIGHT + 2) && (pnt.y + 2 < 100) && (pnt.y + 2 < rc.bottom - 30))
- m_pPanel.setHeight(pnt.y + 2, true);
-
- RedrawWindow(m_hwnd, nullptr, nullptr, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE);
- if (M.isAero())
- InvalidateRect(GetParent(m_hwnd), nullptr, FALSE);
- }
- break;
-
- case DM_DEFERREDREMAKELOG:
- // queue a dm_remakelog
- // wParam = hwnd of the sender, so we can directly do a DM_REMAKELOG if the msg came
- // from ourself. otherwise, the dm_remakelog will be deferred until next window
- // activation (focus)
- if ((HWND)wParam == m_hwnd)
- SendMessage(m_hwnd, DM_REMAKELOG, 0, 0);
- else {
- if (M.GetByte(m_hContact, "mwoverride", 0) == 0) {
- m_dwFlags &= ~(MWF_LOG_ALL);
- m_dwFlags |= (lParam & MWF_LOG_ALL);
- m_dwFlags |= MWF_DEFERREDREMAKELOG;
- }
- }
- return 0;
-
case DM_FORCEDREMAKELOG:
- if ((HWND)wParam == m_hwnd)
- SendMessage(m_hwnd, DM_REMAKELOG, 0, 0);
- else {
- m_dwFlags &= ~(MWF_LOG_ALL);
- m_dwFlags |= (lParam & MWF_LOG_ALL);
- m_dwFlags |= MWF_DEFERREDREMAKELOG;
- }
- return 0;
-
- case DM_REMAKELOG:
- m_szMicroLf[0] = 0;
- m_lastEventTime = 0;
- m_iLastEventType = -1;
- StreamInEvents(m_hDbEventFirst, -1, 0, nullptr);
+ m_dwFlags &= ~(MWF_LOG_ALL);
+ m_dwFlags |= (lParam & MWF_LOG_ALL);
+ m_dwFlags |= MWF_DEFERREDREMAKELOG;
return 0;
case DM_APPENDMCEVENT:
if (m_hContact == db_mc_getMeta(wParam) && m_hDbEventFirst == 0) {
m_hDbEventFirst = lParam;
- SendMessage(m_hwnd, DM_REMAKELOG, 0, 0);
+ RemakeLog();
}
else if (m_hContact == wParam && db_mc_isSub(wParam) && db_event_getContact(lParam) != wParam)
StreamInEvents(lParam, 1, 1, nullptr);
@@ -3062,7 +2958,7 @@ INT_PTR CMsgDialog::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
GetCursorPos(&pt);
if (wParam == TIMERID_AWAYMSG && m_pPanel.hitTest(pt) != CInfoPanel::HTNIRVANA)
- SendMessage(m_hwnd, DM_ACTIVATETOOLTIP, 0, 0);
+ ActivateTooltip(0, 0);
else
m_dwFlagsEx &= ~MWF_SHOW_AWAYMSGTIMER;
break;
@@ -3096,14 +2992,10 @@ INT_PTR CMsgDialog::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
}
break;
- case DM_SELECTTAB:
- SendMessage(m_pContainer->m_hwnd, DM_SELECTTAB, wParam, lParam); // pass the msg to our container
- return 0;
-
+ case DM_QUERYLASTUNREAD:
// return timestamp (in ticks) of last recent message which has not been read yet.
// 0 if there is none
// lParam = pointer to a dword receiving the value.
- case DM_QUERYLASTUNREAD:
{
DWORD *pdw = (DWORD *)lParam;
if (pdw)
@@ -3145,10 +3037,6 @@ INT_PTR CMsgDialog::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
}
return 0;
- case DM_QUERYPENDING: // sent by the message input area hotkeys. just pass it to our container
- SendMessage(m_pContainer->m_hwnd, DM_QUERYPENDING, wParam, lParam);
- return 0;
-
case WM_LBUTTONDOWN:
GetCursorPos(&tmp);
cur.x = (SHORT)tmp.x;
@@ -3343,7 +3231,7 @@ INT_PTR CMsgDialog::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
DWORD cmd = GET_APPCOMMAND_LPARAM(lParam);
if (cmd == APPCOMMAND_BROWSER_BACKWARD || cmd == APPCOMMAND_BROWSER_FORWARD) {
- SendMessage(m_pContainer->m_hwnd, DM_SELECTTAB, cmd == APPCOMMAND_BROWSER_BACKWARD ? DM_SELECT_PREV : DM_SELECT_NEXT, 0);
+ m_pContainer->SelectTab(cmd == APPCOMMAND_BROWSER_BACKWARD ? DM_SELECT_PREV : DM_SELECT_NEXT);
return 1;
}
}
@@ -3375,10 +3263,6 @@ INT_PTR CMsgDialog::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
sendQueue->ackMessage(this, wParam, lParam);
return 0;
- case DM_UINTOCLIPBOARD:
- Utils::CopyToClipBoard(m_cache->getUIN(), m_hwnd);
- return 0;
-
case WM_NEXTDLGCTL:
if (m_dwFlags & MWF_WASBACKGROUNDCREATE)
return 1;
@@ -3386,14 +3270,14 @@ INT_PTR CMsgDialog::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
case DM_IEVIEWOPTIONSCHANGED:
if (m_hwndIEView)
- SendMessage(m_hwnd, DM_REMAKELOG, 0, 0);
+ RemakeLog();
break;
case DM_SMILEYOPTIONSCHANGED:
if (isChat())
RedrawLog();
else
- SendMessage(m_hwnd, DM_REMAKELOG, 0, 0);
+ RemakeLog();
break;
case DM_MYAVATARCHANGED:
@@ -3452,7 +3336,7 @@ INT_PTR CMsgDialog::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
if (m_wStatus == ID_STATUS_OFFLINE) {
pcaps = CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_4, 0);
if (!(pcaps & PF4_OFFLINEFILES)) {
- SendMessage(m_hwnd, DM_ACTIVATETOOLTIP, IDC_SRMM_MESSAGE, (LPARAM)TranslateT("Contact is offline and this protocol does not support sending files to offline users."));
+ ActivateTooltip(IDC_SRMM_MESSAGE, TranslateT("Contact is offline and this protocol does not support sending files to offline users."));
break;
}
}
@@ -3630,14 +3514,6 @@ INT_PTR CMsgDialog::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
}
return 0;
- case DM_ACTIVATETOOLTIP:
- // show the balloon tooltip control.
- // wParam == id of the "anchor" element, defaults to the panel status field (for away msg retrieval)
- // lParam == new text to show
- if (!IsIconic(m_pContainer->m_hwnd) && m_pContainer->m_hwndActive == m_hwnd)
- m_pPanel.showTip(wParam, lParam);
- return 0;
-
case DM_STATUSBARCHANGED:
tabUpdateStatusBar();
break;
diff --git a/plugins/TabSRMM/src/msgdlgother.cpp b/plugins/TabSRMM/src/msgdlgother.cpp
index c3aefbc758..7dd848bec1 100644
--- a/plugins/TabSRMM/src/msgdlgother.cpp
+++ b/plugins/TabSRMM/src/msgdlgother.cpp
@@ -31,6 +31,15 @@
UINT_PTR CALLBACK OpenFileSubclass(HWND hwnd, UINT msg, WPARAM, LPARAM lParam);
/////////////////////////////////////////////////////////////////////////////////////////
+// show the balloon tooltip control.
+
+void CMsgDialog::ActivateTooltip(int iCtrlId, const wchar_t *pwszMessage)
+{
+ if (!IsIconic(m_pContainer->m_hwnd) && m_pContainer->m_hwndActive == m_hwnd)
+ m_pPanel.showTip(iCtrlId, pwszMessage);
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
void CMsgDialog::AddLog()
{
@@ -744,7 +753,7 @@ void CMsgDialog::HandlePasteAndSend()
{
// is feature disabled?
if (!PluginConfig.m_PasteAndSend) {
- SendMessage(m_hwnd, DM_ACTIVATETOOLTIP, IDC_SRMM_MESSAGE, (LPARAM)TranslateT("The 'paste and send' feature is disabled. You can enable it on the 'General' options page in the 'Sending messages' section"));
+ ActivateTooltip(IDC_SRMM_MESSAGE, TranslateT("The 'paste and send' feature is disabled. You can enable it on the 'General' options page in the 'Sending messages' section"));
return;
}
@@ -1119,7 +1128,7 @@ void CMsgDialog::MsgWindowUpdateState(UINT msg)
m_pContainer->m_dwFlags &= ~CNT_NEED_UPDATETITLE;
if ((m_dwFlags & MWF_DEFERREDREMAKELOG) && !IsIconic(m_pContainer->m_hwnd)) {
- SendMessage(m_hwnd, DM_REMAKELOG, 0, 0);
+ RemakeLog();
m_dwFlags &= ~MWF_DEFERREDREMAKELOG;
}
@@ -1326,6 +1335,14 @@ void CMsgDialog::PlayIncomingSound() const
}
}
+void CMsgDialog::RemakeLog()
+{
+ m_szMicroLf[0] = 0;
+ m_lastEventTime = 0;
+ m_iLastEventType = -1;
+ StreamInEvents(m_hDbEventFirst, -1, 0, nullptr);
+}
+
/////////////////////////////////////////////////////////////////////////////////////////
static void __cdecl phase2(SESSION_INFO *si)
@@ -1704,7 +1721,7 @@ void CMsgDialog::ShowPicture(bool showNewPic)
RECT rc;
GetWindowRect(GetDlgItem(m_hwnd, IDC_CONTACTPIC), &rc);
if (m_minEditBoxSize.cy + DPISCALEY_S(3) > m_iSplitterY)
- SendMessage(m_hwnd, DM_SPLITTERMOVED, (WPARAM)rc.bottom - m_minEditBoxSize.cy, (LPARAM)GetDlgItem(m_hwnd, IDC_SPLITTERY));
+ SplitterMoved(rc.bottom - m_minEditBoxSize.cy, GetDlgItem(m_hwnd, IDC_SPLITTERY));
if (!showNewPic)
SetDialogToType();
else
@@ -1807,6 +1824,96 @@ void CMsgDialog::ShowPopupMenu(const CCtrlBase &pCtrl, POINT pt)
DestroyMenu(hMenu);
}
+void CMsgDialog::SplitterMoved(int coord, HWND hwnd)
+{
+ POINT pt;
+ RECT rc;
+
+ switch (GetDlgCtrlID(hwnd)) {
+ case IDC_MULTISPLITTER:
+ GetClientRect(m_hwnd, &rc);
+ pt.x = coord;
+ pt.y = 0;
+ ScreenToClient(m_hwnd, &pt);
+ {
+ int oldSplitterX = m_iMultiSplit;
+ m_iMultiSplit = rc.right - pt.x;
+ if (m_iMultiSplit < 25)
+ m_iMultiSplit = 25;
+
+ if (m_iMultiSplit > ((rc.right - rc.left) - 80))
+ m_iMultiSplit = oldSplitterX;
+ }
+ Resize();
+ break;
+
+ case IDC_SPLITTERX:
+ GetClientRect(m_hwnd, &rc);
+ pt.x = coord, pt.y = 0;
+ ScreenToClient(m_hwnd, &pt);
+ {
+ int iSplitterX = rc.right - pt.x + 1;
+ if (iSplitterX < 35)
+ iSplitterX = 35;
+ if (iSplitterX > rc.right - rc.left - 35)
+ iSplitterX = rc.right - rc.left - 35;
+ m_pContainer->m_pSettings->iSplitterX = iSplitterX;
+ }
+ Resize();
+ break;
+
+ case IDC_SPLITTERY:
+ GetClientRect(m_hwnd, &rc);
+ rc.top += (m_pPanel.isActive() ? m_pPanel.getHeight() + 40 : 30);
+ pt.x = 0;
+ pt.y = coord;
+ ScreenToClient(m_hwnd, &pt);
+ {
+ int oldSplitterY = m_iSplitterY;
+ int oldDynaSplitter = m_dynaSplitter;
+
+ m_iSplitterY = rc.bottom - pt.y + DPISCALEY_S(23);
+
+ // attempt to fix splitter troubles..
+ // hardcoded limits... better solution is possible, but this works for now
+ int bottomtoolbarH = 0;
+ if (m_pContainer->m_dwFlags & CNT_BOTTOMTOOLBAR)
+ bottomtoolbarH = 22;
+
+ if (m_iSplitterY < (DPISCALEY_S(MINSPLITTERY) + 5 + bottomtoolbarH)) { // min splitter size
+ m_iSplitterY = (DPISCALEY_S(MINSPLITTERY) + 5 + bottomtoolbarH);
+ m_dynaSplitter = m_iSplitterY - DPISCALEY_S(34);
+ DM_RecalcPictureSize();
+ }
+ else if (m_iSplitterY > (rc.bottom - rc.top)) {
+ m_iSplitterY = oldSplitterY;
+ m_dynaSplitter = oldDynaSplitter;
+ DM_RecalcPictureSize();
+ }
+ else {
+ m_dynaSplitter = (rc.bottom - pt.y) - DPISCALEY_S(11);
+ DM_RecalcPictureSize();
+ }
+ }
+ UpdateToolbarBG();
+ Resize();
+ break;
+
+ case IDC_PANELSPLITTER:
+ GetClientRect(m_log.GetHwnd(), &rc);
+
+ POINT pnt = { 0, coord };
+ ScreenToClient(m_hwnd, &pnt);
+ if ((pnt.y + 2 >= MIN_PANELHEIGHT + 2) && (pnt.y + 2 < 100) && (pnt.y + 2 < rc.bottom - 30))
+ m_pPanel.setHeight(pnt.y + 2, true);
+
+ RedrawWindow(m_hwnd, nullptr, nullptr, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE);
+ if (M.isAero())
+ InvalidateRect(GetParent(m_hwnd), nullptr, FALSE);
+ break;
+ }
+}
+
/////////////////////////////////////////////////////////////////////////////////////////
bool CMsgDialog::TabAutoComplete()
diff --git a/plugins/TabSRMM/src/msgs.h b/plugins/TabSRMM/src/msgs.h
index befcaa1645..64961ed70b 100644
--- a/plugins/TabSRMM/src/msgs.h
+++ b/plugins/TabSRMM/src/msgs.h
@@ -220,12 +220,16 @@ struct TContainerData
WORD m_avatarMode, m_ownAvatarMode;
BYTE m_bTBRenderingMode;
TLogTheme m_theme;
- TContainerSettings* m_pSettings;
- CTaskbarInteract* m_pTaskBar;
CMenuBar *m_pMenuBar;
CSideBar *m_pSideBar;
+ CTaskbarInteract *m_pTaskBar;
+ TContainerSettings *m_pSettings;
void InitRedraw();
+ void CloseTabByMouse(POINT *);
+ void QueryPending(int iCommand);
+ void RestoreWindowPos();
+ void SelectTab(int iCommand, int idx = 0);
void SetIcon(CMsgDialog *pDlg, HICON hIcon);
void UpdateTabs();
void UpdateTitle(MCONTACT, class CMsgDialog* = nullptr);
@@ -469,6 +473,7 @@ public:
void CB_DestroyButton(DWORD dwButtonCID, DWORD dwFlags);
void CB_ChangeButton(CustomButtonData *cbd);
+ void ActivateTooltip(int iCtrlId, const wchar_t *pwszMessage);
void AdjustBottomAvatarDisplay();
void CalcDynamicAvatarSize(BITMAP *bminfo);
void CheckStatusIconClick(POINT pt, const RECT &rc, int gap, int code);
@@ -496,11 +501,13 @@ public:
int MustPlaySound() const;
void NotifyDeliveryFailure() const;
void PlayIncomingSound() const;
+ void RemakeLog();
void SendHBitmapAsFile(HBITMAP hbmp) const;
void SaveSplitter();
void SetDialogToType();
void SetMessageLog();
void ShowPicture(bool showNewPic);
+ void SplitterMoved(int x, HWND hwnd);
void StreamInEvents(MEVENT hDbEventFirst, int count, int fAppend, DBEVENTINFO *dbei_s);
void UpdateReadChars() const;
void UpdateSaveAndSendButton();
@@ -688,21 +695,16 @@ struct TIconDescW
#define EM_REFRESHWITHOUTCLIP (TM_USER+0x106)
#define HM_EVENTSENT (TM_USER+10)
-#define DM_REMAKELOG (TM_USER+11)
#define HM_DBEVENTADDED (TM_USER+12)
#define DM_SETINFOPANEL (TM_USER+13)
#define DM_OPTIONSAPPLIED (TM_USER+14)
-#define DM_SPLITTERMOVED (TM_USER+15)
#define DM_SPLITSENDACK (TM_USER+19)
#define DM_TYPING (TM_USER+20)
#define DM_UPDATEWINICON (TM_USER+21)
#define DM_UPDATELASTMESSAGE (TM_USER+22)
-#define DM_SELECTTAB (TM_USER+23)
-#define DM_CLOSETABATMOUSE (TM_USER+24)
#define DM_STATUSICONCHANGE (TM_USER+25)
#define DM_QUERYLASTUNREAD (TM_USER+28)
-#define DM_QUERYPENDING (TM_USER+29)
#define DM_UPDATEPICLAYOUT (TM_USER+30)
#define DM_QUERYCONTAINER (TM_USER+31)
#define DM_MUCFLASHWORKER (TM_USER+32)
@@ -714,8 +716,6 @@ struct TIconDescW
#define DM_CONTAINERSELECTED (TM_USER+39)
#define DM_CONFIGURECONTAINER (TM_USER+40)
#define DM_QUERYHCONTACT (TM_USER+41)
-#define DM_DEFERREDREMAKELOG (TM_USER+42)
-#define DM_RESTOREWINDOWPOS (TM_USER+43)
#define DM_QUERYCLIENTAREA (TM_USER+45)
#define DM_QUERYRECENT (TM_USER+47)
#define DM_ACTIVATEME (TM_USER+46)
@@ -723,8 +723,6 @@ struct TIconDescW
#define DM_UPDATESTATUSMSG (TM_USER+53)
#define DM_OWNNICKCHANGED (TM_USER+55)
#define DM_CONFIGURETOOLBAR (TM_USER+56)
-#define DM_ACTIVATETOOLTIP (TM_USER+58)
-#define DM_UINTOCLIPBOARD (TM_USER+59)
#define DM_FORCEDREMAKELOG (TM_USER+62)
#define DM_STATUSBARCHANGED (TM_USER+64)
#define DM_CHECKQUEUEFORCLOSE (TM_USER+70)
diff --git a/plugins/TabSRMM/src/sendqueue.cpp b/plugins/TabSRMM/src/sendqueue.cpp
index c09dbcff03..73f56681c8 100644
--- a/plugins/TabSRMM/src/sendqueue.cpp
+++ b/plugins/TabSRMM/src/sendqueue.cpp
@@ -214,9 +214,9 @@ int SendQueue::sendQueued(CMsgDialog *dat, const int iEntry)
}
if (iSendLength >= iMinLength) {
- wchar_t tszError[256];
+ wchar_t tszError[256];
mir_snwprintf(tszError, TranslateT("The message cannot be sent delayed or to multiple contacts, because it exceeds the maximum allowed message length of %d bytes"), iMinLength);
- ::SendMessage(dat->GetHwnd(), DM_ACTIVATETOOLTIP, IDC_SRMM_MESSAGE, LPARAM(tszError));
+ dat->ActivateTooltip(IDC_SRMM_MESSAGE, tszError);
sendQueue->clearJob(iEntry);
return 0;
}
@@ -271,7 +271,7 @@ int SendQueue::sendQueued(CMsgDialog *dat, const int iEntry)
size_t iSendLength = getSendLength(iEntry);
if ((int)iSendLength >= dat->m_nMax) {
mir_snwprintf(tszError, TranslateT("The message cannot be sent delayed or to multiple contacts, because it exceeds the maximum allowed message length of %d bytes"), dat->m_nMax);
- SendMessage(dat->GetHwnd(), DM_ACTIVATETOOLTIP, IDC_SRMM_MESSAGE, LPARAM(tszError));
+ dat->ActivateTooltip(IDC_SRMM_MESSAGE, tszError);
clearJob(iEntry);
return 0;
}
@@ -559,7 +559,7 @@ int SendQueue::doSendLater(int iJobIndex, CMsgDialog *dat, MCONTACT hContact, bo
dbei.pBlob = (PBYTE)(char*)utfText;
dat->StreamInEvents(0, 1, 1, &dbei);
if (dat->m_hDbEventFirst == 0)
- SendMessage(dat->GetHwnd(), DM_REMAKELOG, 0, 0);
+ dat->RemakeLog();
dat->m_cache->saveHistory();
dat->EnableSendButton(false);
if (dat->m_pContainer->m_hwndActive == dat->GetHwnd())
diff --git a/plugins/TabSRMM/src/tabctrl.cpp b/plugins/TabSRMM/src/tabctrl.cpp
index ca32820cb6..714ddc826e 100644
--- a/plugins/TabSRMM/src/tabctrl.cpp
+++ b/plugins/TabSRMM/src/tabctrl.cpp
@@ -1027,7 +1027,7 @@ static LRESULT CALLBACK TabControlSubclassProc(HWND hwnd, UINT msg, WPARAM wPara
case WM_MBUTTONDOWN:
GetCursorPos(&pt);
- SendMessage(GetParent(hwnd), DM_CLOSETABATMOUSE, 0, (LPARAM)&pt);
+ tabdat->pContainer->CloseTabByMouse(&pt);
return 1;
case WM_SETCURSOR:
@@ -1082,7 +1082,7 @@ static LRESULT CALLBACK TabControlSubclassProc(HWND hwnd, UINT msg, WPARAM wPara
case WM_LBUTTONDBLCLK:
if (!(tabdat->pContainer->m_pSettings->dwFlagsEx & TCF_CLOSEBUTTON)) {
GetCursorPos(&pt);
- SendMessage(GetParent(hwnd), DM_CLOSETABATMOUSE, 0, (LPARAM)&pt);
+ tabdat->pContainer->CloseTabByMouse(&pt);
}
break;
@@ -1221,7 +1221,7 @@ static LRESULT CALLBACK TabControlSubclassProc(HWND hwnd, UINT msg, WPARAM wPara
GetCursorPos(&pt);
int iItem = TabCtrl_TestForCloseButton(tabdat, hwnd, &pt);
if (iItem != -1)
- SendMessage(GetParent(hwnd), DM_CLOSETABATMOUSE, 0, (LPARAM)&pt);
+ tabdat->pContainer->CloseTabByMouse(&pt);
}
break;
@@ -1268,9 +1268,9 @@ static LRESULT CALLBACK TabControlSubclassProc(HWND hwnd, UINT msg, WPARAM wPara
if (lParam == -1) {
short amount = short(HIWORD(wParam));
if (amount > 0)
- SendMessage(GetParent(hwnd), DM_SELECTTAB, DM_SELECT_PREV, 0);
+ tabdat->pContainer->SelectTab(DM_SELECT_PREV);
else if (amount < 0)
- SendMessage(GetParent(hwnd), DM_SELECTTAB, DM_SELECT_NEXT, 0);
+ tabdat->pContainer->SelectTab(DM_SELECT_NEXT);
InvalidateRect(hwnd, nullptr, FALSE);
}
break;
diff --git a/plugins/TabSRMM/src/userprefs.cpp b/plugins/TabSRMM/src/userprefs.cpp
index 71603c5833..51c79192d0 100644
--- a/plugins/TabSRMM/src/userprefs.cpp
+++ b/plugins/TabSRMM/src/userprefs.cpp
@@ -481,7 +481,7 @@ static INT_PTR CALLBACK DlgProcUserPrefsFrame(HWND hwndDlg, UINT msg, WPARAM wPa
else
ShowWindow(dat->m_pContainer->m_hwnd, SW_HIDE);
dat->DM_OptionsApplied(0, 0);
- SendMessage(hwnd, DM_DEFERREDREMAKELOG, (WPARAM)hwnd, 0);
+ dat->RemakeLog();
if (fShouldHide)
ShowWindow(dat->m_pContainer->m_hwnd, SW_SHOWNORMAL);
}