Additional changes to 1d38698

This commit is contained in:
Birunthan Mohanathas 2012-06-19 17:15:51 +03:00
parent 54fcd21e03
commit c9ae008cd7

View File

@ -95,24 +95,28 @@ LRESULT CALLBACK CDialog::MenuButtonProc(HWND hWnd, UINT uMsg, WPARAM wParam, LP
{ {
case WM_PAINT: case WM_PAINT:
{ {
DefSubclassProc(hWnd, uMsg, wParam, lParam); LRESULT result = DefSubclassProc(hWnd, uMsg, wParam, lParam);
// Draw arrow on top of the button // Draw arrow on top of the button
HDC dc = GetDC(hWnd);
RECT buttonRect; RECT buttonRect;
GetClientRect(hWnd, &buttonRect); GetClientRect(hWnd, &buttonRect);
int arrowX = buttonRect.right - 18; int arrowX = buttonRect.right - 18;
int arroyY = buttonRect.top + 4; int arrowY = buttonRect.top + 4;
RECT arrowRect = { arrowX, arroyY, arrowX + 14, arroyY + 14 }; RECT arrowRect = { arrowX, arrowY, arrowX + 14, arrowY + 14 };
HDC dc = GetDC(hWnd);
const WORD DFCS_MENUARROWDOWN = 0x0010; // Undocumented const WORD DFCS_MENUARROWDOWN = 0x0010; // Undocumented
DWORD drawFlags = DFCS_TRANSPARENT | DFCS_MENUARROWDOWN | (IsWindowEnabled(hWnd) ? 0 : DFCS_INACTIVE); DWORD drawFlags = DFCS_TRANSPARENT | DFCS_MENUARROWDOWN | (IsWindowEnabled(hWnd) ? 0 : DFCS_INACTIVE);
DrawFrameControl(dc, &arrowRect, DFC_MENU, drawFlags); DrawFrameControl(dc, &arrowRect, DFC_MENU, drawFlags);
ReleaseDC(hWnd, dc); ReleaseDC(hWnd, dc);
return 0;
return result;
} }
break; break;
case WM_NCDESTROY:
RemoveWindowSubclass(hWnd, MenuButtonProc, uIdSubclass);
break;
} }
return DefSubclassProc(hWnd, uMsg, wParam, lParam); return DefSubclassProc(hWnd, uMsg, wParam, lParam);