summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/TabSRMM/src/container.cpp32
-rw-r--r--plugins/TabSRMM/src/generic_msghandlers.cpp2
-rw-r--r--plugins/TabSRMM/src/msgdialog.cpp4
-rw-r--r--plugins/TabSRMM/src/msgdlgother.cpp2
-rw-r--r--plugins/TabSRMM/src/msgs.h2
-rw-r--r--plugins/TabSRMM/src/taskbar.cpp2
6 files changed, 20 insertions, 24 deletions
diff --git a/plugins/TabSRMM/src/container.cpp b/plugins/TabSRMM/src/container.cpp
index 1c9a0122bb..2539eb2c6f 100644
--- a/plugins/TabSRMM/src/container.cpp
+++ b/plugins/TabSRMM/src/container.cpp
@@ -512,6 +512,15 @@ void TContainerData::LoadThemeDefaults()
m_theme.isPrivate = false;
}
+void TContainerData::QueryClientArea(RECT &rc)
+{
+ if (!IsIconic(m_hwnd))
+ GetClientRect(m_hwnd, &rc);
+ else
+ CopyRect(&rc, &m_rcSaved);
+ AdjustTabClientRect(rc);
+}
+
// search tab with either next or most recent unread message and select it
void TContainerData::QueryPending()
{
@@ -1747,8 +1756,8 @@ panel_found:
pContainer->ApplySetting(true);
break;
case IDM_MOREOPTIONS:
- if (IsIconic(pContainer->m_hwnd))
- SendMessage(pContainer->m_hwnd, WM_SYSCOMMAND, SC_RESTORE, 0);
+ if (IsIconic(hwndDlg))
+ SendMessage(hwndDlg, WM_SYSCOMMAND, SC_RESTORE, 0);
pContainer->OptionsDialog();
break;
case SC_MAXIMIZE:
@@ -1976,30 +1985,17 @@ panel_found:
case WM_MEASUREITEM:
return Menu_MeasureItem(lParam);
- case DM_QUERYCLIENTAREA:
- {
- RECT *pRect = (RECT*)lParam;
- if (pRect) {
- if (!IsIconic(hwndDlg))
- GetClientRect(hwndDlg, pRect);
- else
- CopyRect(pRect, &pContainer->m_rcSaved);
- pContainer->AdjustTabClientRect(*pRect);
- }
- }
- return 0;
-
case WM_MOUSEWHEEL:
GetCursorPos(&pt);
if (pContainer->m_flags.m_bSideBar) {
RECT rc1;
- GetWindowRect(GetDlgItem(pContainer->m_hwnd, IDC_SIDEBARUP), &rc);
- GetWindowRect(GetDlgItem(pContainer->m_hwnd, IDC_SIDEBARDOWN), &rc1);
+ GetWindowRect(GetDlgItem(hwndDlg, IDC_SIDEBARUP), &rc);
+ GetWindowRect(GetDlgItem(hwndDlg, IDC_SIDEBARDOWN), &rc1);
rc.bottom = rc1.bottom;
if (PtInRect(&rc, pt)) {
short amount = (short)(HIWORD(wParam));
- SendMessage(pContainer->m_hwnd, WM_COMMAND, MAKELONG(amount > 0 ? IDC_SIDEBARUP : IDC_SIDEBARDOWN, 0), IDC_SRMM_MESSAGE);
+ SendMessage(hwndDlg, WM_COMMAND, MAKELONG(amount > 0 ? IDC_SIDEBARUP : IDC_SIDEBARDOWN, 0), IDC_SRMM_MESSAGE);
return 0;
}
}
diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp
index 5d093e9bd9..866d149810 100644
--- a/plugins/TabSRMM/src/generic_msghandlers.cpp
+++ b/plugins/TabSRMM/src/generic_msghandlers.cpp
@@ -390,7 +390,7 @@ LRESULT CMsgDialog::DM_MsgWindowCmdHandler(UINT cmd, WPARAM wParam, LPARAM lPara
SWP_NOMOVE | SWP_NOSIZE | SWP_NOCOPYBITS);
RedrawWindow(m_hwnd, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW | RDW_ALLCHILDREN);
}
- SendMessage(m_pContainer->m_hwnd, DM_QUERYCLIENTAREA, 0, (LPARAM)&rc);
+ m_pContainer->QueryClientArea(rc);
Resize();
DM_ScrollToBottom(1, 1);
Utils::showDlgControl(m_hwnd, IDC_MULTISPLITTER, (m_sendMode & SMODE_MULTIPLE) ? SW_SHOW : SW_HIDE);
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp
index bdc3c45ca9..861469d289 100644
--- a/plugins/TabSRMM/src/msgdialog.cpp
+++ b/plugins/TabSRMM/src/msgdialog.cpp
@@ -610,7 +610,7 @@ bool CMsgDialog::OnInitDialog()
mir_free(wszInitialText);
}
- SendMessage(m_pContainer->m_hwnd, DM_QUERYCLIENTAREA, 0, (LPARAM)&rc);
+ m_pContainer->QueryClientArea(rc);
SetWindowPos(m_hwnd, nullptr, rc.left, rc.top, (rc.right - rc.left), (rc.bottom - rc.top), m_bActivate ? 0 : SWP_NOZORDER | SWP_NOACTIVATE);
LoadSplitter();
@@ -2781,7 +2781,7 @@ INT_PTR CMsgDialog::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
DM_UpdateLastMessage();
}
- SendMessage(m_pContainer->m_hwnd, DM_QUERYCLIENTAREA, 0, (LPARAM)&rcClient);
+ m_pContainer->QueryClientArea(rcClient);
MoveWindow(m_hwnd, rcClient.left, rcClient.top, (rcClient.right - rcClient.left), (rcClient.bottom - rcClient.top), TRUE);
if (m_bWasBackgroundCreate) {
m_bWasBackgroundCreate = false;
diff --git a/plugins/TabSRMM/src/msgdlgother.cpp b/plugins/TabSRMM/src/msgdlgother.cpp
index a349dfcedf..3051d7c59c 100644
--- a/plugins/TabSRMM/src/msgdlgother.cpp
+++ b/plugins/TabSRMM/src/msgdlgother.cpp
@@ -149,7 +149,7 @@ void CMsgDialog::CloseTab()
m_pContainer->m_hwndActive = GetTabWindow(m_hwndParent, i);
RECT rc;
- SendMessage(m_pContainer->m_hwnd, DM_QUERYCLIENTAREA, 0, (LPARAM)& rc);
+ m_pContainer->QueryClientArea(rc);
SetWindowPos(m_pContainer->m_hwndActive, HWND_TOP, rc.left, rc.top, (rc.right - rc.left), (rc.bottom - rc.top), SWP_SHOWWINDOW);
ShowWindow(m_pContainer->m_hwndActive, SW_SHOW);
SetForegroundWindow(m_pContainer->m_hwndActive);
diff --git a/plugins/TabSRMM/src/msgs.h b/plugins/TabSRMM/src/msgs.h
index bf365bf55f..3aaa1e574d 100644
--- a/plugins/TabSRMM/src/msgs.h
+++ b/plugins/TabSRMM/src/msgs.h
@@ -282,6 +282,7 @@ struct TContainerData : public MZeroedObject
void LoadOverrideTheme(void);
void LoadThemeDefaults(void);
void OptionsDialog(void);
+ void QueryClientArea(RECT &rc);
void QueryPending(void);
void ReflashContainer(void);
void Resize(bool, int newWidth);
@@ -722,7 +723,6 @@ struct TIconDescW
#define DM_CHECKSIZE (TM_USER+37)
#define DM_FORCEREDRAW (TM_USER+38)
#define DM_QUERYHCONTACT (TM_USER+41)
-#define DM_QUERYCLIENTAREA (TM_USER+45)
#define DM_ACTIVATEME (TM_USER+46)
#define DM_STATUSMASKSET (TM_USER+51)
#define DM_UPDATESTATUSMSG (TM_USER+53)
diff --git a/plugins/TabSRMM/src/taskbar.cpp b/plugins/TabSRMM/src/taskbar.cpp
index bdf0479a00..b29530936f 100644
--- a/plugins/TabSRMM/src/taskbar.cpp
+++ b/plugins/TabSRMM/src/taskbar.cpp
@@ -280,7 +280,7 @@ void CProxyWindow::sendPreview()
if (m_dat->m_bNeedCheckSize) {
RECT rcClient;
- ::SendMessage(m_dat->m_pContainer->m_hwnd, DM_QUERYCLIENTAREA, 0, (LPARAM)&rcClient);
+ m_dat->m_pContainer->QueryClientArea(rcClient);
::MoveWindow(m_dat->GetHwnd(), rcClient.left, rcClient.top, (rcClient.right - rcClient.left), (rcClient.bottom - rcClient.top), FALSE);
::SendMessage(m_dat->GetHwnd(), WM_SIZE, 0, 0);
m_dat->DM_ScrollToBottom(0, 1);