From 58279fbd34d1f7931cafeaa89bb3712d5a3b4690 Mon Sep 17 00:00:00 2001 From: Dimitriy Ryazantcev Date: Mon, 3 Dec 2012 01:06:15 +0200 Subject: [PATCH 2/2] Kinotify: Now using native notification state query on Windows Vista and later. Closes bug #888. --- src/plugins/kinotify/fswinwatcher_win.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/plugins/kinotify/fswinwatcher_win.cpp b/src/plugins/kinotify/fswinwatcher_win.cpp index 4d06933..9661654 100644 --- a/src/plugins/kinotify/fswinwatcher_win.cpp +++ b/src/plugins/kinotify/fswinwatcher_win.cpp @@ -20,6 +20,9 @@ #include "fswinwatcher.h" #include #include +#if (NTDDI_VERSION >= NTDDI_VISTA) +#include +#endif namespace LeechCraft { @@ -33,6 +36,12 @@ namespace Kinotify bool FSWinWatcher::IsCurrentFS () { +#if (NTDDI_VERSION >= NTDDI_VISTA) + QUERY_USER_NOTIFICATION_STATE state; + if (SHQueryUserNotificationState (&state) != S_OK) + return false; + return state != QUNS_ACCEPTS_NOTIFICATIONS; +#else HWND hWnd = GetForegroundWindow (); if (!hWnd) return false; @@ -51,6 +60,7 @@ namespace Kinotify GetWindowRect (hWnd, &windowRect); return EqualRect (&windowRect, &monitorRect) && Proxy_->GetMainWindow ()->effectiveWinId () != hWnd; +#endif } } } -- 1.7.11.msysgit.1