Feature #888 ยป 0002-Kinotify-Now-using-native-notification-state-query-o.patch
src/plugins/kinotify/fswinwatcher_win.cpp | ||
---|---|---|
#include "fswinwatcher.h"
|
||
#include <QMainWindow>
|
||
#include <windows.h>
|
||
#if (NTDDI_VERSION >= NTDDI_VISTA)
|
||
#include <shellapi.h>
|
||
#endif
|
||
namespace LeechCraft
|
||
{
|
||
... | ... | |
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;
|
||
... | ... | |
GetWindowRect (hWnd, &windowRect);
|
||
return EqualRect (&windowRect, &monitorRect) &&
|
||
Proxy_->GetMainWindow ()->effectiveWinId () != hWnd;
|
||
#endif
|
||
}
|
||
}
|
||
}
|