我试图找出一个窗口是否属于当前的虚拟桌面。
我从 winapi 中找到了 VirtualDesktopManager 类,但即使根据 here 它应该位于“shobjidl.h” header 中,当我编译代码时,它会抛出这个错误:
85:5: error: 'VirtualDesktopManager' was not declared in this scope
我的代码的重要部分:
#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();
我怎样才能使这项工作?
最佳答案
显然,我正在使用的 mingw64 中的“shobjidl.h” header 中不包含此接口(interface),在 Visual Studio 中运行它会找到它。所以问题出在标题中。
关于c++ - 如何使用 VirtualDesktopManager 界面?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62224066/