summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-05-13 20:34:08 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-05-13 20:34:08 +0000
commited29ab352693783c3cc66cd2d102bb4c3a4ad02d (patch)
tree74fe010092cca1493bf98d5b4e00bbd4ec1b9f99 /plugins
parent2a1e6f05aa9fcc4dfe642bd42aeb175e3958d4b3 (diff)
fixes bug #333: resizing issue in Clist Nicer's "bra" ;)
git-svn-id: http://svn.miranda-ng.org/main/trunk@4645 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Clist_nicer/src/clui.cpp293
-rw-r--r--plugins/Clist_nicer/src/cluiopts.cpp7
-rw-r--r--plugins/Clist_nicer/src/statusbar.cpp23
3 files changed, 155 insertions, 168 deletions
diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp
index 843e27cccc..fe000c8e9d 100644
--- a/plugins/Clist_nicer/src/clui.cpp
+++ b/plugins/Clist_nicer/src/clui.cpp
@@ -784,7 +784,7 @@ static void GetButtonRect(HWND hwnd, RECT *rc)
LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg) {
- case WM_CREATE: {
+ case WM_CREATE:
int i;
{
int flags = WS_CHILD | CCS_BOTTOM;
@@ -826,7 +826,7 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
TranslateMenu(GetMenu(hwnd));
PostMessage(hwnd, M_CREATECLC, 0, 0);
return FALSE;
- }
+
case WM_NCCREATE:
{
LPCREATESTRUCT p = (LPCREATESTRUCT)lParam;
@@ -905,150 +905,153 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
if (cfg::dat.bSkinnedButtonMode)
return TRUE;
return DefWindowProc(hwnd, msg, wParam, lParam);
- case WM_PAINT: {
- PAINTSTRUCT ps;
- RECT rc, rcFrame, rcClient;
- HDC hdc;
- HRGN rgn = 0;
- HDC hdcReal = BeginPaint(hwnd, &ps);
-
- if (during_sizing)
- rcClient = rcWPC;
- else
- GetClientRect(hwnd, &rcClient);
- CopyRect(&rc, &rcClient);
- if ( !cfg::dat.hdcBg || rc.right > cfg::dat.dcSize.cx || rc.bottom + cfg::dat.statusBarHeight > cfg::dat.dcSize.cy) {
- RECT rcWorkArea;
+ case WM_PAINT:
+ {
+ PAINTSTRUCT ps;
+ RECT rc, rcFrame, rcClient;
+ HDC hdc;
+ HRGN rgn = 0;
+ HDC hdcReal = BeginPaint(hwnd, &ps);
- SystemParametersInfo(SPI_GETWORKAREA, 0, &rcWorkArea, FALSE);
- if (API::pfnMonitorFromWindow)
- {
- HMONITOR hMon = API::pfnMonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST);
- MONITORINFO mi;
- mi.cbSize = sizeof(mi);
- if (API::pfnGetMonitorInfo(hMon, &mi))
- rcWorkArea = mi.rcWork;
- }
+ if (during_sizing)
+ rcClient = rcWPC;
+ else
+ GetClientRect(hwnd, &rcClient);
+ CopyRect(&rc, &rcClient);
- cfg::dat.dcSize.cy = max(rc.bottom + cfg::dat.statusBarHeight, rcWorkArea.bottom - rcWorkArea.top);
- cfg::dat.dcSize.cx = max(rc.right, (rcWorkArea.right - rcWorkArea.left) / 2);
+ if ( !cfg::dat.hdcBg || rc.right > cfg::dat.dcSize.cx || rc.bottom + cfg::dat.statusBarHeight > cfg::dat.dcSize.cy) {
+ RECT rcWorkArea;
- if (cfg::dat.hdcBg) {
- SelectObject(cfg::dat.hdcBg, cfg::dat.hbmBgOld);
- DeleteObject(cfg::dat.hbmBg);
- DeleteDC(cfg::dat.hdcBg);
- }
- cfg::dat.hdcBg = CreateCompatibleDC(hdcReal);
- cfg::dat.hbmBg = CreateCompatibleBitmap(hdcReal, cfg::dat.dcSize.cx, cfg::dat.dcSize.cy);
- cfg::dat.hbmBgOld = reinterpret_cast<HBITMAP>(SelectObject(cfg::dat.hdcBg, cfg::dat.hbmBg));
- }
+ SystemParametersInfo(SPI_GETWORKAREA, 0, &rcWorkArea, FALSE);
+ if (API::pfnMonitorFromWindow)
+ {
+ HMONITOR hMon = API::pfnMonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST);
+ MONITORINFO mi;
+ mi.cbSize = sizeof(mi);
+ if (API::pfnGetMonitorInfo(hMon, &mi))
+ rcWorkArea = mi.rcWork;
+ }
- if (cfg::shutDown) {
- EndPaint(hwnd, &ps);
- return 0;
- }
+ cfg::dat.dcSize.cy = max(rc.bottom + cfg::dat.statusBarHeight, rcWorkArea.bottom - rcWorkArea.top);
+ cfg::dat.dcSize.cx = max(rc.right, (rcWorkArea.right - rcWorkArea.left) / 2);
- hdc = cfg::dat.hdcBg;
+ if (cfg::dat.hdcBg) {
+ SelectObject(cfg::dat.hdcBg, cfg::dat.hbmBgOld);
+ DeleteObject(cfg::dat.hbmBg);
+ DeleteDC(cfg::dat.hdcBg);
+ }
+ cfg::dat.hdcBg = CreateCompatibleDC(hdcReal);
+ cfg::dat.hbmBg = CreateCompatibleBitmap(hdcReal, cfg::dat.dcSize.cx, cfg::dat.dcSize.cy);
+ cfg::dat.hbmBgOld = reinterpret_cast<HBITMAP>(SelectObject(cfg::dat.hdcBg, cfg::dat.hbmBg));
+ }
- CopyRect(&rcFrame, &rcClient);
- if (g_CLUISkinnedBkColor) {
- if (cfg::dat.fOnDesktop) {
- HDC dc = GetDC(0);
- RECT rcWin;
+ if (cfg::shutDown) {
+ EndPaint(hwnd, &ps);
+ return 0;
+ }
- GetWindowRect(hwnd, &rcWin);
- BitBlt(hdc, 0, 0, rcClient.right, rcClient.bottom, dc, rcWin.left, rcWin.top, SRCCOPY);
- } else
- FillRect(hdc, &rcClient, g_CLUISkinnedBkColor);
- }
+ hdc = cfg::dat.hdcBg;
- if (cfg::dat.bClipBorder != 0 || cfg::dat.dwFlags & CLUI_FRAME_ROUNDEDFRAME) {
- int docked = CallService(MS_CLIST_DOCKINGISDOCKED, 0, 0);
- int clip = cfg::dat.bClipBorder;
+ CopyRect(&rcFrame, &rcClient);
+ if (g_CLUISkinnedBkColor) {
+ if (cfg::dat.fOnDesktop) {
+ HDC dc = GetDC(0);
+ RECT rcWin;
- if ( !g_CLUISkinnedBkColor)
- FillRect(hdc, &rcClient, cfg::dat.hBrushColorKey);
- if (cfg::dat.dwFlags & CLUI_FRAME_ROUNDEDFRAME)
- rgn = CreateRoundRectRgn(clip, docked ? 0 : clip, rcClient.right - clip + 1, rcClient.bottom - (docked ? 0 : clip - 1), 8 + clip, 8 + clip);
- else
- rgn = CreateRectRgn(clip, docked ? 0 : clip, rcClient.right - clip, rcClient.bottom - (docked ? 0 : clip));
- SelectClipRgn(hdc, rgn);
- }
+ GetWindowRect(hwnd, &rcWin);
+ BitBlt(hdc, 0, 0, rcClient.right, rcClient.bottom, dc, rcWin.left, rcWin.top, SRCCOPY);
+ } else
+ FillRect(hdc, &rcClient, g_CLUISkinnedBkColor);
+ }
- if (g_CLUIImageItem) {
- IMG_RenderImageItem(hdc, g_CLUIImageItem, &rcFrame);
- cfg::dat.ptW.x = cfg::dat.ptW.y = 0;
- ClientToScreen(hwnd, &cfg::dat.ptW);
- goto skipbg;
- }
+ if (cfg::dat.bClipBorder != 0 || cfg::dat.dwFlags & CLUI_FRAME_ROUNDEDFRAME) {
+ int docked = CallService(MS_CLIST_DOCKINGISDOCKED, 0, 0);
+ int clip = cfg::dat.bClipBorder;
- if (cfg::dat.bWallpaperMode)
- FillRect(hdc, &rcClient, cfg::dat.hBrushCLCBk);
- else
- FillRect(hdc, &rcClient, GetSysColorBrush(COLOR_3DFACE));
+ if ( !g_CLUISkinnedBkColor)
+ FillRect(hdc, &rcClient, cfg::dat.hBrushColorKey);
+ if (cfg::dat.dwFlags & CLUI_FRAME_ROUNDEDFRAME)
+ rgn = CreateRoundRectRgn(clip, docked ? 0 : clip, rcClient.right - clip + 1, rcClient.bottom - (docked ? 0 : clip - 1), 8 + clip, 8 + clip);
+ else
+ rgn = CreateRectRgn(clip, docked ? 0 : clip, rcClient.right - clip, rcClient.bottom - (docked ? 0 : clip));
+ SelectClipRgn(hdc, rgn);
+ }
- rcFrame.left += (cfg::dat.bCLeft - 1);
- rcFrame.right -= (cfg::dat.bCRight - 1);
- rcFrame.bottom++;
- rcFrame.bottom -= cfg::dat.statusBarHeight;
- rcFrame.top += (cfg::dat.topOffset - 1);
+ if (g_CLUIImageItem) {
+ IMG_RenderImageItem(hdc, g_CLUIImageItem, &rcFrame);
+ cfg::dat.ptW.x = cfg::dat.ptW.y = 0;
+ ClientToScreen(hwnd, &cfg::dat.ptW);
+ goto skipbg;
+ }
- if (cfg::dat.dwFlags & CLUI_FRAME_CLISTSUNKEN) {
- if (cfg::dat.bWallpaperMode && cfg::clcdat != NULL) {
- InflateRect(&rcFrame, -1, -1);
+ if (cfg::dat.bWallpaperMode)
+ FillRect(hdc, &rcClient, cfg::dat.hBrushCLCBk);
+ else
+ FillRect(hdc, &rcClient, GetSysColorBrush(COLOR_3DFACE));
+
+ rcFrame.left += (cfg::dat.bCLeft - 1);
+ rcFrame.right -= (cfg::dat.bCRight - 1);
+ rcFrame.bottom++;
+ rcFrame.bottom -= cfg::dat.statusBarHeight;
+ rcFrame.top += (cfg::dat.topOffset - 1);
+
+ if (cfg::dat.dwFlags & CLUI_FRAME_CLISTSUNKEN) {
+ if (cfg::dat.bWallpaperMode && cfg::clcdat != NULL) {
+ InflateRect(&rcFrame, -1, -1);
+ if (cfg::dat.bmpBackground)
+ BlitWallpaper(hdc, &rcFrame, &ps.rcPaint, cfg::clcdat);
+ cfg::dat.ptW.x = cfg::dat.ptW.y = 0;
+ ClientToScreen(hwnd, &cfg::dat.ptW);
+ }
+ InflateRect(&rcFrame, 1, 1);
+ if (cfg::dat.bSkinnedButtonMode)
+ rcFrame.bottom -= (cfg::dat.bottomOffset);
+ DrawEdge(hdc, &rcFrame, BDR_SUNKENOUTER, BF_RECT);
+ } else if (cfg::dat.bWallpaperMode && cfg::clcdat != NULL) {
if (cfg::dat.bmpBackground)
BlitWallpaper(hdc, &rcFrame, &ps.rcPaint, cfg::clcdat);
cfg::dat.ptW.x = cfg::dat.ptW.y = 0;
ClientToScreen(hwnd, &cfg::dat.ptW);
}
- InflateRect(&rcFrame, 1, 1);
- if (cfg::dat.bSkinnedButtonMode)
- rcFrame.bottom -= (cfg::dat.bottomOffset);
- DrawEdge(hdc, &rcFrame, BDR_SUNKENOUTER, BF_RECT);
- } else if (cfg::dat.bWallpaperMode && cfg::clcdat != NULL) {
- if (cfg::dat.bmpBackground)
- BlitWallpaper(hdc, &rcFrame, &ps.rcPaint, cfg::clcdat);
- cfg::dat.ptW.x = cfg::dat.ptW.y = 0;
- ClientToScreen(hwnd, &cfg::dat.ptW);
- }
skipbg:
- BitBlt(hdcReal, 0, 0, rcClient.right - rcClient.left, rcClient.bottom - rcClient.top, hdc, 0, 0, SRCCOPY);
- if (rgn) {
- SelectClipRgn(hdc, NULL);
- DeleteObject(rgn);
+ BitBlt(hdcReal, 0, 0, rcClient.right - rcClient.left, rcClient.bottom - rcClient.top, hdc, 0, 0, SRCCOPY);
+ if (rgn) {
+ SelectClipRgn(hdc, NULL);
+ DeleteObject(rgn);
+ }
+ EndPaint(hwnd, &ps);
}
- EndPaint(hwnd, &ps);
return 0;
- }
- case WM_ENTERSIZEMOVE: {
- RECT rc;
- POINT pt = {0};
-
- GetWindowRect(hwnd, &g_PreSizeRect);
- GetClientRect(hwnd, &rc);
- ClientToScreen(hwnd, &pt);
- g_CLUI_x_off = pt.x - g_PreSizeRect.left;
- g_CLUI_y_off = pt.y - g_PreSizeRect.top;
- pt.x = rc.right;
- ClientToScreen(hwnd, &pt);
- g_CLUI_x1_off = g_PreSizeRect.right - pt.x;
- pt.x = 0;
- pt.y = rc.bottom;
- ClientToScreen(hwnd, &pt);
- g_CLUI_y1_off = g_PreSizeRect.bottom - pt.y;
- //g_CluiData.neeedSnap = TRUE;
+
+ case WM_ENTERSIZEMOVE:
+ {
+ RECT rc;
+ POINT pt = {0};
+
+ GetWindowRect(hwnd, &g_PreSizeRect);
+ GetClientRect(hwnd, &rc);
+ ClientToScreen(hwnd, &pt);
+ g_CLUI_x_off = pt.x - g_PreSizeRect.left;
+ g_CLUI_y_off = pt.y - g_PreSizeRect.top;
+ pt.x = rc.right;
+ ClientToScreen(hwnd, &pt);
+ g_CLUI_x1_off = g_PreSizeRect.right - pt.x;
+ pt.x = 0;
+ pt.y = rc.bottom;
+ ClientToScreen(hwnd, &pt);
+ g_CLUI_y1_off = g_PreSizeRect.bottom - pt.y;
+ }
break;
- }
+
case WM_EXITSIZEMOVE:
- //g_CluiData.neeedSnap = FALSE;
PostMessage(hwnd, CLUIINTM_REDRAW, 0, 0);
- //RedrawWindow(hwnd,NULL,NULL,RDW_INVALIDATE|RDW_ERASE|RDW_FRAME|RDW_UPDATENOW|RDW_ALLCHILDREN);
break;
- case WM_SIZING: {
- RECT *szrect = (RECT *)lParam;
+ case WM_SIZING:
break;
+ /*
+ RECT *szrect = (RECT *)lParam;
if (Docking_IsDocked(0, 0))
break;
g_SizingRect = *((RECT *)lParam);
@@ -1056,25 +1059,19 @@ skipbg:
szrect->bottom = g_PreSizeRect.bottom;
if (wParam != WMSZ_RIGHT && wParam != WMSZ_BOTTOMRIGHT && wParam != WMSZ_TOPRIGHT)
szrect->right = g_PreSizeRect.right;
+ */
return TRUE;
- }
case WM_WINDOWPOSCHANGED:
- if ( !Docking_IsDocked(0, 0))
- return(0);
- else
+ if ( Docking_IsDocked(0, 0))
break;
- case WM_WINDOWPOSCHANGING: {
- WINDOWPOS *wp = (WINDOWPOS *)lParam;
-
- if (wp && wp->flags & SWP_NOSIZE)
- return FALSE;
-
- //if (Docking_IsDocked(0, 0))
- // break;
-
+ case WM_WINDOWPOSCHANGING:
if (pcli->hwndContactList != NULL) {
+ WINDOWPOS *wp = (WINDOWPOS *)lParam;
+ if (wp && wp->flags & SWP_NOSIZE)
+ return FALSE;
+
RedrawWindow(hwnd, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW);
during_sizing = true;
@@ -1091,8 +1088,8 @@ skipbg:
if (wp->cx != g_oldSize.cx)
SendMessage(hwnd, CLUIINTM_STATUSBARUPDATE, 0, 0);
RedrawWindow(pcli->hwndStatus, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW);
- } else
- cfg::dat.statusBarHeight = 0;
+ }
+ else cfg::dat.statusBarHeight = 0;
SizeFramesByWindowRect(&new_window_rect);
dock_prevent_moving = 0;
@@ -1103,16 +1100,11 @@ skipbg:
g_oldSize.cx = wp->cx;
g_oldSize.cy = wp->cy;
rcWPC = new_window_rect;
-
- during_sizing = false;
}
during_sizing = false;
- return(0);
- }
-
- case WM_SIZE: {
- RECT rc;
+ return 0;
+ case WM_SIZE:
if ((wParam == 0 && lParam == 0) || Docking_IsDocked(0, 0)) {
if (IsZoomed(hwnd))
@@ -1120,8 +1112,9 @@ skipbg:
if (pcli->hwndContactList != 0) {
SendMessage(hwnd, WM_ENTERSIZEMOVE, 0, 0);
+ RECT rc;
GetWindowRect(hwnd, &rc);
- WINDOWPOS wp = {0};
+ WINDOWPOS wp = {0};
wp.cx = rc.right - rc.left;
wp.cy = rc.bottom - rc.top;
wp.x = rc.left;
@@ -1131,7 +1124,7 @@ skipbg:
SendMessage(hwnd, WM_EXITSIZEMOVE, 0, 0);
}
}
- }
+
case WM_MOVE:
if ( !IsIconic(hwnd)) {
RECT rc;
@@ -1269,6 +1262,7 @@ skipbg:
PostMessage(hwnd, CLUIINTM_REDRAW, 0, 0);
}
return TRUE;
+
case WM_SHOWWINDOW:
{
static int noRecurse = 0;
@@ -1692,19 +1686,18 @@ buttons_done:
}
if (dis->hwndItem == pcli->hwndStatus) {
ProtocolData *pd = (ProtocolData *)dis->itemData;
- int nParts = SendMessage(pcli->hwndStatus, SB_GETPARTS, 0, 0);
- char *szProto;
- int status, x;
- SIZE textSize;
- BYTE showOpts = cfg::getByte("CLUI", "SBarShow", 1);
if (IsBadCodePtr((FARPROC)pd))
return TRUE;
if (cfg::shutDown)
return TRUE;
- szProto = pd->RealName;
- status = CallProtoService(szProto, PS_GETSTATUS, 0, 0);
+
+ int nParts = SendMessage(pcli->hwndStatus, SB_GETPARTS, 0, 0);
+ SIZE textSize;
+ BYTE showOpts = cfg::getByte("CLUI", "SBarShow", 1);
+ char *szProto = pd->RealName;
+ int status = CallProtoService(szProto, PS_GETSTATUS, 0, 0);
SetBkMode(dis->hDC, TRANSPARENT);
- x = dis->rcItem.left;
+ int x = dis->rcItem.left;
if (showOpts & 1) {
HICON hIcon;
diff --git a/plugins/Clist_nicer/src/cluiopts.cpp b/plugins/Clist_nicer/src/cluiopts.cpp
index c2b5ced4d0..82513b0b05 100644
--- a/plugins/Clist_nicer/src/cluiopts.cpp
+++ b/plugins/Clist_nicer/src/cluiopts.cpp
@@ -25,7 +25,6 @@ UNICODE done
*/
#include "commonheaders.h"
-extern WNDPROC OldStatusBarProc;
extern HANDLE hExtraImageApplying;
extern SIZE g_oldSize;
extern POINT g_oldPos;
@@ -406,12 +405,14 @@ INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
int flags = WS_CHILD | CCS_BOTTOM;
cfg::writeByte("CLUI", "ShowGrip", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_SHOWGRIP));
ShowWindow(pcli->hwndStatus, SW_HIDE);
- SetWindowLongPtr(pcli->hwndStatus, GWLP_WNDPROC, (LONG_PTR)OldStatusBarProc);
+ mir_unsubclassWindow(pcli->hwndStatus, NewStatusBarWndProc);
DestroyWindow(pcli->hwndStatus);
+
flags |= cfg::getByte("CLUI", "ShowSBar", 1) ? WS_VISIBLE : 0;
flags |= cfg::getByte("CLUI", "ShowGrip", 1) ? SBARS_SIZEGRIP : 0;
+
pcli->hwndStatus = CreateWindow(STATUSCLASSNAME, NULL, flags, 0, 0, 0, 0, parent, NULL, g_hInst, NULL);
- OldStatusBarProc = (WNDPROC)SetWindowLongPtr(pcli->hwndStatus, GWLP_WNDPROC, (LONG_PTR)NewStatusBarWndProc);
+ mir_subclassWindow(pcli->hwndStatus, NewStatusBarWndProc);
}
if (IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR)) {
ShowWindow(pcli->hwndStatus, SW_SHOW);
diff --git a/plugins/Clist_nicer/src/statusbar.cpp b/plugins/Clist_nicer/src/statusbar.cpp
index cdb83b3e66..98ac8c008e 100644
--- a/plugins/Clist_nicer/src/statusbar.cpp
+++ b/plugins/Clist_nicer/src/statusbar.cpp
@@ -23,8 +23,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <commonheaders.h>
#include "../CLUIFrames/cluiframes.h"
-WNDPROC OldStatusBarProc = 0;
-
static POINT ptMouse = {0};
static RECT rcMouse = {0};
static int timer_set = 0, tooltip_active = 0;
@@ -91,13 +89,8 @@ LRESULT CALLBACK NewStatusBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
PAINTSTRUCT ps;
HDC hdc = BeginPaint(hwnd, &ps);
HDC hdcMem = CreateCompatibleDC(hdc);
- HBITMAP hbmMem, hbmOld;
RECT rcClient, rcWindow;
- StatusItems_t *item = NULL;
DRAWITEMSTRUCT dis = {0};
- int nParts = 0;
- int i;
- HFONT hOldFont = 0;
POINT pt;
BYTE windowStyle = cfg::getByte("CLUI", "WindowStyle", SETTING_WINDOWSTYLE_DEFAULT);
LONG b_offset = cfg::dat.bClipBorder + (windowStyle == SETTING_WINDOWSTYLE_NOBORDER ? 2 : (windowStyle == SETTING_WINDOWSTYLE_THINBORDER ? 1 : 0));
@@ -108,12 +101,12 @@ LRESULT CALLBACK NewStatusBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
pt.y = rcWindow.top;
ScreenToClient(pcli->hwndContactList, &pt);
- hbmMem = CreateCompatibleBitmap(hdc, rcClient.right, rcClient.bottom);
- hbmOld = reinterpret_cast<HBITMAP>(SelectObject(hdcMem, hbmMem));
+ HBITMAP hbmMem = CreateCompatibleBitmap(hdc, rcClient.right, rcClient.bottom);
+ HBITMAP hbmOld = reinterpret_cast<HBITMAP>(SelectObject(hdcMem, hbmMem));
SetBkMode(hdcMem, TRANSPARENT);
- hOldFont = reinterpret_cast<HFONT>(SelectObject(hdcMem, GetStockObject(DEFAULT_GUI_FONT)));
+ HFONT hOldFont = reinterpret_cast<HFONT>(SelectObject(hdcMem, GetStockObject(DEFAULT_GUI_FONT)));
BitBlt(hdcMem, 0, 0, rcClient.right, rcClient.bottom, cfg::dat.hdcBg, pt.x, pt.y, SRCCOPY);
- item = arStatusItems[ID_EXTBKSTATUSBAR - ID_STATUS_OFFLINE];
+ StatusItems_t *item = arStatusItems[ID_EXTBKSTATUSBAR - ID_STATUS_OFFLINE];
if ( !item->IGNORED) {
RECT rc = rcClient;
rc.left += item->MARGIN_LEFT;
@@ -123,14 +116,14 @@ LRESULT CALLBACK NewStatusBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
DrawAlpha(hdcMem, &rc, item->COLOR, item->ALPHA, item->COLOR2, item->COLOR2_TRANSPARENT, item->GRADIENT,
item->CORNER, item->BORDERSTYLE, item->imageItem);
SetTextColor(hdcMem, item->TEXTCOLOR);
- }else{
- SetTextColor(hdcMem, GetSysColor(COLOR_BTNTEXT));
}
+ else SetTextColor(hdcMem, GetSysColor(COLOR_BTNTEXT));
+
dis.hwndItem = hwnd;
dis.hDC = hdcMem;
dis.CtlType = 0;
- nParts = SendMessage(hwnd, SB_GETPARTS, 0, 0);
- for (i = 0; i < nParts; i++) {
+ int nParts = SendMessage(hwnd, SB_GETPARTS, 0, 0);
+ for (int i = 0; i < nParts; i++) {
SendMessage(hwnd, SB_GETRECT, i, (LPARAM)&dis.rcItem);
OffsetRect(&dis.rcItem, 0, -b_offset);
dis.itemData = SendMessage(hwnd, SB_GETTEXTA, i, 0);