From 65581438d0dbadfe5c6e01c55911a96b6b01ca62 Mon Sep 17 00:00:00 2001 From: Valentin-Gabriel Radu Date: Fri, 13 Aug 2021 07:23:45 +0300 Subject: [PATCH] Optimize hooking of Windows key when only one monitor is connected --- ExplorerPatcherLibrary/dllmain.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ExplorerPatcherLibrary/dllmain.c b/ExplorerPatcherLibrary/dllmain.c index c2104a8..c32df55 100644 --- a/ExplorerPatcherLibrary/dllmain.c +++ b/ExplorerPatcherLibrary/dllmain.c @@ -666,7 +666,7 @@ LRESULT CALLBACK OpenStartOnCurentMonitorThreadHook( if (code == HC_ACTION && wParam) { MSG* msg = (MSG*)lParam; - if (msg->message == WM_SYSCOMMAND && (msg->wParam & 0xFFF0) == SC_TASKLIST) + if (GetSystemMetrics(SM_CMONITORS) >= 2 && msg->message == WM_SYSCOMMAND && (msg->wParam & 0xFFF0) == SC_TASKLIST) { BOOL bShouldCheckHKLM = FALSE; HKEY hKey; @@ -999,4 +999,4 @@ BOOL WINAPI DllMain( break; } return TRUE; -} \ No newline at end of file +}