From f0425495bc0debd439afba2ff562b55043a58671 Mon Sep 17 00:00:00 2001 From: narzoul Date: Sat, 30 Apr 2016 20:43:45 +0200 Subject: [PATCH] Updated disabling of immersive context menus --- DDrawCompat/CompatGdiPaintHandlers.cpp | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/DDrawCompat/CompatGdiPaintHandlers.cpp b/DDrawCompat/CompatGdiPaintHandlers.cpp index 904e18e..28a8410 100644 --- a/DDrawCompat/CompatGdiPaintHandlers.cpp +++ b/DDrawCompat/CompatGdiPaintHandlers.cpp @@ -86,6 +86,23 @@ namespace return defPaintProc(hwnd, msg, wParam, lParam, CALL_ORIG_FUNC(DefWindowProcW), "defWindowProcW"); } + void disableImmersiveContextMenus() + { + // Immersive context menus don't display properly (empty items) when theming is disabled + CompatRegistry::setValue( + HKEY_LOCAL_MACHINE, + "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FlightedFeatures", + "ImmersiveContextMenu", + 0); + + // An update in Windows 10 seems to have moved the key from the above location + CompatRegistry::setValue( + HKEY_LOCAL_MACHINE, + "Software\\Microsoft\\Windows\\CurrentVersion\\FlightedFeatures", + "ImmersiveContextMenu", + 0); + } + LRESULT WINAPI editWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { LRESULT result = defPaintProc(hwnd, msg, wParam, lParam, g_origEditWndProc, "editWndProc"); @@ -303,12 +320,7 @@ namespace CompatGdiPaintHandlers { void installHooks() { - // Immersive context menus don't display properly (empty items) when theming is disabled - CompatRegistry::setValue( - HKEY_LOCAL_MACHINE, - "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FlightedFeatures", - "ImmersiveContextMenu", - 0); + disableImmersiveContextMenus(); CompatGdi::hookWndProc("ComboLBox", g_origComboListBoxWndProc, &comboListBoxWndProc); CompatGdi::hookWndProc("Edit", g_origEditWndProc, &editWndProc);