diff options
author | George Hazan <ghazan@miranda.im> | 2019-03-07 15:29:12 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-03-07 15:29:12 +0300 |
commit | e43e5e9e3ff94b20953c840a819952e4221654fa (patch) | |
tree | b942f39b5d614bb62ee21b18c700507b8b8ed5aa /plugins/TabSRMM/src/container.cpp | |
parent | ed526dc2746319cc3dbe376e9af20f6a49850687 (diff) |
tabSRMM:
- useless message DM_SETICON replaced with a call of SetIcon;
- fixes #1866 (when sub is changed, tabSRMM doesn't update an avatar in taskbar)
- code cleaning & names conflict resolution
Diffstat (limited to 'plugins/TabSRMM/src/container.cpp')
-rw-r--r-- | plugins/TabSRMM/src/container.cpp | 729 |
1 files changed, 364 insertions, 365 deletions
diff --git a/plugins/TabSRMM/src/container.cpp b/plugins/TabSRMM/src/container.cpp index d68931640e..61cd0cea61 100644 --- a/plugins/TabSRMM/src/container.cpp +++ b/plugins/TabSRMM/src/container.cpp @@ -57,6 +57,71 @@ void TContainerData::InitRedraw() ::SetTimer(m_hwnd, (UINT_PTR)this, 100, nullptr);
}
+void TContainerData::SetIcon(CTabBaseDlg *pDlg, HICON hIcon)
+{
+ HICON hIconMsg = PluginConfig.g_IconMsgEvent;
+
+ if (Win7Taskbar->haveLargeIcons()) {
+ if (hIcon == PluginConfig.g_buttonBarIcons[ICON_DEFAULT_TYPING] || hIcon == hIconMsg) {
+ Win7Taskbar->setOverlayIcon(m_hwnd, (LPARAM)hIcon);
+ if (GetForegroundWindow() != m_hwnd)
+ SendMessage(m_hwnd, WM_SETICON, ICON_SMALL, (LPARAM)hIcon);
+ if (hIcon == hIconMsg)
+ m_hIconTaskbarOverlay = hIconMsg;
+ return;
+ }
+
+ if (pDlg) {
+ if (pDlg->m_hTaskbarIcon != nullptr) {
+ DestroyIcon(pDlg->m_hTaskbarIcon);
+ pDlg->m_hTaskbarIcon = nullptr;
+ }
+
+ if (pDlg->m_pContainer->m_dwFlags & CNT_AVATARSONTASKBAR)
+ pDlg->m_hTaskbarIcon = pDlg->IconFromAvatar();
+
+ HICON hIconBig = (pDlg->m_cache) ? Skin_LoadProtoIcon(pDlg->m_cache->getProto(), pDlg->m_cache->getStatus(), true) : nullptr;
+ if (pDlg->m_hTaskbarIcon) {
+ SendMessage(m_hwnd, WM_SETICON, ICON_BIG, (LPARAM)pDlg->m_hTaskbarIcon);
+ SendMessage(m_hwnd, WM_SETICON, ICON_SMALL, (LPARAM)hIcon);
+ Win7Taskbar->setOverlayIcon(m_hwnd, (LPARAM)(pDlg->m_hTabIcon ? (LPARAM)pDlg->m_hTabIcon : (LPARAM)hIcon));
+ }
+ else {
+ SendMessage(m_hwnd, WM_SETICON, ICON_BIG, hIconBig ? (LPARAM)hIconBig : (LPARAM)hIcon);
+ SendMessage(m_hwnd, WM_SETICON, ICON_SMALL, (LPARAM)hIcon);
+
+ if (pDlg->m_pContainer->m_hIconTaskbarOverlay)
+ Win7Taskbar->setOverlayIcon(m_hwnd, (LPARAM)pDlg->m_pContainer->m_hIconTaskbarOverlay);
+ else if (Win7Taskbar->haveAlwaysGroupingMode() && fForceOverlayIcons)
+ Win7Taskbar->setOverlayIcon(m_hwnd, (LPARAM)hIcon);
+ else
+ Win7Taskbar->clearOverlayIcon(m_hwnd);
+ }
+ return;
+ }
+ }
+
+ // default handling (no win7 taskbar)
+ if (hIcon == PluginConfig.g_buttonBarIcons[ICON_DEFAULT_TYPING]) { // always set typing icon, but don't save it...
+ SendMessage(m_hwnd, WM_SETICON, ICON_BIG, (LPARAM)PluginConfig.g_IconTypingEventBig);
+ SendMessage(m_hwnd, WM_SETICON, ICON_SMALL, (LPARAM)hIcon);
+ return;
+ }
+
+ HICON hIconBig = nullptr;
+ if (hIcon == hIconMsg)
+ hIconBig = Skin_LoadIcon(SKINICON_EVENT_MESSAGE, true);
+
+ if (m_hIcon == STICK_ICON_MSG && hIcon != hIconMsg && m_dwFlags & CNT_NEED_UPDATETITLE) {
+ hIcon = hIconMsg;
+ hIconBig = Skin_LoadIcon(SKINICON_EVENT_MESSAGE, true);
+ }
+ SendMessage(m_hwnd, WM_SETICON, ICON_SMALL, (LPARAM)hIcon);
+ if (nullptr != hIconBig && reinterpret_cast<HICON>(CALLSERVICE_NOTFOUND) != hIconBig)
+ SendMessage(m_hwnd, WM_SETICON, ICON_BIG, LPARAM(hIconBig));
+ m_hIcon = (hIcon == hIconMsg) ? STICK_ICON_MSG : 0;
+}
+
void TContainerData::UpdateTabs()
{
HWND hwndTab = GetDlgItem(m_hwnd, IDC_MSGTABS);
@@ -74,29 +139,31 @@ void TContainerData::UpdateTabs() void TContainerData::UpdateTitle(MCONTACT hContact, CTabBaseDlg *pDlg)
{
- if (pDlg) { // lParam != 0 means sent by a chat window
+ // pDlg != 0 means sent by a chat window
+ if (pDlg) {
wchar_t szText[512];
GetWindowText(pDlg->GetHwnd(), szText, _countof(szText));
szText[_countof(szText) - 1] = 0;
SetWindowText(m_hwnd, szText);
- SendMessage(m_hwnd, DM_SETICON, (WPARAM)pDlg, (LPARAM)(pDlg->m_hTabIcon != pDlg->m_hTabStatusIcon ? pDlg->m_hTabIcon : pDlg->m_hTabStatusIcon));
+ SetIcon(pDlg, (pDlg->m_hTabIcon != pDlg->m_hTabStatusIcon) ? pDlg->m_hTabIcon : pDlg->m_hTabStatusIcon);
return;
}
- CTabBaseDlg *dat = nullptr;
- if (hContact == 0) { // no hContact given - obtain the hContact for the active tab
+ // no hContact given - obtain the hContact for the active tab
+ if (hContact == 0) {
if (m_hwndActive && IsWindow(m_hwndActive))
- dat = (CTabBaseDlg*)GetWindowLongPtr(m_hwndActive, GWLP_USERDATA);
+ pDlg = (CTabBaseDlg*)GetWindowLongPtr(m_hwndActive, GWLP_USERDATA);
}
else {
HWND hwnd = Srmm_FindWindow(hContact);
if (hwnd != nullptr)
- dat = (CTabBaseDlg*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ pDlg = (CTabBaseDlg*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
}
- if (dat) {
- SendMessage(m_hwnd, DM_SETICON, (WPARAM)dat, (LPARAM)(dat->m_hXStatusIcon ? dat->m_hXStatusIcon : dat->m_hTabStatusIcon));
+
+ if (pDlg) {
+ SetIcon(pDlg, pDlg->m_hXStatusIcon ? pDlg->m_hXStatusIcon : pDlg->m_hTabStatusIcon);
CMStringW szTitle;
- if (dat->FormatTitleBar(settings->szTitleFormat, szTitle))
+ if (pDlg->FormatTitleBar(m_pSettings->szTitleFormat, szTitle))
SetWindowText(m_hwnd, szTitle);
}
}
@@ -111,7 +178,7 @@ void TSAPI SetAeroMargins(TContainerData *pContainer) return;
if (!M.isAero() || CSkin::m_skinEnabled) {
- pContainer->MenuBar->setAero(false);
+ pContainer->m_pMenuBar->setAero(false);
return;
}
@@ -130,21 +197,21 @@ void TSAPI SetAeroMargins(TContainerData *pContainer) MARGINS m;
m.cyTopHeight = pt.y;
- pContainer->MenuBar->setAero(true);
+ pContainer->m_pMenuBar->setAero(true);
// bottom part
GetWindowRect(dat->GetHwnd(), &rcWnd);
pt.x = rcWnd.left;
LONG sbar_left, sbar_right;
- if (!pContainer->SideBar->isActive()) {
- pt.y = rcWnd.bottom + ((pContainer->iChilds > 1 || !(pContainer->dwFlags & CNT_HIDETABS)) ? pContainer->tBorder : 0);
+ if (!pContainer->m_pSideBar->isActive()) {
+ pt.y = rcWnd.bottom + ((pContainer->m_iChilds > 1 || !(pContainer->m_dwFlags & CNT_HIDETABS)) ? pContainer->m_tBorder : 0);
sbar_left = 0, sbar_right = 0;
}
else {
pt.y = rcWnd.bottom;
- sbar_left = (pContainer->SideBar->getFlags() & CSideBar::SIDEBARORIENTATION_LEFT ? pContainer->SideBar->getWidth() : 0);
- sbar_right = (pContainer->SideBar->getFlags() & CSideBar::SIDEBARORIENTATION_RIGHT ? pContainer->SideBar->getWidth() : 0);
+ sbar_left = (pContainer->m_pSideBar->getFlags() & CSideBar::SIDEBARORIENTATION_LEFT ? pContainer->m_pSideBar->getWidth() : 0);
+ sbar_right = (pContainer->m_pSideBar->getFlags() & CSideBar::SIDEBARORIENTATION_RIGHT ? pContainer->m_pSideBar->getWidth() : 0);
}
ScreenToClient(pContainer->m_hwnd, &pt);
GetClientRect(pContainer->m_hwnd, &rcWnd);
@@ -153,13 +220,13 @@ void TSAPI SetAeroMargins(TContainerData *pContainer) if (m.cyBottomHeight < 0 || m.cyBottomHeight >= rcWnd.bottom)
m.cyBottomHeight = 0;
- m.cxLeftWidth = pContainer->tBorder_outer_left;
- m.cxRightWidth = pContainer->tBorder_outer_right;
+ m.cxLeftWidth = pContainer->m_tBorder_outer_left;
+ m.cxRightWidth = pContainer->m_tBorder_outer_right;
m.cxLeftWidth += sbar_left;
m.cxRightWidth += sbar_right;
- if (memcmp(&m, &pContainer->mOld, sizeof(MARGINS)) != 0) {
- pContainer->mOld = m;
+ if (memcmp(&m, &pContainer->m_mOld, sizeof(MARGINS)) != 0) {
+ pContainer->m_mOld = m;
CMimAPI::m_pfnDwmExtendFrameIntoClientArea(pContainer->m_hwnd, &m);
}
}
@@ -176,7 +243,7 @@ static LRESULT CALLBACK ContainerWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, HDC dcFrame = GetDCEx(hwndDlg, nullptr, DCX_WINDOW |/*DCX_INTERSECTRGN|*/0x10000); // GetWindowDC(hwndDlg);
LONG clip_top, clip_left;
RECT rcText;
- HDC dcMem = CreateCompatibleDC(pContainer->cachedDC ? pContainer->cachedDC : dcFrame);
+ HDC dcMem = CreateCompatibleDC(pContainer->m_cachedDC ? pContainer->m_cachedDC : dcFrame);
RECT rcWindow, rcClient;
POINT pt, pt1;
@@ -201,7 +268,7 @@ static LRESULT CALLBACK ContainerWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, ExcludeClipRect(dcFrame, clip_left, clip_top, clip_left + (pt1.x - pt.x), clip_top + (pt1.y - pt.y));
ExcludeClipRect(dcMem, clip_left, clip_top, clip_left + (pt1.x - pt.x), clip_top + (pt1.y - pt.y));
- CSkin::DrawItem(dcMem, &rcWindow, &SkinItems[pContainer->ncActive ? ID_EXTBKFRAME : ID_EXTBKFRAMEINACTIVE]);
+ CSkin::DrawItem(dcMem, &rcWindow, &SkinItems[pContainer->m_ncActive ? ID_EXTBKFRAME : ID_EXTBKFRAMEINACTIVE]);
wchar_t szWindowText[512];
GetWindowText(hwndDlg, szWindowText, _countof(szWindowText));
@@ -226,17 +293,17 @@ static LRESULT CALLBACK ContainerWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, DrawIconEx(dcMem, 4 + CSkin::m_SkinnedFrame_left + CSkin::m_bClipBorder + CSkin::m_titleBarLeftOff, rcText.top + (rcText.bottom - rcText.top) / 2 - 8, hIcon, 16, 16, 0, nullptr, DI_NORMAL);
// title buttons
- pContainer->rcClose.top = pContainer->rcMin.top = pContainer->rcMax.top = CSkin::m_titleButtonTopOff;
- pContainer->rcClose.bottom = pContainer->rcMin.bottom = pContainer->rcMax.bottom = CSkin::m_titleButtonTopOff + CSkin::m_titleBarButtonSize.cy;
+ pContainer->m_rcClose.top = pContainer->m_rcMin.top = pContainer->m_rcMax.top = CSkin::m_titleButtonTopOff;
+ pContainer->m_rcClose.bottom = pContainer->m_rcMin.bottom = pContainer->m_rcMax.bottom = CSkin::m_titleButtonTopOff + CSkin::m_titleBarButtonSize.cy;
- pContainer->rcClose.right = rcWindow.right - 10 - CSkin::m_titleBarRightOff;
- pContainer->rcClose.left = pContainer->rcClose.right - CSkin::m_titleBarButtonSize.cx;
+ pContainer->m_rcClose.right = rcWindow.right - 10 - CSkin::m_titleBarRightOff;
+ pContainer->m_rcClose.left = pContainer->m_rcClose.right - CSkin::m_titleBarButtonSize.cx;
- pContainer->rcMax.right = pContainer->rcClose.left - 2;
- pContainer->rcMax.left = pContainer->rcMax.right - CSkin::m_titleBarButtonSize.cx;
+ pContainer->m_rcMax.right = pContainer->m_rcClose.left - 2;
+ pContainer->m_rcMax.left = pContainer->m_rcMax.right - CSkin::m_titleBarButtonSize.cx;
- pContainer->rcMin.right = pContainer->rcMax.left - 2;
- pContainer->rcMin.left = pContainer->rcMin.right - CSkin::m_titleBarButtonSize.cx;
+ pContainer->m_rcMin.right = pContainer->m_rcMax.left - 2;
+ pContainer->m_rcMin.left = pContainer->m_rcMin.right - CSkin::m_titleBarButtonSize.cx;
CSkinItem *item_normal = &SkinItems[ID_EXTBKTITLEBUTTON];
CSkinItem *item_hot = &SkinItems[ID_EXTBKTITLEBUTTONMOUSEOVER];
@@ -247,20 +314,20 @@ static LRESULT CALLBACK ContainerWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, switch (i) {
case 0:
- pRect = &pContainer->rcMin;
+ pRect = &pContainer->m_rcMin;
hIcon = CSkin::m_minIcon;
break;
case 1:
- pRect = &pContainer->rcMax;
+ pRect = &pContainer->m_rcMax;
hIcon = CSkin::m_maxIcon;
break;
case 2:
- pRect = &pContainer->rcClose;
+ pRect = &pContainer->m_rcClose;
hIcon = CSkin::m_closeIcon;
break;
}
if (pRect) {
- CSkinItem *item = pContainer->buttons[i].isPressed ? item_pressed : (pContainer->buttons[i].isHot ? item_hot : item_normal);
+ CSkinItem *item = pContainer->m_buttons[i].isPressed ? item_pressed : (pContainer->m_buttons[i].isHot ? item_hot : item_normal);
CSkin::DrawItem(dcMem, pRect, item);
DrawIconEx(dcMem, pRect->left + ((pRect->right - pRect->left) / 2 - 8), pRect->top + ((pRect->bottom - pRect->top) / 2 - 8), hIcon, 16, 16, 0, nullptr, DI_NORMAL);
}
@@ -281,24 +348,24 @@ static LRESULT CALLBACK ContainerWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, GetClientRect(hwndDlg, &rcClient);
int width = rcClient.right - rcClient.left;
int height = rcClient.bottom - rcClient.top;
- if (width != pContainer->oldDCSize.cx || height != pContainer->oldDCSize.cy) {
+ if (width != pContainer->m_oldDCSize.cx || height != pContainer->m_oldDCSize.cy) {
CSkinItem *sbaritem = &SkinItems[ID_EXTBKSTATUSBAR];
- BOOL statusBarSkinnd = !(pContainer->dwFlags & CNT_NOSTATUSBAR) && !sbaritem->IGNORED;
- LONG sbarDelta = statusBarSkinnd ? pContainer->statusBarHeight : 0;
+ BOOL statusBarSkinnd = !(pContainer->m_dwFlags & CNT_NOSTATUSBAR) && !sbaritem->IGNORED;
+ LONG sbarDelta = statusBarSkinnd ? pContainer->m_statusBarHeight : 0;
- pContainer->oldDCSize.cx = width;
- pContainer->oldDCSize.cy = height;
+ pContainer->m_oldDCSize.cx = width;
+ pContainer->m_oldDCSize.cy = height;
- if (pContainer->cachedDC) {
- SelectObject(pContainer->cachedDC, pContainer->oldHBM);
- DeleteObject(pContainer->cachedHBM);
- DeleteDC(pContainer->cachedDC);
+ if (pContainer->m_cachedDC) {
+ SelectObject(pContainer->m_cachedDC, pContainer->m_oldHBM);
+ DeleteObject(pContainer->m_cachedHBM);
+ DeleteDC(pContainer->m_cachedDC);
}
- pContainer->cachedDC = CreateCompatibleDC(hdcReal);
- pContainer->cachedHBM = CreateCompatibleBitmap(hdcReal, width, height);
- pContainer->oldHBM = (HBITMAP)SelectObject(pContainer->cachedDC, pContainer->cachedHBM);
+ pContainer->m_cachedDC = CreateCompatibleDC(hdcReal);
+ pContainer->m_cachedHBM = CreateCompatibleBitmap(hdcReal, width, height);
+ pContainer->m_oldHBM = (HBITMAP)SelectObject(pContainer->m_cachedDC, pContainer->m_cachedHBM);
- HDC hdc = pContainer->cachedDC;
+ HDC hdc = pContainer->m_cachedDC;
if (!CSkin::DrawItem(hdc, &rcClient, &SkinItems[0]))
FillRect(hdc, &rcClient, GetSysColorBrush(COLOR_3DFACE));
@@ -307,7 +374,7 @@ static LRESULT CALLBACK ContainerWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, CSkin::DrawItem(hdc, &rcClient, sbaritem);
}
}
- BitBlt(hdcReal, 0, 0, width, height, pContainer->cachedDC, 0, 0, SRCCOPY);
+ BitBlt(hdcReal, 0, 0, width, height, pContainer->m_cachedDC, 0, 0, SRCCOPY);
EndPaint(hwndDlg, &ps);
return 0;
}
@@ -324,34 +391,34 @@ static LRESULT CALLBACK ContainerWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, RECT rcWindow;
GetWindowRect(hwndDlg, &rcWindow);
- memcpy(&pContainer->oldbuttons[0], &pContainer->buttons[0], sizeof(TitleBtn) * 3);
- memset(&pContainer->buttons[0], 0, (sizeof(TitleBtn) * 3));
+ memcpy(&pContainer->m_oldbuttons[0], &pContainer->m_buttons[0], sizeof(TitleBtn) * 3);
+ memset(&pContainer->m_buttons[0], 0, (sizeof(TitleBtn) * 3));
- if (pt.x >= (rcWindow.left + pContainer->rcMin.left) && pt.x <= (rcWindow.left + pContainer->rcClose.right) && pt.y < rcWindow.top + 24 && wParam != HTTOPRIGHT) {
+ if (pt.x >= (rcWindow.left + pContainer->m_rcMin.left) && pt.x <= (rcWindow.left + pContainer->m_rcClose.right) && pt.y < rcWindow.top + 24 && wParam != HTTOPRIGHT) {
LRESULT result = 0; //DefWindowProc(hwndDlg, msg, wParam, lParam);
HDC hdc = GetWindowDC(hwndDlg);
LONG left = rcWindow.left;
pt.y = 10;
- bool isMin = pt.x >= left + pContainer->rcMin.left && pt.x <= left + pContainer->rcMin.right;
- bool isMax = pt.x >= left + pContainer->rcMax.left && pt.x <= left + pContainer->rcMax.right;
- bool isClose = pt.x >= left + pContainer->rcClose.left && pt.x <= left + pContainer->rcClose.right;
+ bool isMin = pt.x >= left + pContainer->m_rcMin.left && pt.x <= left + pContainer->m_rcMin.right;
+ bool isMax = pt.x >= left + pContainer->m_rcMax.left && pt.x <= left + pContainer->m_rcMax.right;
+ bool isClose = pt.x >= left + pContainer->m_rcClose.left && pt.x <= left + pContainer->m_rcClose.right;
if (msg == WM_NCMOUSEMOVE) {
if (isMax)
- pContainer->buttons[BTN_MAX].isHot = TRUE;
+ pContainer->m_buttons[BTN_MAX].isHot = TRUE;
else if (isMin)
- pContainer->buttons[BTN_MIN].isHot = TRUE;
+ pContainer->m_buttons[BTN_MIN].isHot = TRUE;
else if (isClose)
- pContainer->buttons[BTN_CLOSE].isHot = TRUE;
+ pContainer->m_buttons[BTN_CLOSE].isHot = TRUE;
}
else if (msg == WM_NCLBUTTONDOWN) {
if (isMax)
- pContainer->buttons[BTN_MAX].isPressed = TRUE;
+ pContainer->m_buttons[BTN_MAX].isPressed = TRUE;
else if (isMin)
- pContainer->buttons[BTN_MIN].isPressed = TRUE;
+ pContainer->m_buttons[BTN_MIN].isPressed = TRUE;
else if (isClose)
- pContainer->buttons[BTN_CLOSE].isPressed = TRUE;
+ pContainer->m_buttons[BTN_CLOSE].isPressed = TRUE;
}
else if (msg == WM_NCLBUTTONUP) {
if (isMin)
@@ -366,28 +433,28 @@ static LRESULT CALLBACK ContainerWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, PostMessage(hwndDlg, WM_SYSCOMMAND, SC_CLOSE, 0);
}
for (int i = 0; i < 3; i++) {
- if (pContainer->buttons[i].isHot != pContainer->oldbuttons[i].isHot) {
+ if (pContainer->m_buttons[i].isHot != pContainer->m_oldbuttons[i].isHot) {
RECT *rc;
HICON hIcon;
switch (i) {
case 0:
- rc = &pContainer->rcMin;
+ rc = &pContainer->m_rcMin;
hIcon = CSkin::m_minIcon;
break;
case 1:
- rc = &pContainer->rcMax;
+ rc = &pContainer->m_rcMax;
hIcon = CSkin::m_maxIcon;
break;
case 2:
- rc = &pContainer->rcClose;
+ rc = &pContainer->m_rcClose;
hIcon = CSkin::m_closeIcon;
break;
default:
continue; // shall never happen
}
if (rc) {
- CSkinItem *item = &SkinItems[pContainer->buttons[i].isPressed ? ID_EXTBKTITLEBUTTONPRESSED : (pContainer->buttons[i].isHot ? ID_EXTBKTITLEBUTTONMOUSEOVER : ID_EXTBKTITLEBUTTON)];
+ CSkinItem *item = &SkinItems[pContainer->m_buttons[i].isPressed ? ID_EXTBKTITLEBUTTONPRESSED : (pContainer->m_buttons[i].isHot ? ID_EXTBKTITLEBUTTONMOUSEOVER : ID_EXTBKTITLEBUTTON)];
CSkin::DrawItem(hdc, rc, item);
DrawIconEx(hdc, rc->left + ((rc->right - rc->left) / 2 - 8), rc->top + ((rc->bottom - rc->top) / 2 - 8), hIcon, 16, 16, 0, nullptr, DI_NORMAL);
}
@@ -432,7 +499,7 @@ static LRESULT CALLBACK ContainerWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, case WM_NCACTIVATE:
if (pContainer) {
- pContainer->ncActive = wParam;
+ pContainer->m_ncActive = wParam;
if (bSkinned && CSkin::m_frameSkins) {
SendMessage(hwndDlg, WM_NCPAINT, 0, 0);
return 1;
@@ -450,7 +517,7 @@ static LRESULT CALLBACK ContainerWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, break;
case WM_NCHITTEST:
- if (pContainer && (pContainer->dwFlags & CNT_NOTITLE)) {
+ if (pContainer && (pContainer->m_dwFlags & CNT_NOTITLE)) {
RECT r;
GetWindowRect(hwndDlg, &r);
@@ -482,10 +549,10 @@ static LRESULT CALLBACK ContainerWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, break;
case WM_TIMER:
- if (wParam == (WPARAM)pContainer && pContainer->hwndStatus) {
+ if (wParam == (WPARAM)pContainer && pContainer->m_hwndStatus) {
SendMessage(pContainer->m_hwnd, WM_SIZE, 0, 0);
- SendMessage(pContainer->hwndStatus, SB_SETTEXT, (WPARAM)(SBT_OWNERDRAW) | 2, 0);
- InvalidateRect(pContainer->hwndStatus, nullptr, TRUE);
+ SendMessage(pContainer->m_hwndStatus, SB_SETTEXT, (WPARAM)(SBT_OWNERDRAW) | 2, 0);
+ InvalidateRect(pContainer->m_hwndStatus, nullptr, TRUE);
KillTimer(hwndDlg, wParam);
}
break;
@@ -524,21 +591,21 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam, pContainer->m_hwnd = hwndDlg;
{
- DWORD dwCreateFlags = pContainer->dwFlags;
- pContainer->isCloned = (dwCreateFlags & CNT_CREATE_CLONED);
- pContainer->fPrivateThemeChanged = FALSE;
+ DWORD dwCreateFlags = pContainer->m_dwFlags;
+ pContainer->m_isCloned = (dwCreateFlags & CNT_CREATE_CLONED);
+ pContainer->m_fPrivateThemeChanged = FALSE;
SendMessage(hwndDlg, DM_OPTIONSAPPLIED, 0, 0); // set options...
- pContainer->dwFlags |= dwCreateFlags;
+ pContainer->m_dwFlags |= dwCreateFlags;
LoadOverrideTheme(pContainer);
DWORD ws = GetWindowLongPtr(hwndTab, GWL_STYLE);
- if (pContainer->dwFlagsEx & TCF_FLAT)
+ if (pContainer->m_dwFlagsEx & TCF_FLAT)
ws |= TCS_BUTTONS;
pContainer->ClearMargins();
- if (pContainer->dwFlagsEx & TCF_SINGLEROWTABCONTROL) {
+ if (pContainer->m_dwFlagsEx & TCF_SINGLEROWTABCONTROL) {
ws &= ~TCS_MULTILINE;
ws |= TCS_SINGLELINE;
ws |= TCS_FIXEDWIDTH;
@@ -551,13 +618,13 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam, }
SetWindowLongPtr(hwndTab, GWL_STYLE, ws);
- pContainer->buttonItems = g_ButtonSet.items;
+ pContainer->m_buttonItems = g_ButtonSet.items;
- pContainer->dwFlags = ((pContainer->dwFlagsEx & (TCF_SBARLEFT | TCF_SBARRIGHT)) ?
- pContainer->dwFlags | CNT_SIDEBAR : pContainer->dwFlags & ~CNT_SIDEBAR);
+ pContainer->m_dwFlags = ((pContainer->m_dwFlagsEx & (TCF_SBARLEFT | TCF_SBARRIGHT)) ?
+ pContainer->m_dwFlags | CNT_SIDEBAR : pContainer->m_dwFlags & ~CNT_SIDEBAR);
- pContainer->SideBar = new CSideBar(pContainer);
- pContainer->MenuBar = new CMenuBar(hwndDlg, pContainer);
+ pContainer->m_pSideBar = new CSideBar(pContainer);
+ pContainer->m_pMenuBar = new CMenuBar(hwndDlg, pContainer);
SetClassLongPtr(hwndDlg, GCL_STYLE, GetClassLongPtr(hwndDlg, GCL_STYLE) & ~(CS_VREDRAW | CS_HREDRAW));
SetClassLongPtr(hwndTab, GCL_STYLE, GetClassLongPtr(hwndTab, GCL_STYLE) & ~(CS_VREDRAW | CS_HREDRAW));
@@ -582,11 +649,11 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam, ws = GetWindowLongPtr(hwndTab, GWL_EXSTYLE);
SetWindowLongPtr(hwndTab, GWL_EXSTYLE, ws | WS_EX_CONTROLPARENT);
- LONG x_pad = M.GetByte("x-pad", 3) + (pContainer->dwFlagsEx & TCF_CLOSEBUTTON ? 7 : 0);
- LONG y_pad = M.GetByte("y-pad", 3) + ((pContainer->dwFlags & CNT_TABSBOTTOM) ? 1 : 0);
+ LONG x_pad = M.GetByte("x-pad", 3) + (pContainer->m_dwFlagsEx & TCF_CLOSEBUTTON ? 7 : 0);
+ LONG y_pad = M.GetByte("y-pad", 3) + ((pContainer->m_dwFlags & CNT_TABSBOTTOM) ? 1 : 0);
- if (pContainer->dwFlagsEx & TCF_FLAT)
- y_pad++; //(pContainer->dwFlags & CNT_TABSBOTTOM ? 1 : 2);
+ if (pContainer->m_dwFlagsEx & TCF_FLAT)
+ y_pad++; //(pContainer->m_dwFlags & CNT_TABSBOTTOM ? 1 : 2);
TabCtrl_SetPadding(hwndTab, x_pad, y_pad);
@@ -606,19 +673,19 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam, }
else pContainer->m_hwndTip = nullptr;
- if (pContainer->dwFlags & CNT_CREATE_MINIMIZED) {
+ 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);
- //GetClientRect(hwndDlg, &pContainer->rcSaved);
+ //GetClientRect(hwndDlg, &pContainer->m_rcSaved);
ShowWindow(hwndDlg, SW_SHOWMINNOACTIVE);
GetWindowPlacement(hwndDlg, &wp);
- pContainer->rcSaved.left = pContainer->rcSaved.top = 0;
- pContainer->rcSaved.right = wp.rcNormalPosition.right - wp.rcNormalPosition.left;
- pContainer->rcSaved.bottom = wp.rcNormalPosition.bottom - wp.rcNormalPosition.top;
+ 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);
@@ -635,23 +702,23 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam, case DM_RESTOREWINDOWPOS:
// retrieve the container window geometry information from the database.
- if (pContainer->isCloned && pContainer->hContactFrom != 0 && !(pContainer->dwFlags & CNT_GLOBALSIZE)) {
- if (Utils_RestoreWindowPosition(hwndDlg, pContainer->hContactFrom, SRMSGMOD_T, "split")) {
- if (Utils_RestoreWindowPositionNoMove(hwndDlg, pContainer->hContactFrom, SRMSGMOD_T, "split"))
+ 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->dwFlags & CNT_GLOBALSIZE) {
+ 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->iContainerIndex);
+ 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"))
@@ -664,51 +731,51 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam, case WM_SIZE:
if (IsIconic(hwndDlg))
- pContainer->dwFlags |= CNT_DEFERREDSIZEREQUEST;
+ pContainer->m_dwFlags |= CNT_DEFERREDSIZEREQUEST;
else {
RECT rcClient, rcUnadjusted;
GetClientRect(hwndDlg, &rcClient);
- pContainer->MenuBar->getClientRect();
+ pContainer->m_pMenuBar->getClientRect();
- if (pContainer->hwndStatus) {
+ if (pContainer->m_hwndStatus) {
dat = (CTabBaseDlg*)GetWindowLongPtr(pContainer->m_hwndActive, GWLP_USERDATA);
- SendMessage(pContainer->hwndStatus, WM_USER + 101, 0, (LPARAM)dat);
+ SendMessage(pContainer->m_hwndStatus, WM_USER + 101, 0, (LPARAM)dat);
RECT rcs;
- GetWindowRect(pContainer->hwndStatus, &rcs);
- pContainer->statusBarHeight = (rcs.bottom - rcs.top) + 1;
- SendMessage(pContainer->hwndStatus, SB_SETTEXT, (WPARAM)(SBT_OWNERDRAW) | 2, 0);
+ GetWindowRect(pContainer->m_hwndStatus, &rcs);
+ pContainer->m_statusBarHeight = (rcs.bottom - rcs.top) + 1;
+ SendMessage(pContainer->m_hwndStatus, SB_SETTEXT, (WPARAM)(SBT_OWNERDRAW) | 2, 0);
}
- else pContainer->statusBarHeight = 0;
+ else pContainer->m_statusBarHeight = 0;
- CopyRect(&pContainer->rcSaved, &rcClient);
+ CopyRect(&pContainer->m_rcSaved, &rcClient);
rcUnadjusted = rcClient;
- pContainer->MenuBar->Resize(LOWORD(lParam));
- LONG rebarHeight = pContainer->MenuBar->getHeight();
- pContainer->MenuBar->Show((pContainer->dwFlags & CNT_NOMENUBAR) ? SW_HIDE : SW_SHOW);
+ pContainer->m_pMenuBar->Resize(LOWORD(lParam));
+ LONG rebarHeight = pContainer->m_pMenuBar->getHeight();
+ pContainer->m_pMenuBar->Show((pContainer->m_dwFlags & CNT_NOMENUBAR) ? SW_HIDE : SW_SHOW);
- LONG sbarWidth = pContainer->SideBar->getWidth();
- LONG sbarWidth_left = pContainer->SideBar->getFlags() & CSideBar::SIDEBARORIENTATION_LEFT ? sbarWidth : 0;
+ LONG sbarWidth = pContainer->m_pSideBar->getWidth();
+ LONG sbarWidth_left = pContainer->m_pSideBar->getFlags() & CSideBar::SIDEBARORIENTATION_LEFT ? sbarWidth : 0;
if (lParam) {
DWORD dwSWPFlags = SWP_NOACTIVATE | SWP_NOZORDER | SWP_DEFERERASE | SWP_NOCOPYBITS; // | SWP_NOSENDCHANGING | SWP_ASYNCWINDOWPOS;
- SetWindowPos(hwndTab, nullptr, pContainer->tBorder_outer_left + sbarWidth_left, pContainer->tBorder_outer_top + rebarHeight,
- (rcClient.right - rcClient.left) - (pContainer->tBorder_outer_left + pContainer->tBorder_outer_right + sbarWidth),
- (rcClient.bottom - rcClient.top) - pContainer->statusBarHeight - (pContainer->tBorder_outer_top + pContainer->tBorder_outer_bottom) - rebarHeight, dwSWPFlags);
+ SetWindowPos(hwndTab, nullptr, pContainer->m_tBorder_outer_left + sbarWidth_left, pContainer->m_tBorder_outer_top + rebarHeight,
+ (rcClient.right - rcClient.left) - (pContainer->m_tBorder_outer_left + pContainer->m_tBorder_outer_right + sbarWidth),
+ (rcClient.bottom - rcClient.top) - pContainer->m_statusBarHeight - (pContainer->m_tBorder_outer_top + pContainer->m_tBorder_outer_bottom) - rebarHeight, dwSWPFlags);
}
- pContainer->SideBar->resizeScrollWnd(sbarWidth_left ? pContainer->tBorder_outer_left : rcClient.right - pContainer->tBorder_outer_right - (sbarWidth - 2),
- pContainer->tBorder_outer_top + rebarHeight, 0,
- (rcClient.bottom - rcClient.top) - pContainer->statusBarHeight - (pContainer->tBorder_outer_top + pContainer->tBorder_outer_bottom) - rebarHeight);
+ pContainer->m_pSideBar->resizeScrollWnd(sbarWidth_left ? pContainer->m_tBorder_outer_left : rcClient.right - pContainer->m_tBorder_outer_right - (sbarWidth - 2),
+ pContainer->m_tBorder_outer_top + rebarHeight, 0,
+ (rcClient.bottom - rcClient.top) - pContainer->m_statusBarHeight - (pContainer->m_tBorder_outer_top + pContainer->m_tBorder_outer_bottom) - rebarHeight);
AdjustTabClientRect(pContainer, &rcClient);
- BOOL sizeChanged = (((rcClient.right - rcClient.left) != pContainer->preSIZE.cx) || ((rcClient.bottom - rcClient.top) != pContainer->preSIZE.cy));
+ BOOL sizeChanged = (((rcClient.right - rcClient.left) != pContainer->m_preSIZE.cx) || ((rcClient.bottom - rcClient.top) != pContainer->m_preSIZE.cy));
if (sizeChanged) {
- pContainer->preSIZE.cx = rcClient.right - rcClient.left;
- pContainer->preSIZE.cy = rcClient.bottom - rcClient.top;
+ pContainer->m_preSIZE.cx = rcClient.right - rcClient.left;
+ pContainer->m_preSIZE.cy = rcClient.bottom - rcClient.top;
}
// we care about all client sessions, but we really resize only the active tab (hwndActive)
@@ -721,7 +788,7 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam, if (hDlg == pContainer->m_hwndActive) {
SetWindowPos(hDlg, nullptr, rcClient.left, rcClient.top, (rcClient.right - rcClient.left), (rcClient.bottom - rcClient.top),
SWP_NOSENDCHANGING | SWP_NOACTIVATE/*|SWP_NOCOPYBITS*/);
- if (!pContainer->bSizingLoop && sizeChanged) {
+ if (!pContainer->m_bSizingLoop && sizeChanged) {
dat = (CTabBaseDlg*)GetWindowLongPtr(pContainer->m_hwndActive, GWLP_USERDATA);
if (dat)
dat->DM_ScrollToBottom(0, 1);
@@ -730,15 +797,15 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam, else if (sizeChanged)
SendMessage(hDlg, DM_CHECKSIZE, 0, 0);
}
- pContainer->SideBar->scrollIntoView();
+ pContainer->m_pSideBar->scrollIntoView();
if (!M.isAero()) { // aero mode uses buffered paint, no forced redraw needed
- RedrawWindow(hwndTab, nullptr, nullptr, RDW_INVALIDATE | (pContainer->bSizingLoop ? RDW_ERASE : 0));
- RedrawWindow(hwndDlg, nullptr, nullptr, (bSkinned ? RDW_FRAME : 0) | RDW_INVALIDATE | ((pContainer->bSizingLoop || wParam == SIZE_RESTORED) ? RDW_ERASE : 0));
+ RedrawWindow(hwndTab, nullptr, nullptr, RDW_INVALIDATE | (pContainer->m_bSizingLoop ? RDW_ERASE : 0));
+ RedrawWindow(hwndDlg, nullptr, nullptr, (bSkinned ? RDW_FRAME : 0) | RDW_INVALIDATE | ((pContainer->m_bSizingLoop || wParam == SIZE_RESTORED) ? RDW_ERASE : 0));
}
- if (pContainer->hwndStatus)
- InvalidateRect(pContainer->hwndStatus, nullptr, FALSE);
+ if (pContainer->m_hwndStatus)
+ InvalidateRect(pContainer->m_hwndStatus, nullptr, FALSE);
if ((CSkin::m_bClipBorder != 0 || CSkin::m_bRoundedCorner) && CSkin::m_frameSkins) {
HRGN rgn;
@@ -762,15 +829,15 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam, case WM_NOTIFY:
if (pContainer == nullptr)
break;
- if (pContainer->MenuBar) {
- LRESULT processed = pContainer->MenuBar->processMsg(msg, wParam, lParam);
+ if (pContainer->m_pMenuBar) {
+ LRESULT processed = pContainer->m_pMenuBar->processMsg(msg, wParam, lParam);
if (processed != -1) {
SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, processed);
return(processed);
}
}
- if (pContainer->hwndStatus != nullptr && ((LPNMHDR)lParam)->hwndFrom == pContainer->hwndStatus) {
+ if (pContainer->m_hwndStatus != nullptr && ((LPNMHDR)lParam)->hwndFrom == pContainer->m_hwndStatus) {
switch (((LPNMHDR)lParam)->code) {
case NM_CLICK:
case NM_RCLICK:
@@ -778,7 +845,7 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam, int nPanel;
if (nm->dwItemSpec == 0xFFFFFFFE) {
nPanel = 2;
- SendMessage(pContainer->hwndStatus, SB_GETRECT, nPanel, (LPARAM)&rc);
+ SendMessage(pContainer->m_hwndStatus, SB_GETRECT, nPanel, (LPARAM)&rc);
if (nm->pt.x > rc.left && nm->pt.x < rc.right)
goto panel_found;
else
@@ -788,7 +855,7 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam, panel_found:
if (nPanel == 2) {
dat = (CTabBaseDlg*)GetWindowLongPtr(pContainer->m_hwndActive, GWLP_USERDATA);
- SendMessage(pContainer->hwndStatus, SB_GETRECT, nPanel, (LPARAM)&rc);
+ SendMessage(pContainer->m_hwndStatus, SB_GETRECT, nPanel, (LPARAM)&rc);
if (dat)
dat->CheckStatusIconClick(nm->pt, rc, 2, ((LPNMHDR)lParam)->code);
}
@@ -894,7 +961,7 @@ panel_found: CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_SELECTCONTAINER), hwndDlg, SelectContainerDlgProc, (LPARAM)hDlg);
break;
case ID_TABMENU_CONTAINEROPTIONS:
- if (pContainer->hWndOptions == nullptr)
+ if (pContainer->m_hWndOptions == nullptr)
CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_CONTAINEROPTIONS), hwndDlg, DlgProcContainerOptions, (LPARAM)pContainer);
break;
case ID_TABMENU_CLOSECONTAINER:
@@ -908,12 +975,12 @@ panel_found: case WM_COMMAND:
{
- bool fProcessContactMenu = pContainer->MenuBar->isContactMenu();
- bool fProcessMainMenu = pContainer->MenuBar->isMainMenu();
- pContainer->MenuBar->Cancel();
+ bool fProcessContactMenu = pContainer->m_pMenuBar->isContactMenu();
+ bool fProcessMainMenu = pContainer->m_pMenuBar->isMainMenu();
+ pContainer->m_pMenuBar->Cancel();
dat = (CTabBaseDlg*)GetWindowLongPtr(pContainer->m_hwndActive, GWLP_USERDATA);
- DWORD dwOldFlags = pContainer->dwFlags;
+ DWORD dwOldFlags = pContainer->m_dwFlags;
if (dat) {
if (fProcessContactMenu)
@@ -932,18 +999,18 @@ panel_found: GetWindowRect(hwndDlg, &rc);
{
LONG dwNewLeft;
- bool fVisible = pContainer->SideBar->isVisible();
+ bool fVisible = pContainer->m_pSideBar->isVisible();
if (fVisible) {
- dwNewLeft = pContainer->SideBar->getWidth();
- pContainer->SideBar->setVisible(false);
+ dwNewLeft = pContainer->m_pSideBar->getWidth();
+ pContainer->m_pSideBar->setVisible(false);
}
else {
- pContainer->SideBar->setVisible(true);
- dwNewLeft = -(pContainer->SideBar->getWidth());
+ pContainer->m_pSideBar->setVisible(true);
+ dwNewLeft = -(pContainer->m_pSideBar->getWidth());
}
- pContainer->preSIZE.cx = pContainer->preSIZE.cy = 0;
- pContainer->oldDCSize.cx = pContainer->oldDCSize.cy = 0;
+ pContainer->m_preSIZE.cx = pContainer->m_preSIZE.cy = 0;
+ pContainer->m_oldDCSize.cx = pContainer->m_oldDCSize.cy = 0;
}
PostMessage(hwndDlg, WM_SIZE, 0, 1);
@@ -953,7 +1020,7 @@ panel_found: case IDC_SIDEBARUP:
{
HWND hwnd = GetFocus();
- pContainer->SideBar->processScrollerButtons(LOWORD(wParam));
+ pContainer->m_pSideBar->processScrollerButtons(LOWORD(wParam));
SetFocus(hwnd);
}
break;
@@ -988,33 +1055,33 @@ panel_found: break;
case ID_VIEW_SHOWSTATUSBAR:
- ApplyContainerSetting(pContainer, CNT_NOSTATUSBAR, pContainer->dwFlags & CNT_NOSTATUSBAR ? 0 : 1, true);
+ ApplyContainerSetting(pContainer, CNT_NOSTATUSBAR, pContainer->m_dwFlags & CNT_NOSTATUSBAR ? 0 : 1, true);
break;
case ID_VIEW_VERTICALMAXIMIZE:
- ApplyContainerSetting(pContainer, CNT_VERTICALMAX, pContainer->dwFlags & CNT_VERTICALMAX ? 0 : 1, false);
+ ApplyContainerSetting(pContainer, CNT_VERTICALMAX, pContainer->m_dwFlags & CNT_VERTICALMAX ? 0 : 1, false);
break;
case ID_VIEW_BOTTOMTOOLBAR:
- ApplyContainerSetting(pContainer, CNT_BOTTOMTOOLBAR, pContainer->dwFlags & CNT_BOTTOMTOOLBAR ? 0 : 1, false);
+ ApplyContainerSetting(pContainer, CNT_BOTTOMTOOLBAR, pContainer->m_dwFlags & CNT_BOTTOMTOOLBAR ? 0 : 1, false);
Srmm_Broadcast(DM_CONFIGURETOOLBAR, 0, 1);
return 0;
case ID_VIEW_SHOWTOOLBAR:
- ApplyContainerSetting(pContainer, CNT_HIDETOOLBAR, pContainer->dwFlags & CNT_HIDETOOLBAR ? 0 : 1, false);
+ ApplyContainerSetting(pContainer, CNT_HIDETOOLBAR, pContainer->m_dwFlags & CNT_HIDETOOLBAR ? 0 : 1, false);
Srmm_Broadcast(DM_CONFIGURETOOLBAR, 0, 1);
return 0;
case ID_VIEW_SHOWMENUBAR:
- ApplyContainerSetting(pContainer, CNT_NOMENUBAR, pContainer->dwFlags & CNT_NOMENUBAR ? 0 : 1, true);
+ ApplyContainerSetting(pContainer, CNT_NOMENUBAR, pContainer->m_dwFlags & CNT_NOMENUBAR ? 0 : 1, true);
break;
case ID_VIEW_SHOWTITLEBAR:
- ApplyContainerSetting(pContainer, CNT_NOTITLE, pContainer->dwFlags & CNT_NOTITLE ? 0 : 1, true);
+ ApplyContainerSetting(pContainer, CNT_NOTITLE, pContainer->m_dwFlags & CNT_NOTITLE ? 0 : 1, true);
break;
case ID_VIEW_TABSATBOTTOM:
- ApplyContainerSetting(pContainer, CNT_TABSBOTTOM, pContainer->dwFlags & CNT_TABSBOTTOM ? 0 : 1, false);
+ ApplyContainerSetting(pContainer, CNT_TABSBOTTOM, pContainer->m_dwFlags & CNT_TABSBOTTOM ? 0 : 1, false);
break;
case ID_VIEW_SHOWMULTISENDCONTACTLIST:
@@ -1034,19 +1101,19 @@ panel_found: return 0;
case ID_EVENTPOPUPS_SHOWPOPUPSIFWINDOWISMINIMIZED:
- ApplyContainerSetting(pContainer, CNT_DONTREPORT, pContainer->dwFlags & CNT_DONTREPORT ? 0 : 1, false);
+ ApplyContainerSetting(pContainer, CNT_DONTREPORT, pContainer->m_dwFlags & CNT_DONTREPORT ? 0 : 1, false);
return 0;
case ID_EVENTPOPUPS_SHOWPOPUPSIFWINDOWISUNFOCUSED:
- ApplyContainerSetting(pContainer, CNT_DONTREPORTUNFOCUSED, pContainer->dwFlags & CNT_DONTREPORTUNFOCUSED ? 0 : 1, false);
+ ApplyContainerSetting(pContainer, CNT_DONTREPORTUNFOCUSED, pContainer->m_dwFlags & CNT_DONTREPORTUNFOCUSED ? 0 : 1, false);
return 0;
case ID_EVENTPOPUPS_SHOWPOPUPSIFWINDOWISFOCUSED:
- ApplyContainerSetting(pContainer, CNT_DONTREPORTFOCUSED, pContainer->dwFlags & CNT_DONTREPORTFOCUSED ? 0 : 1, false);
+ ApplyContainerSetting(pContainer, CNT_DONTREPORTFOCUSED, pContainer->m_dwFlags & CNT_DONTREPORTFOCUSED ? 0 : 1, false);
return 0;
case ID_EVENTPOPUPS_SHOWPOPUPSFORALLINACTIVESESSIONS:
- ApplyContainerSetting(pContainer, CNT_ALWAYSREPORTINACTIVE, pContainer->dwFlags & CNT_ALWAYSREPORTINACTIVE ? 0 : 1, false);
+ ApplyContainerSetting(pContainer, CNT_ALWAYSREPORTINACTIVE, pContainer->m_dwFlags & CNT_ALWAYSREPORTINACTIVE ? 0 : 1, false);
return 0;
case ID_WINDOWFLASHING_DISABLEFLASHING:
@@ -1096,7 +1163,7 @@ panel_found: break;
}
- if (pContainer->dwFlags != dwOldFlags)
+ if (pContainer->m_dwFlags != dwOldFlags)
SendMessage(hwndDlg, DM_CONFIGURECONTAINER, 0, 0);
}
break;
@@ -1107,20 +1174,20 @@ panel_found: SIZE sz;
sz.cx = rc.right - rc.left;
sz.cy = rc.bottom - rc.top;
- pContainer->oldSize = sz;
- pContainer->bSizingLoop = TRUE;
+ pContainer->m_oldSize = sz;
+ pContainer->m_bSizingLoop = TRUE;
}
break;
case WM_EXITSIZEMOVE:
GetClientRect(hwndTab, &rc);
- if (!((rc.right - rc.left) == pContainer->oldSize.cx && (rc.bottom - rc.top) == pContainer->oldSize.cy)) {
+ if (!((rc.right - rc.left) == pContainer->m_oldSize.cx && (rc.bottom - rc.top) == pContainer->m_oldSize.cy)) {
dat = (CTabBaseDlg*)GetWindowLongPtr(pContainer->m_hwndActive, GWLP_USERDATA);
if (dat)
dat->DM_ScrollToBottom(0, 0);
SendMessage(pContainer->m_hwndActive, WM_SIZE, 0, 0);
}
- pContainer->bSizingLoop = FALSE;
+ pContainer->m_bSizingLoop = FALSE;
break;
// determine minimum and maximum size limits
@@ -1146,9 +1213,9 @@ panel_found: // so let's add the container's vertical padding (title bar, tab bar,
// window border, status bar) to this value
if (pContainer->m_hwndActive)
- mmi->ptMinTrackSize.y = pContainer->uChildMinHeight + (pContainer->m_hwndActive ? ((rcWindow.bottom - rcWindow.top) - rcClient.bottom) : 0);
+ mmi->ptMinTrackSize.y = pContainer->m_uChildMinHeight + (pContainer->m_hwndActive ? ((rcWindow.bottom - rcWindow.top) - rcClient.bottom) : 0);
- if (pContainer->dwFlags & CNT_VERTICALMAX || (GetKeyState(VK_CONTROL) & 0x8000)) {
+ if (pContainer->m_dwFlags & CNT_VERTICALMAX || (GetKeyState(VK_CONTROL) & 0x8000)) {
RECT rcDesktop = { 0 };
BOOL fDesktopValid = FALSE;
int monitorXOffset = 0;
@@ -1187,11 +1254,11 @@ panel_found: case WM_TIMER:
if (wParam == TIMERID_HEARTBEAT) {
- if (GetForegroundWindow() != hwndDlg && (pContainer->settings->autoCloseSeconds > 0) && !pContainer->fHidden) {
+ if (GetForegroundWindow() != hwndDlg && (pContainer->m_pSettings->autoCloseSeconds > 0) && !pContainer->m_bHidden) {
BOOL fResult = TRUE;
- BroadCastContainer(pContainer, DM_CHECKAUTOHIDE, (WPARAM)pContainer->settings->autoCloseSeconds, (LPARAM)&fResult);
+ BroadCastContainer(pContainer, DM_CHECKAUTOHIDE, (WPARAM)pContainer->m_pSettings->autoCloseSeconds, (LPARAM)&fResult);
- if (fResult && nullptr == pContainer->hWndOptions)
+ if (fResult && nullptr == pContainer->m_hWndOptions)
PostMessage(hwndDlg, WM_CLOSE, 1, 0);
}
@@ -1208,37 +1275,37 @@ panel_found: case WM_SYSCOMMAND:
switch (wParam) {
case IDM_STAYONTOP:
- SetWindowPos(hwndDlg, (pContainer->dwFlags & CNT_STICKY) ? HWND_NOTOPMOST : HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
- CheckMenuItem(GetSystemMenu(hwndDlg, FALSE), IDM_STAYONTOP, (pContainer->dwFlags & CNT_STICKY) ? MF_BYCOMMAND | MF_UNCHECKED : MF_BYCOMMAND | MF_CHECKED);
- ApplyContainerSetting(pContainer, CNT_STICKY, pContainer->dwFlags & CNT_STICKY ? 0 : 1, false);
+ SetWindowPos(hwndDlg, (pContainer->m_dwFlags & CNT_STICKY) ? HWND_NOTOPMOST : HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
+ CheckMenuItem(GetSystemMenu(hwndDlg, FALSE), IDM_STAYONTOP, (pContainer->m_dwFlags & CNT_STICKY) ? MF_BYCOMMAND | MF_UNCHECKED : MF_BYCOMMAND | MF_CHECKED);
+ ApplyContainerSetting(pContainer, CNT_STICKY, pContainer->m_dwFlags & CNT_STICKY ? 0 : 1, false);
break;
case IDM_NOTITLE:
- pContainer->oldSize.cx = 0;
- pContainer->oldSize.cy = 0;
+ pContainer->m_oldSize.cx = 0;
+ pContainer->m_oldSize.cy = 0;
- CheckMenuItem(GetSystemMenu(hwndDlg, FALSE), IDM_NOTITLE, (pContainer->dwFlags & CNT_NOTITLE) ? MF_BYCOMMAND | MF_UNCHECKED : MF_BYCOMMAND | MF_CHECKED);
- ApplyContainerSetting(pContainer, CNT_NOTITLE, pContainer->dwFlags & CNT_NOTITLE ? 0 : 1, true);
+ CheckMenuItem(GetSystemMenu(hwndDlg, FALSE), IDM_NOTITLE, (pContainer->m_dwFlags & CNT_NOTITLE) ? MF_BYCOMMAND | MF_UNCHECKED : MF_BYCOMMAND | MF_CHECKED);
+ ApplyContainerSetting(pContainer, CNT_NOTITLE, pContainer->m_dwFlags & CNT_NOTITLE ? 0 : 1, true);
break;
case IDM_MOREOPTIONS:
if (IsIconic(pContainer->m_hwnd))
SendMessage(pContainer->m_hwnd, WM_SYSCOMMAND, SC_RESTORE, 0);
- if (pContainer->hWndOptions == nullptr)
+ if (pContainer->m_hWndOptions == nullptr)
CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_CONTAINEROPTIONS), hwndDlg, DlgProcContainerOptions, (LPARAM)pContainer);
break;
case SC_MAXIMIZE:
- pContainer->oldSize.cx = pContainer->oldSize.cy = 0;
+ pContainer->m_oldSize.cx = pContainer->m_oldSize.cy = 0;
break;
case SC_RESTORE:
- pContainer->oldSize.cx = pContainer->oldSize.cy = 0;
+ pContainer->m_oldSize.cx = pContainer->m_oldSize.cy = 0;
pContainer->ClearMargins();
break;
case SC_MINIMIZE:
dat = (CTabBaseDlg*)(GetWindowLongPtr(pContainer->m_hwndActive, GWLP_USERDATA));
if (dat) {
- GetWindowRect(pContainer->m_hwndActive, &pContainer->rcLogSaved);
- pContainer->ptLogSaved.x = pContainer->rcLogSaved.left;
- pContainer->ptLogSaved.y = pContainer->rcLogSaved.top;
- ScreenToClient(hwndDlg, &pContainer->ptLogSaved);
+ GetWindowRect(pContainer->m_hwndActive, &pContainer->m_rcLogSaved);
+ pContainer->m_ptLogSaved.x = pContainer->m_rcLogSaved.left;
+ pContainer->m_ptLogSaved.y = pContainer->m_rcLogSaved.top;
+ ScreenToClient(hwndDlg, &pContainer->m_ptLogSaved);
}
}
break;
@@ -1282,11 +1349,11 @@ panel_found: break;
case WM_INITMENUPOPUP:
- pContainer->MenuBar->setActive(reinterpret_cast<HMENU>(wParam));
+ pContainer->m_pMenuBar->setActive(reinterpret_cast<HMENU>(wParam));
break;
case WM_LBUTTONDOWN:
- if (pContainer->dwFlags & CNT_NOTITLE) {
+ if (pContainer->m_dwFlags & CNT_NOTITLE) {
GetCursorPos(&pt);
return SendMessage(hwndDlg, WM_SYSCOMMAND, SC_MOVE | HTCAPTION, MAKELPARAM(pt.x, pt.y));
}
@@ -1295,7 +1362,7 @@ panel_found: // pass the WM_ACTIVATE msg to the active message dialog child
case WM_NCACTIVATE:
if (IsWindowVisible(hwndDlg))
- pContainer->fHidden = false;
+ pContainer->m_bHidden = false;
break;
case WM_ACTIVATE:
@@ -1308,14 +1375,14 @@ panel_found: if (LOWORD(wParam == WA_INACTIVE) && (HWND)lParam != PluginConfig.g_hwndHotkeyHandler && GetParent((HWND)lParam) != hwndDlg) {
BOOL fTransAllowed = !bSkinned || PluginConfig.m_bIsVista;
- if (pContainer->dwFlags & CNT_TRANSPARENCY && fTransAllowed) {
- SetLayeredWindowAttributes(hwndDlg, Skin->getColorKey(), (BYTE)HIWORD(pContainer->settings->dwTransparency), (pContainer->dwFlags & CNT_TRANSPARENCY ? LWA_ALPHA : 0));
+ if (pContainer->m_dwFlags & CNT_TRANSPARENCY && fTransAllowed) {
+ SetLayeredWindowAttributes(hwndDlg, Skin->getColorKey(), (BYTE)HIWORD(pContainer->m_pSettings->dwTransparency), (pContainer->m_dwFlags & CNT_TRANSPARENCY ? LWA_ALPHA : 0));
}
}
- pContainer->hwndSaved = nullptr;
+ pContainer->m_hwndSaved = nullptr;
if (LOWORD(wParam) != WA_ACTIVE) {
- pContainer->MenuBar->Cancel();
+ pContainer->m_pMenuBar->Cancel();
if (HWND hDlg = GetTabWindow(hwndTab, TabCtrl_GetCurSel(hwndTab)))
SendMessage(hDlg, WM_ACTIVATE, WA_INACTIVE, 0);
@@ -1327,26 +1394,26 @@ panel_found: BOOL fTransAllowed = !bSkinned || PluginConfig.m_WinVerMajor >= 6;
FlashContainer(pContainer, 0, 0);
- pContainer->dwFlashingStarted = 0;
+ pContainer->m_dwFlashingStarted = 0;
pLastActiveContainer = pContainer;
- if (pContainer->dwFlags & CNT_DEFERREDTABSELECT) {
- pContainer->dwFlags &= ~CNT_DEFERREDTABSELECT;
+ if (pContainer->m_dwFlags & CNT_DEFERREDTABSELECT) {
+ pContainer->m_dwFlags &= ~CNT_DEFERREDTABSELECT;
SendMessage(hwndDlg, WM_SYSCOMMAND, SC_RESTORE, 0);
NMHDR nmhdr = { hwndTab, IDC_MSGTABS, TCN_SELCHANGE };
SendMessage(hwndDlg, WM_NOTIFY, 0, (LPARAM)&nmhdr); // do it via a WM_NOTIFY / TCN_SELCHANGE to simulate user-activation
}
- if (pContainer->dwFlags & CNT_DEFERREDSIZEREQUEST) {
- pContainer->dwFlags &= ~CNT_DEFERREDSIZEREQUEST;
+ if (pContainer->m_dwFlags & CNT_DEFERREDSIZEREQUEST) {
+ pContainer->m_dwFlags &= ~CNT_DEFERREDSIZEREQUEST;
SendMessage(hwndDlg, WM_SIZE, 0, 0);
}
- if (pContainer->dwFlags & CNT_TRANSPARENCY && fTransAllowed) {
- DWORD trans = LOWORD(pContainer->settings->dwTransparency);
- SetLayeredWindowAttributes(hwndDlg, Skin->getColorKey(), (BYTE)trans, (pContainer->dwFlags & CNT_TRANSPARENCY ? LWA_ALPHA : 0));
+ if (pContainer->m_dwFlags & CNT_TRANSPARENCY && fTransAllowed) {
+ DWORD trans = LOWORD(pContainer->m_pSettings->dwTransparency);
+ SetLayeredWindowAttributes(hwndDlg, Skin->getColorKey(), (BYTE)trans, (pContainer->m_dwFlags & CNT_TRANSPARENCY ? LWA_ALPHA : 0));
}
- if (pContainer->dwFlags & CNT_NEED_UPDATETITLE) {
- pContainer->dwFlags &= ~CNT_NEED_UPDATETITLE;
+ if (pContainer->m_dwFlags & CNT_NEED_UPDATETITLE) {
+ pContainer->m_dwFlags &= ~CNT_NEED_UPDATETITLE;
if (pContainer->m_hwndActive) {
hContact = 0;
SendMessage(pContainer->m_hwndActive, DM_QUERYHCONTACT, 0, (LPARAM)&hContact);
@@ -1356,8 +1423,8 @@ panel_found: }
HWND hDlg = GetTabWindow(hwndTab, TabCtrl_GetCurSel(hwndTab));
- if (pContainer->dwFlags & CNT_DEFERREDCONFIGURE && hDlg) {
- pContainer->dwFlags &= ~CNT_DEFERREDCONFIGURE;
+ if (pContainer->m_dwFlags & CNT_DEFERREDCONFIGURE && hDlg) {
+ pContainer->m_dwFlags &= ~CNT_DEFERREDCONFIGURE;
pContainer->m_hwndActive = hDlg;
SendMessage(hwndDlg, WM_SYSCOMMAND, SC_RESTORE, 0);
if (pContainer->m_hwndActive != nullptr && IsWindow(pContainer->m_hwndActive)) {
@@ -1382,10 +1449,10 @@ panel_found: case DM_CLOSETABATMOUSE:
if (HWND hDlg = GetTabWindow(hwndTab, GetTabItemFromMouse(hwndTab, (POINT*)lParam))) {
if (hDlg != pContainer->m_hwndActive) {
- pContainer->bDontSmartClose = TRUE;
+ pContainer->m_bDontSmartClose = TRUE;
SendMessage(hDlg, WM_CLOSE, 0, 1);
RedrawWindow(hwndDlg, nullptr, nullptr, RDW_INVALIDATE);
- pContainer->bDontSmartClose = FALSE;
+ pContainer->m_bDontSmartClose = FALSE;
}
else SendMessage(hDlg, WM_CLOSE, 0, 1);
}
@@ -1417,12 +1484,12 @@ panel_found: CSkin::DrawItem(hdc, &rc, &SkinItems[ID_EXTBKCONTAINER]);
else {
CSkin::FillBack(hdc, &rc);
- if (pContainer->SideBar->isActive() && pContainer->SideBar->isVisible()) {
+ if (pContainer->m_pSideBar->isActive() && pContainer->m_pSideBar->isVisible()) {
HPEN hPen = ::CreatePen(PS_SOLID, 1, PluginConfig.m_cRichBorders ? PluginConfig.m_cRichBorders : ::GetSysColor(COLOR_3DSHADOW));
HPEN hOldPen = reinterpret_cast<HPEN>(::SelectObject(hdc, hPen));
- LONG x = (pContainer->SideBar->getFlags() & CSideBar::SIDEBARORIENTATION_LEFT ? pContainer->SideBar->getWidth() - 2 + pContainer->tBorder_outer_left :
- rc.right - pContainer->SideBar->getWidth() + 1 - pContainer->tBorder_outer_right);
+ LONG x = (pContainer->m_pSideBar->getFlags() & CSideBar::SIDEBARORIENTATION_LEFT ? pContainer->m_pSideBar->getWidth() - 2 + pContainer->m_tBorder_outer_left :
+ rc.right - pContainer->m_pSideBar->getWidth() + 1 - pContainer->m_tBorder_outer_right);
::MoveToEx(hdc, x, rc.top, nullptr);
::LineTo(hdc, x, rc.bottom);
::SelectObject(hdc, hOldPen);
@@ -1444,18 +1511,18 @@ panel_found: szTitleFormat[0] = 0;
- if (pContainer->isCloned && pContainer->hContactFrom != 0) {
- pContainer->settings = &PluginConfig.globalContainerSettings;
+ if (pContainer->m_isCloned && pContainer->m_hContactFrom != 0) {
+ pContainer->m_pSettings = &PluginConfig.globalContainerSettings;
- pContainer->szRelThemeFile[0] = pContainer->szAbsThemeFile[0] = 0;
+ pContainer->m_szRelThemeFile[0] = pContainer->m_szAbsThemeFile[0] = 0;
mir_snprintf(szCname, "%s_theme", CONTAINER_PREFIX);
- if (!db_get_ws(pContainer->hContactFrom, SRMSGMOD_T, szCname, &dbv))
+ if (!db_get_ws(pContainer->m_hContactFrom, SRMSGMOD_T, szCname, &dbv))
szThemeName = dbv.pwszVal;
}
else {
Utils::ReadPrivateContainerSettings(pContainer);
if (szThemeName == nullptr) {
- mir_snprintf(szCname, "%s%d_theme", CONTAINER_PREFIX, pContainer->iContainerIndex);
+ mir_snprintf(szCname, "%s%d_theme", CONTAINER_PREFIX, pContainer->m_iContainerIndex);
if (!db_get_ws(0, SRMSGMOD_T, szCname, &dbv))
szThemeName = dbv.pwszVal;
}
@@ -1463,13 +1530,13 @@ panel_found: Utils::SettingsToContainer(pContainer);
if (szThemeName != nullptr) {
- PathToAbsoluteW(szThemeName, pContainer->szAbsThemeFile, M.getDataPath());
- wcsncpy_s(pContainer->szRelThemeFile, szThemeName, _TRUNCATE);
+ PathToAbsoluteW(szThemeName, pContainer->m_szAbsThemeFile, M.getDataPath());
+ wcsncpy_s(pContainer->m_szRelThemeFile, szThemeName, _TRUNCATE);
db_free(&dbv);
}
- else pContainer->szAbsThemeFile[0] = pContainer->szRelThemeFile[0] = 0;
+ else pContainer->m_szAbsThemeFile[0] = pContainer->m_szRelThemeFile[0] = 0;
- pContainer->ltr_templates = pContainer->rtl_templates = nullptr;
+ pContainer->m_ltr_templates = pContainer->m_rtl_templates = nullptr;
}
break;
@@ -1481,7 +1548,7 @@ panel_found: SetWindowPos(hwndDlg, nullptr, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, SWP_NOZORDER | SWP_NOACTIVATE);
RedrawWindow(hwndDlg, nullptr, nullptr, RDW_INVALIDATE | RDW_FRAME | RDW_ALLCHILDREN);
- if (pContainer->hwndStatus != nullptr && pContainer->m_hwndActive != nullptr)
+ if (pContainer->m_hwndStatus != nullptr && pContainer->m_hwndActive != nullptr)
PostMessage(pContainer->m_hwndActive, DM_STATUSBARCHANGED, 0, 0);
return 0;
@@ -1492,38 +1559,38 @@ panel_found: DWORD wsold, ws = wsold = GetWindowLongPtr(hwndDlg, GWL_STYLE);
if (!CSkin::m_frameSkins) {
- ws = (pContainer->dwFlags & CNT_NOTITLE) ?
+ ws = (pContainer->m_dwFlags & CNT_NOTITLE) ?
((IsWindowVisible(hwndDlg) ? WS_VISIBLE : 0) | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_CLIPCHILDREN | WS_THICKFRAME | (CSkin::m_frameSkins ? WS_SYSMENU : WS_SYSMENU | WS_SIZEBOX)) :
ws | WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN;
}
SetWindowLongPtr(hwndDlg, GWL_STYLE, ws);
- pContainer->tBorder = M.GetByte((bSkinned ? "S_tborder" : "tborder"), 2);
- pContainer->tBorder_outer_left = g_ButtonSet.left + M.GetByte((bSkinned ? "S_tborder_outer_left" : "tborder_outer_left"), 2);
- pContainer->tBorder_outer_right = g_ButtonSet.right + M.GetByte((bSkinned ? "S_tborder_outer_right" : "tborder_outer_right"), 2);
- pContainer->tBorder_outer_top = g_ButtonSet.top + M.GetByte((bSkinned ? "S_tborder_outer_top" : "tborder_outer_top"), 2);
- pContainer->tBorder_outer_bottom = g_ButtonSet.bottom + M.GetByte((bSkinned ? "S_tborder_outer_bottom" : "tborder_outer_bottom"), 2);
+ pContainer->m_tBorder = M.GetByte((bSkinned ? "S_tborder" : "tborder"), 2);
+ pContainer->m_tBorder_outer_left = g_ButtonSet.left + M.GetByte((bSkinned ? "S_tborder_outer_left" : "tborder_outer_left"), 2);
+ pContainer->m_tBorder_outer_right = g_ButtonSet.right + M.GetByte((bSkinned ? "S_tborder_outer_right" : "tborder_outer_right"), 2);
+ pContainer->m_tBorder_outer_top = g_ButtonSet.top + M.GetByte((bSkinned ? "S_tborder_outer_top" : "tborder_outer_top"), 2);
+ pContainer->m_tBorder_outer_bottom = g_ButtonSet.bottom + M.GetByte((bSkinned ? "S_tborder_outer_bottom" : "tborder_outer_bottom"), 2);
sBarHeight = (UINT)M.GetByte((bSkinned ? "S_sbarheight" : "sbarheight"), 0);
if (LOBYTE(LOWORD(GetVersion())) >= 5) {
BOOL fTransAllowed = !bSkinned || PluginConfig.m_WinVerMajor >= 6;
DWORD exold, ex = exold = GetWindowLongPtr(hwndDlg, GWL_EXSTYLE);
- ex = (pContainer->dwFlags & CNT_TRANSPARENCY && (!CSkin::m_skinEnabled || fTransAllowed)) ? ex | WS_EX_LAYERED : ex & ~(WS_EX_LAYERED);
+ ex = (pContainer->m_dwFlags & CNT_TRANSPARENCY && (!CSkin::m_skinEnabled || fTransAllowed)) ? ex | WS_EX_LAYERED : ex & ~(WS_EX_LAYERED);
SetWindowLongPtr(hwndDlg, GWL_EXSTYLE, ex);
- if (pContainer->dwFlags & CNT_TRANSPARENCY && fTransAllowed) {
- DWORD trans = LOWORD(pContainer->settings->dwTransparency);
- SetLayeredWindowAttributes(hwndDlg, Skin->getColorKey(), (BYTE)trans, (/* pContainer->bSkinned ? LWA_COLORKEY : */ 0) | (pContainer->dwFlags & CNT_TRANSPARENCY ? LWA_ALPHA : 0));
+ if (pContainer->m_dwFlags & CNT_TRANSPARENCY && fTransAllowed) {
+ DWORD trans = LOWORD(pContainer->m_pSettings->dwTransparency);
+ SetLayeredWindowAttributes(hwndDlg, Skin->getColorKey(), (BYTE)trans, (/* pContainer->m_bSkinned ? LWA_COLORKEY : */ 0) | (pContainer->m_dwFlags & CNT_TRANSPARENCY ? LWA_ALPHA : 0));
}
}
if (!CSkin::m_frameSkins)
- CheckMenuItem(hSysmenu, IDM_NOTITLE, (pContainer->dwFlags & CNT_NOTITLE) ? MF_BYCOMMAND | MF_CHECKED : MF_BYCOMMAND | MF_UNCHECKED);
+ CheckMenuItem(hSysmenu, IDM_NOTITLE, (pContainer->m_dwFlags & CNT_NOTITLE) ? MF_BYCOMMAND | MF_CHECKED : MF_BYCOMMAND | MF_UNCHECKED);
- CheckMenuItem(hSysmenu, IDM_STAYONTOP, pContainer->dwFlags & CNT_STICKY ? MF_BYCOMMAND | MF_CHECKED : MF_BYCOMMAND | MF_UNCHECKED);
- SetWindowPos(hwndDlg, (pContainer->dwFlags & CNT_STICKY) ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOREDRAW | SWP_NOCOPYBITS);
+ CheckMenuItem(hSysmenu, IDM_STAYONTOP, pContainer->m_dwFlags & CNT_STICKY ? MF_BYCOMMAND | MF_CHECKED : MF_BYCOMMAND | MF_UNCHECKED);
+ SetWindowPos(hwndDlg, (pContainer->m_dwFlags & CNT_STICKY) ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOREDRAW | SWP_NOCOPYBITS);
if (ws != wsold) {
GetWindowRect(hwndDlg, &rc);
if ((ws & WS_CAPTION) != (wsold & WS_CAPTION)) {
@@ -1536,13 +1603,13 @@ panel_found: }
}
- pContainer->dwFlags = ((pContainer->dwFlagsEx & (TCF_SBARLEFT | TCF_SBARRIGHT)) ?
- pContainer->dwFlags | CNT_SIDEBAR : pContainer->dwFlags & ~CNT_SIDEBAR);
+ pContainer->m_dwFlags = ((pContainer->m_dwFlagsEx & (TCF_SBARLEFT | TCF_SBARRIGHT)) ?
+ pContainer->m_dwFlags | CNT_SIDEBAR : pContainer->m_dwFlags & ~CNT_SIDEBAR);
- pContainer->SideBar->Init();
+ pContainer->m_pSideBar->Init();
ws = wsold = GetWindowLongPtr(hwndTab, GWL_STYLE);
- if (pContainer->dwFlags & CNT_TABSBOTTOM)
+ if (pContainer->m_dwFlags & CNT_TABSBOTTOM)
ws |= (TCS_BOTTOM);
else
ws &= ~(TCS_BOTTOM);
@@ -1551,19 +1618,19 @@ panel_found: RedrawWindow(hwndTab, nullptr, nullptr, RDW_INVALIDATE);
}
- if (pContainer->dwFlags & CNT_NOSTATUSBAR) {
- if (pContainer->hwndStatus) {
- DestroyWindow(pContainer->hwndStatus);
- pContainer->hwndStatus = nullptr;
- pContainer->statusBarHeight = 0;
+ if (pContainer->m_dwFlags & CNT_NOSTATUSBAR) {
+ if (pContainer->m_hwndStatus) {
+ DestroyWindow(pContainer->m_hwndStatus);
+ pContainer->m_hwndStatus = nullptr;
+ pContainer->m_statusBarHeight = 0;
SendMessage(hwndDlg, DM_STATUSBARCHANGED, 0, 0);
}
}
- else if (pContainer->hwndStatus == nullptr) {
- pContainer->hwndStatus = CreateWindowEx(0, L"TSStatusBarClass", nullptr, SBT_TOOLTIPS | WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, hwndDlg, nullptr, g_plugin.getInst(), nullptr);
+ else if (pContainer->m_hwndStatus == nullptr) {
+ pContainer->m_hwndStatus = CreateWindowEx(0, L"TSStatusBarClass", nullptr, SBT_TOOLTIPS | WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, hwndDlg, nullptr, g_plugin.getInst(), nullptr);
if (sBarHeight && bSkinned)
- SendMessage(pContainer->hwndStatus, SB_SETMINHEIGHT, sBarHeight, 0);
+ SendMessage(pContainer->m_hwndStatus, SB_SETMINHEIGHT, sBarHeight, 0);
}
if (pContainer->m_hwndActive != nullptr) {
hContact = 0;
@@ -1626,78 +1693,10 @@ panel_found: }
return 0;
- case DM_SETICON:
- {
- dat = (CTabBaseDlg*)wParam;
- HICON hIconMsg = PluginConfig.g_IconMsgEvent;
- HICON hIconBig = (dat && dat->m_cache) ? Skin_LoadProtoIcon(dat->m_cache->getProto(), dat->m_cache->getStatus(), true) : nullptr;
-
- if (Win7Taskbar->haveLargeIcons()) {
- if ((HICON)lParam == PluginConfig.g_buttonBarIcons[ICON_DEFAULT_TYPING] || (HICON)lParam == hIconMsg) {
- Win7Taskbar->setOverlayIcon(hwndDlg, lParam);
- if (GetForegroundWindow() != hwndDlg)
- SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, lParam);
- if ((HICON)lParam == hIconMsg)
- pContainer->hIconTaskbarOverlay = hIconMsg;
- break;
- }
-
- if (dat) {
- if (dat->m_hTaskbarIcon == nullptr)
- dat->m_hTaskbarIcon = ((dat->m_pContainer->dwFlags & CNT_AVATARSONTASKBAR) ? dat->IconFromAvatar() : nullptr);
- else {
- if (!(dat->m_pContainer->dwFlags & CNT_AVATARSONTASKBAR)) {
- DestroyIcon(dat->m_hTaskbarIcon);
- dat->m_hTaskbarIcon = nullptr;
- }
- }
-
- if (dat->m_hTaskbarIcon) {
- SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)dat->m_hTaskbarIcon);
- SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, lParam);
- Win7Taskbar->setOverlayIcon(hwndDlg, (LPARAM)(dat->m_hTabIcon ? (LPARAM)dat->m_hTabIcon : lParam));
- }
- else {
- if (nullptr == hIconBig || (HICON)CALLSERVICE_NOTFOUND == hIconBig)
- SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)lParam);
- else
- SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIconBig);
- SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, lParam);
- if (dat->m_pContainer->hIconTaskbarOverlay)
- Win7Taskbar->setOverlayIcon(hwndDlg, (LPARAM)dat->m_pContainer->hIconTaskbarOverlay);
- else if (Win7Taskbar->haveAlwaysGroupingMode() && fForceOverlayIcons)
- Win7Taskbar->setOverlayIcon(hwndDlg, lParam);
- else
- Win7Taskbar->clearOverlayIcon(hwndDlg);
- }
- return 0;
- }
- }
-
- // default handling (no win7 taskbar)
- if ((HICON)lParam == PluginConfig.g_buttonBarIcons[ICON_DEFAULT_TYPING]) { // always set typing icon, but don't save it...
- SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)PluginConfig.g_IconTypingEventBig);
- SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, lParam);
- break;
- }
- if (reinterpret_cast<HICON>(lParam) == hIconMsg)
- hIconBig = Skin_LoadIcon(SKINICON_EVENT_MESSAGE, true);
-
- if (pContainer->hIcon == STICK_ICON_MSG && (HICON)lParam != hIconMsg && pContainer->dwFlags & CNT_NEED_UPDATETITLE) {
- lParam = (LPARAM)hIconMsg;
- hIconBig = Skin_LoadIcon(SKINICON_EVENT_MESSAGE, true);
- }
- SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, lParam);
- if (nullptr != hIconBig && reinterpret_cast<HICON>(CALLSERVICE_NOTFOUND) != hIconBig)
- SendMessage(hwndDlg, WM_SETICON, ICON_BIG, LPARAM(hIconBig));
- pContainer->hIcon = (lParam == (LPARAM)hIconMsg) ? STICK_ICON_MSG : 0;
- }
- return 0;
-
case WM_DRAWITEM:
{
DRAWITEMSTRUCT *dis = (DRAWITEMSTRUCT *)lParam;
- if (dis->hwndItem == pContainer->hwndStatus && !(pContainer->dwFlags & CNT_NOSTATUSBAR)) {
+ if (dis->hwndItem == pContainer->m_hwndStatus && !(pContainer->m_dwFlags & CNT_NOSTATUSBAR)) {
dat = (CTabBaseDlg*)GetWindowLongPtr(pContainer->m_hwndActive, GWLP_USERDATA);
if (dat)
dat->DrawStatusIcons(dis->hDC, dis->rcItem, 2);
@@ -1716,7 +1715,7 @@ panel_found: if (!IsIconic(hwndDlg))
GetClientRect(hwndDlg, pRect);
else
- CopyRect(pRect, &pContainer->rcSaved);
+ CopyRect(pRect, &pContainer->m_rcSaved);
AdjustTabClientRect(pContainer, pRect);
}
}
@@ -1725,39 +1724,39 @@ panel_found: case WM_DESTROY:
pContainer->m_hwnd = nullptr;
pContainer->m_hwndActive = nullptr;
- if (pContainer->hwndStatus)
- DestroyWindow(pContainer->hwndStatus);
+ if (pContainer->m_hwndStatus)
+ DestroyWindow(pContainer->m_hwndStatus);
// mir_free private theme...
- if (pContainer->theme.isPrivate) {
- mir_free(pContainer->ltr_templates);
- mir_free(pContainer->rtl_templates);
- mir_free(pContainer->theme.logFonts);
- mir_free(pContainer->theme.fontColors);
- mir_free(pContainer->theme.rtfFonts);
+ if (pContainer->m_theme.isPrivate) {
+ mir_free(pContainer->m_ltr_templates);
+ mir_free(pContainer->m_rtl_templates);
+ mir_free(pContainer->m_theme.logFonts);
+ mir_free(pContainer->m_theme.fontColors);
+ mir_free(pContainer->m_theme.rtfFonts);
}
if (pContainer->m_hwndTip)
DestroyWindow(pContainer->m_hwndTip);
RemoveContainerFromList(pContainer);
- if (pContainer->cachedDC) {
- SelectObject(pContainer->cachedDC, pContainer->oldHBM);
- DeleteObject(pContainer->cachedHBM);
- DeleteDC(pContainer->cachedDC);
+ if (pContainer->m_cachedDC) {
+ SelectObject(pContainer->m_cachedDC, pContainer->m_oldHBM);
+ DeleteObject(pContainer->m_cachedHBM);
+ DeleteDC(pContainer->m_cachedDC);
}
- if (pContainer->cachedToolbarDC) {
- SelectObject(pContainer->cachedToolbarDC, pContainer->oldhbmToolbarBG);
- DeleteObject(pContainer->hbmToolbarBG);
- DeleteDC(pContainer->cachedToolbarDC);
+ if (pContainer->m_cachedToolbarDC) {
+ SelectObject(pContainer->m_cachedToolbarDC, pContainer->m_oldhbmToolbarBG);
+ DeleteObject(pContainer->m_hbmToolbarBG);
+ DeleteDC(pContainer->m_cachedToolbarDC);
}
return 0;
case WM_NCDESTROY:
if (pContainer) {
- delete pContainer->MenuBar;
- delete pContainer->SideBar;
- if (pContainer->settings != &PluginConfig.globalContainerSettings)
- mir_free(pContainer->settings);
+ delete pContainer->m_pMenuBar;
+ delete pContainer->m_pSideBar;
+ if (pContainer->m_pSettings != &PluginConfig.globalContainerSettings)
+ mir_free(pContainer->m_pSettings);
mir_free(pContainer);
}
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, 0);
@@ -1766,7 +1765,7 @@ panel_found: case WM_CLOSE:
if (PluginConfig.m_bHideOnClose && !lParam) {
ShowWindow(hwndDlg, SW_HIDE);
- pContainer->fHidden = true;
+ pContainer->m_bHidden = true;
}
else {
if (TabCtrl_GetItemCount(hwndTab) > 1) {
@@ -1785,23 +1784,23 @@ panel_found: SendMessage(hDlg, DM_CHECKQUEUEFORCLOSE, 0, (LPARAM)&iOpenJobs);
}
if (iOpenJobs && pContainer) {
- if (pContainer->exFlags & CNT_EX_CLOSEWARN)
+ if (pContainer->m_exFlags & CNT_EX_CLOSEWARN)
return TRUE;
- pContainer->exFlags |= CNT_EX_CLOSEWARN;
+ pContainer->m_exFlags |= CNT_EX_CLOSEWARN;
LRESULT result = SendQueue::WarnPendingJobs(iOpenJobs);
- pContainer->exFlags &= ~CNT_EX_CLOSEWARN;
+ pContainer->m_exFlags &= ~CNT_EX_CLOSEWARN;
if (result == IDNO)
return TRUE;
}
}
// save geometry information to the database...
- if (!(pContainer->dwFlags & CNT_GLOBALSIZE)) {
+ if (!(pContainer->m_dwFlags & CNT_GLOBALSIZE)) {
WINDOWPLACEMENT wp = { 0 };
wp.length = sizeof(wp);
if (GetWindowPlacement(hwndDlg, &wp) != 0) {
- if (pContainer->isCloned && pContainer->hContactFrom != 0) {
+ if (pContainer->m_isCloned && pContainer->m_hContactFrom != 0) {
HWND hDlg = GetTabWindow(hwndTab, TabCtrl_GetCurSel(hwndTab));
SendMessage(hDlg, DM_QUERYHCONTACT, 0, (LPARAM)&hContact);
db_set_b(hContact, SRMSGMOD_T, "splitmax", (BYTE)((wp.showCmd == SW_SHOWMAXIMIZED) ? 1 : 0));
@@ -1818,13 +1817,13 @@ panel_found: }
else {
char szCName[40];
- mir_snprintf(szCName, "%s%dx", CONTAINER_PREFIX, pContainer->iContainerIndex);
+ mir_snprintf(szCName, "%s%dx", CONTAINER_PREFIX, pContainer->m_iContainerIndex);
db_set_dw(0, SRMSGMOD_T, szCName, wp.rcNormalPosition.left);
- mir_snprintf(szCName, "%s%dy", CONTAINER_PREFIX, pContainer->iContainerIndex);
+ mir_snprintf(szCName, "%s%dy", CONTAINER_PREFIX, pContainer->m_iContainerIndex);
db_set_dw(0, SRMSGMOD_T, szCName, wp.rcNormalPosition.top);
- mir_snprintf(szCName, "%s%dwidth", CONTAINER_PREFIX, pContainer->iContainerIndex);
+ mir_snprintf(szCName, "%s%dwidth", CONTAINER_PREFIX, pContainer->m_iContainerIndex);
db_set_dw(0, SRMSGMOD_T, szCName, wp.rcNormalPosition.right - wp.rcNormalPosition.left);
- mir_snprintf(szCName, "%s%dheight", CONTAINER_PREFIX, pContainer->iContainerIndex);
+ mir_snprintf(szCName, "%s%dheight", CONTAINER_PREFIX, pContainer->m_iContainerIndex);
db_set_dw(0, SRMSGMOD_T, szCName, wp.rcNormalPosition.bottom - wp.rcNormalPosition.top);
db_set_b(0, SRMSGMOD_T, "splitmax", (BYTE)((wp.showCmd == SW_SHOWMAXIMIZED) ? 1 : 0));
@@ -1833,25 +1832,25 @@ panel_found: }
// clear temp flags which should NEVER be saved...
- if (pContainer->isCloned && pContainer->hContactFrom != 0) {
+ if (pContainer->m_isCloned && pContainer->m_hContactFrom != 0) {
- pContainer->dwFlags &= ~(CNT_DEFERREDCONFIGURE | CNT_CREATE_MINIMIZED | CNT_DEFERREDSIZEREQUEST | CNT_CREATE_CLONED);
+ pContainer->m_dwFlags &= ~(CNT_DEFERREDCONFIGURE | CNT_CREATE_MINIMIZED | CNT_DEFERREDSIZEREQUEST | CNT_CREATE_CLONED);
for (int i = 0; i < TabCtrl_GetItemCount(hwndTab); i++) {
if (HWND hDlg = GetTabWindow(hwndTab, i)) {
SendMessage(hDlg, DM_QUERYHCONTACT, 0, (LPARAM)&hContact);
char szCName[40];
mir_snprintf(szCName, "%s_theme", CONTAINER_PREFIX);
- if (mir_wstrlen(pContainer->szRelThemeFile) > 1) {
- if (pContainer->fPrivateThemeChanged == TRUE) {
- PathToRelativeW(pContainer->szRelThemeFile, pContainer->szAbsThemeFile, M.getDataPath());
- db_set_ws(hContact, SRMSGMOD_T, szCName, pContainer->szRelThemeFile);
- pContainer->fPrivateThemeChanged = FALSE;
+ if (mir_wstrlen(pContainer->m_szRelThemeFile) > 1) {
+ if (pContainer->m_fPrivateThemeChanged == TRUE) {
+ PathToRelativeW(pContainer->m_szRelThemeFile, pContainer->m_szAbsThemeFile, M.getDataPath());
+ db_set_ws(hContact, SRMSGMOD_T, szCName, pContainer->m_szRelThemeFile);
+ pContainer->m_fPrivateThemeChanged = FALSE;
}
}
else {
db_unset(hContact, SRMSGMOD_T, szCName);
- pContainer->fPrivateThemeChanged = FALSE;
+ pContainer->m_fPrivateThemeChanged = FALSE;
}
}
}
@@ -1894,10 +1893,10 @@ TContainerData* TSAPI CreateContainer(const wchar_t *name, int iTemp, MCONTACT h ptrW tszName(db_get_wsa(0, CONTAINER_KEY, szCounter));
if (tszName == nullptr) {
if (iFirstFree != -1) {
- pContainer->iContainerIndex = iFirstFree;
+ pContainer->m_iContainerIndex = iFirstFree;
itoa(iFirstFree, szCounter, 10);
}
- else pContainer->iContainerIndex = i;
+ else pContainer->m_iContainerIndex = i;
db_set_ws(0, CONTAINER_KEY, szCounter, name);
BuildContainerMenu();
@@ -1905,7 +1904,7 @@ TContainerData* TSAPI CreateContainer(const wchar_t *name, int iTemp, MCONTACT h }
if (!wcsncmp(tszName, name, CONTAINER_NAMELEN)) {
- pContainer->iContainerIndex = i;
+ pContainer->m_iContainerIndex = i;
iFound = TRUE;
}
else if (!wcsncmp(tszName, L"**free**", CONTAINER_NAMELEN))
@@ -1914,14 +1913,14 @@ TContainerData* TSAPI CreateContainer(const wchar_t *name, int iTemp, MCONTACT h }
else {
iTemp |= CNT_CREATEFLAG_CLONED;
- pContainer->iContainerIndex = 1;
+ pContainer->m_iContainerIndex = 1;
}
if (iTemp & CNT_CREATEFLAG_MINIMIZED)
- pContainer->dwFlags = CNT_CREATE_MINIMIZED;
+ pContainer->m_dwFlags = CNT_CREATE_MINIMIZED;
if (iTemp & CNT_CREATEFLAG_CLONED) {
- pContainer->dwFlags |= CNT_CREATE_CLONED;
- pContainer->hContactFrom = hContactFrom;
+ pContainer->m_dwFlags |= CNT_CREATE_CLONED;
+ pContainer->m_hContactFrom = hContactFrom;
}
pContainer->m_hwnd = CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_MSGCONTAINER), nullptr, DlgProcContainer, (LPARAM)pContainer);
return pContainer;
@@ -1970,7 +1969,7 @@ int TSAPI ActivateTabFromHWND(HWND hwndTab, HWND hwnd) // enumerates tabs and closes all of them, but the one in dat
void TSAPI CloseOtherTabs(HWND hwndTab, CTabBaseDlg &dat)
{
- for (int idxt = 0; idxt < dat.m_pContainer->iChilds;) {
+ for (int idxt = 0; idxt < dat.m_pContainer->m_iChilds;) {
HWND otherTab = GetTabWindow(hwndTab, idxt);
if (otherTab != nullptr && otherTab != dat.GetHwnd())
SendMessage(otherTab, WM_CLOSE, 1, 0);
@@ -2068,12 +2067,12 @@ static TContainerData* TSAPI RemoveContainerFromList(TContainerData *pContainer) void TSAPI AdjustTabClientRect(TContainerData *pContainer, RECT *rc)
{
HWND hwndTab = GetDlgItem(pContainer->m_hwnd, IDC_MSGTABS);
- DWORD tBorder = pContainer->tBorder;
+ DWORD tBorder = pContainer->m_tBorder;
DWORD dwStyle = GetWindowLongPtr(hwndTab, GWL_STYLE);
RECT rcTab, rcTabOrig;
GetClientRect(hwndTab, &rcTab);
- if (!(pContainer->dwFlags & CNT_SIDEBAR) && (pContainer->iChilds > 1 || !(pContainer->dwFlags & CNT_HIDETABS))) {
+ if (!(pContainer->m_dwFlags & CNT_SIDEBAR) && (pContainer->m_iChilds > 1 || !(pContainer->m_dwFlags & CNT_HIDETABS))) {
rcTabOrig = rcTab;
TabCtrl_AdjustRect(hwndTab, FALSE, &rcTab);
DWORD dwTopPad = rcTab.top - rcTabOrig.top;
@@ -2082,7 +2081,7 @@ void TSAPI AdjustTabClientRect(TContainerData *pContainer, RECT *rc) rc->right -= tBorder;
if (dwStyle & TCS_BUTTONS) {
- if (pContainer->dwFlags & CNT_TABSBOTTOM) {
+ if (pContainer->m_dwFlags & CNT_TABSBOTTOM) {
int nCount = TabCtrl_GetItemCount(hwndTab);
if (nCount > 0) {
RECT rcItem;
@@ -2096,7 +2095,7 @@ void TSAPI AdjustTabClientRect(TContainerData *pContainer, RECT *rc) }
}
else {
- if (pContainer->dwFlags & CNT_TABSBOTTOM)
+ if (pContainer->m_dwFlags & CNT_TABSBOTTOM)
rc->bottom = rcTab.bottom + 2;
else {
rc->top += (dwTopPad - 2);
@@ -2111,9 +2110,9 @@ void TSAPI AdjustTabClientRect(TContainerData *pContainer, RECT *rc) rc->bottom = rcTab.bottom;
rc->top = rcTab.top;
}
- rc->right -= (pContainer->tBorder_outer_left + pContainer->tBorder_outer_right);
- if (pContainer->SideBar->isVisible())
- rc->right -= pContainer->SideBar->getWidth();
+ rc->right -= (pContainer->m_tBorder_outer_left + pContainer->m_tBorder_outer_right);
+ if (pContainer->m_pSideBar->isVisible())
+ rc->right -= pContainer->m_pSideBar->getWidth();
}
// retrieve the container name for the given contact handle.
@@ -2225,7 +2224,7 @@ HMENU TSAPI BuildContainerMenu() void TSAPI FlashContainer(TContainerData *pContainer, int iMode, int iCount)
{
- if (pContainer->dwFlags & CNT_NOFLASH) // container should never flash
+ if (pContainer->m_dwFlags & CNT_NOFLASH) // container should never flash
return;
FLASHWINFO fwi;
@@ -2234,7 +2233,7 @@ void TSAPI FlashContainer(TContainerData *pContainer, int iMode, int iCount) if (iMode) {
fwi.dwFlags = FLASHW_ALL;
- if (pContainer->dwFlags & CNT_FLASHALWAYS)
+ if (pContainer->m_dwFlags & CNT_FLASHALWAYS)
fwi.dwFlags |= FLASHW_TIMER;
else
fwi.uCount = (iCount == 0) ? M.GetByte("nrflash", 4) : iCount;
@@ -2244,21 +2243,21 @@ void TSAPI FlashContainer(TContainerData *pContainer, int iMode, int iCount) else fwi.dwFlags = FLASHW_STOP;
fwi.hwnd = pContainer->m_hwnd;
- pContainer->dwFlashingStarted = GetTickCount();
+ pContainer->m_dwFlashingStarted = GetTickCount();
FlashWindowEx(&fwi);
}
void TSAPI ReflashContainer(TContainerData *pContainer)
{
- DWORD dwStartTime = pContainer->dwFlashingStarted;
+ DWORD dwStartTime = pContainer->m_dwFlashingStarted;
if (pContainer->IsActive()) // dont care about active windows
return;
- if (pContainer->dwFlags & CNT_NOFLASH || pContainer->dwFlashingStarted == 0)
+ if (pContainer->m_dwFlags & CNT_NOFLASH || pContainer->m_dwFlashingStarted == 0)
return; // dont care about containers which should never flash
- if (pContainer->dwFlags & CNT_FLASHALWAYS)
+ if (pContainer->m_dwFlags & CNT_FLASHALWAYS)
FlashContainer(pContainer, 1, 0);
else {
// recalc the remaining flashes
@@ -2273,7 +2272,7 @@ void TSAPI ReflashContainer(TContainerData *pContainer) FlashWindow(pContainer->m_hwnd, TRUE);
}
}
- pContainer->dwFlashingStarted = dwStartTime;
+ pContainer->m_dwFlashingStarted = dwStartTime;
}
// broadcasts a message to all child windows (tabs/sessions)
|