From c9ae008cd7138333f6934b50e3d3081112db65cf Mon Sep 17 00:00:00 2001 From: Birunthan Mohanathas Date: Tue, 19 Jun 2012 17:15:51 +0300 Subject: [PATCH] Additional changes to 1d38698 --- Library/Dialog.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/Library/Dialog.cpp b/Library/Dialog.cpp index ad7a5a8e..e0f48734 100644 --- a/Library/Dialog.cpp +++ b/Library/Dialog.cpp @@ -95,27 +95,31 @@ LRESULT CALLBACK CDialog::MenuButtonProc(HWND hWnd, UINT uMsg, WPARAM wParam, LP { case WM_PAINT: { - DefSubclassProc(hWnd, uMsg, wParam, lParam); + LRESULT result = DefSubclassProc(hWnd, uMsg, wParam, lParam); // Draw arrow on top of the button - HDC dc = GetDC(hWnd); RECT buttonRect; GetClientRect(hWnd, &buttonRect); - int arrowX = buttonRect.right - 18; - int arroyY = buttonRect.top + 4; - RECT arrowRect = { arrowX, arroyY, arrowX + 14, arroyY + 14 }; + int arrowY = buttonRect.top + 4; + RECT arrowRect = { arrowX, arrowY, arrowX + 14, arrowY + 14 }; - const WORD DFCS_MENUARROWDOWN = 0x0010; // Undocumented + HDC dc = GetDC(hWnd); + const WORD DFCS_MENUARROWDOWN = 0x0010; // Undocumented DWORD drawFlags = DFCS_TRANSPARENT | DFCS_MENUARROWDOWN | (IsWindowEnabled(hWnd) ? 0 : DFCS_INACTIVE); DrawFrameControl(dc, &arrowRect, DFC_MENU, drawFlags); ReleaseDC(hWnd, dc); - return 0; + + return result; } break; + + case WM_NCDESTROY: + RemoveWindowSubclass(hWnd, MenuButtonProc, uIdSubclass); + break; } - return DefSubclassProc(hWnd, uMsg, wParam, lParam); + return DefSubclassProc(hWnd, uMsg, wParam, lParam); } /*