Project

General

Profile

Feature #888 ยป 0002-Kinotify-Now-using-native-notification-state-query-o.patch

DJm00n, 12/03/2012 12:07 AM

View differences:

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
}
}
}
    (1-1/1)