summaryrefslogtreecommitdiff
path: root/src/modules/options/iconheader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/options/iconheader.cpp')
-rw-r--r--src/modules/options/iconheader.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/modules/options/iconheader.cpp b/src/modules/options/iconheader.cpp
index 0bdbd3209d..6b51a0afe9 100644
--- a/src/modules/options/iconheader.cpp
+++ b/src/modules/options/iconheader.cpp
@@ -258,15 +258,10 @@ static void MIcoTab_DrawItem(HWND hwnd, HDC hdc, MIcoTabCtrl *dat, MIcoTab *tab,
static LRESULT MIcoTab_OnPaint(HWND hwndDlg, MIcoTabCtrl *mit, UINT msg, WPARAM wParam, LPARAM lParam)
{
PAINTSTRUCT ps;
- HBITMAP hBmp, hOldBmp;
- RECT temprc;
- int i;
HDC hdc = BeginPaint(hwndDlg, &ps);
HDC tempDC = CreateCompatibleDC(hdc);
- HFONT hFont = 0;
-
BITMAPINFO bmi;
bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
bmi.bmiHeader.biWidth = mit->width;
@@ -274,11 +269,12 @@ static LRESULT MIcoTab_OnPaint(HWND hwndDlg, MIcoTabCtrl *mit, UINT msg, WPARAM
bmi.bmiHeader.biPlanes = 1;
bmi.bmiHeader.biBitCount = 32;
bmi.bmiHeader.biCompression = BI_RGB;
- hBmp = CreateDIBSection(tempDC, &bmi, DIB_RGB_COLORS, NULL, NULL, 0);
+ HBITMAP hBmp = CreateDIBSection(tempDC, &bmi, DIB_RGB_COLORS, NULL, NULL, 0);
- hOldBmp = (HBITMAP)SelectObject(tempDC, hBmp);
+ HBITMAP hOldBmp = (HBITMAP)SelectObject(tempDC, hBmp);
if (IsAeroMode()) {
+ RECT temprc;
temprc.left = 0;
temprc.right = mit->width;
temprc.top = 0;
@@ -299,11 +295,11 @@ static LRESULT MIcoTab_OnPaint(HWND hwndDlg, MIcoTabCtrl *mit, UINT msg, WPARAM
} }
//Draw Items
- hFont = mit->hFont;
- SelectObject(tempDC, hFont);
+ HFONT hFont = mit->hFont;
+ HFONT hOldFont = (HFONT)SelectObject(tempDC, hFont);
SetBkMode(tempDC, TRANSPARENT);
- for (i=0; i<mit->pList.getCount(); i++) {
+ for (int i=0; i<mit->pList.getCount(); i++) {
MIcoTab *tab = (MIcoTab *)mit->pList[i];
MIcoTab_DrawItem(hwndDlg, tempDC, mit, tab, i);
}
@@ -312,6 +308,7 @@ static LRESULT MIcoTab_OnPaint(HWND hwndDlg, MIcoTabCtrl *mit, UINT msg, WPARAM
BitBlt(hdc, mit->rc.left, mit->rc.top, mit->width, mit->height, tempDC, 0, 0, SRCCOPY);
SelectObject(tempDC, hOldBmp);
DeleteObject(hBmp);
+ SelectObject(tempDC,hOldFont);
DeleteDC(tempDC);
EndPaint(hwndDlg, &ps);