From 96ba6c4b5be3b13d776cfa853d5f76183d572989 Mon Sep 17 00:00:00 2001 From: narzoul Date: Mon, 21 Mar 2016 23:30:53 +0100 Subject: [PATCH] Handle undocumented menu selection change message Now the selection is properly cleared also when the mouse leaves the menu window area. --- DDrawCompat/CompatGdiPaintHandlers.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/DDrawCompat/CompatGdiPaintHandlers.cpp b/DDrawCompat/CompatGdiPaintHandlers.cpp index 45ff652..272e78b 100644 --- a/DDrawCompat/CompatGdiPaintHandlers.cpp +++ b/DDrawCompat/CompatGdiPaintHandlers.cpp @@ -118,6 +118,14 @@ namespace result = onMenuPaint(hwnd, g_origMenuWndProc); break; + case 0x1e5: + if (-1 == wParam) + { + // Clearing of selection is not caught by WM_MENUSELECT when mouse leaves menu window + RedrawWindow(hwnd, nullptr, nullptr, RDW_INVALIDATE); + } + // fall through to default + default: result = g_origMenuWndProc(hwnd, msg, wParam, lParam); break;