diff --git a/hotcorner.c b/hotcorner.c index 84f0384..7b9a7a0 100644 --- a/hotcorner.c +++ b/hotcorner.c @@ -1,6 +1,7 @@ #define WIN32_LEAN_AND_MEAN #include #include +#include #pragma comment(lib, "USER32") #pragma comment(linker, "/SUBSYSTEM:WINDOWS") @@ -90,6 +91,7 @@ static DWORD WINAPI CornerHotFunc(LPVOID lpParameter) static LRESULT CALLBACK MouseHookCallback(int nCode, WPARAM wParam, LPARAM lParam) { MSLLHOOKSTRUCT *evt = (MSLLHOOKSTRUCT *) lParam; + QUERY_USER_NOTIFICATION_STATE pquns; // If the mouse hasn't moved, we're done. if (wParam != WM_MOUSEMOVE) @@ -123,6 +125,17 @@ static LRESULT CALLBACK MouseHookCallback(int nCode, WPARAM wParam, LPARAM lPara goto finish; } + // Check if an app is currently fullscreen. + SHQueryUserNotificationState(&pquns); + + switch (pquns) { + case QUNS_BUSY: + case QUNS_RUNNING_D3D_FULL_SCREEN: + case QUNS_PRESENTATION_MODE: + goto finish; + default: + } + // The corner is hot, and was previously cold. Here we start a thread to // monitor if the mouse lingers. CornerThread = CreateThread(NULL, 0, CornerHotFunc, NULL, 0, NULL);