1
0
mirror of https://github.com/narzoul/DDrawCompat synced 2024-12-30 08:55:36 +01:00

Updated disabling of immersive context menus

This commit is contained in:
narzoul 2016-04-30 20:43:45 +02:00
parent 441d7794cd
commit f0425495bc

View File

@ -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);