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:
{
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 };
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);