I'm trying to find out if a window belongs to the current virtual desktop.
I found the VirtualDesktopManager class form the winapi, but even though it is supposed to be in the "shobjidl.h" header according to here, when I compile the code it throws this error:
85:5: error: 'VirtualDesktopManager' was not declared in this scope
important piece of my code:
#include <shobjidl.h>
...
BOOL is_on_current_desktop = FALSE;
VirtualDesktopManager g_pvdm;
g_pvdm.IsWindowOnCurrentVirtualDesktop(hwnd, &is_on_current_desktop); // hwnd is a window handle acquired previously
g_pvdm.Release();
How could I make this work?