user32: Restore the dc's colours after sending WM_DRAWITEM.

Huw Davies huw at codeweavers.com
Mon Nov 2 04:10:54 CST 2015


Signed-off-by: Huw Davies <huw at codeweavers.com>
---
 dlls/user32/menu.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/dlls/user32/menu.c b/dlls/user32/menu.c
index 847540b..2db18b4 100644
--- a/dlls/user32/menu.c
+++ b/dlls/user32/menu.c
@@ -1458,6 +1458,7 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc,
         ** the menu owner has finished drawing.
         */
         DRAWITEMSTRUCT dis;
+        COLORREF old_bk, old_text;
 
         dis.CtlType   = ODT_MENU;
 	dis.CtlID     = 0;
@@ -1475,8 +1476,12 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc,
 	      "hwndItem=%p, hdc=%p, rcItem=%s\n", hwndOwner,
 	      dis.itemID, dis.itemState, dis.itemAction, dis.hwndItem,
 	      dis.hDC, wine_dbgstr_rect( &dis.rcItem));
+        old_bk = GetBkColor( hdc );
+        old_text = GetTextColor( hdc );
         SendMessageW( hwndOwner, WM_DRAWITEM, 0, (LPARAM)&dis );
         /* Draw the popup-menu arrow */
+        SetBkColor( hdc, old_bk );
+        SetTextColor( hdc, old_text );
         if (lpitem->fType & MF_POPUP)
             draw_popup_arrow( hdc, rect, arrow_bitmap_width,
                     arrow_bitmap_height);
-- 
1.8.0




More information about the wine-patches mailing list