From ad1bd063790ee39e1eec167674e733b97de6df1d Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 6 Aug 2012 17:24:35 +0000 Subject: fix for 32x32 icons in buttons git-svn-id: http://svn.miranda-ng.org/main/trunk@1384 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/button/button.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/modules') diff --git a/src/modules/button/button.cpp b/src/modules/button/button.cpp index f1592c8ada..931295e7af 100644 --- a/src/modules/button/button.cpp +++ b/src/modules/button/button.cpp @@ -190,7 +190,13 @@ static void PaintWorker(MButtonCtrl *ctl, HDC hdcPaint) iy++; } - DrawState(hdcMem, NULL, NULL, (LPARAM)ctl->hIcon, 0, ix, iy, g_cxsmIcon, g_cysmIcon, IsWindowEnabled(ctl->hwnd) ? DST_ICON | DSS_NORMAL : DST_ICON | DSS_DISABLED); + HIMAGELIST hImageList = ImageList_Create(g_cxsmIcon, g_cysmIcon, ILC_MASK | (IsWinVerXPPlus() ? ILC_COLOR32 : ILC_COLOR16), 1, 0); + ImageList_AddIcon(hImageList, ctl->hIcon); + HICON hIconNew = ImageList_GetIcon(hImageList, 0, ILD_NORMAL); + DrawState(hdcMem, NULL, NULL, (LPARAM) hIconNew, 0, ix, iy, g_cxsmIcon, g_cysmIcon, DST_ICON | (IsWindowEnabled(ctl->hwnd) ? DSS_NORMAL : DSS_DISABLED)); + ImageList_RemoveAll(hImageList); + ImageList_Destroy(hImageList); + DestroyIcon(hIconNew); } else if (ctl->hBitmap) { BITMAP bminfo; -- cgit v1.2.3