有没有办法查明 Metro UI 面板在 Windows 10 中是否可见?

Is there a way to find out whether the Metro UI panels are visible in Windows 10?

在Windows10中有几个menus/panels可以从任务栏打开,比如"action center"和"volume panel"等,那些windows如果我尝试使用 EnumWindows(),则不会被枚举,我找到了一个解决方法——我没有使用 EnumWindows(),而是使用了 FinWindowEx(),现在我可以枚举那些面板和其他 Metro UI 特定菜单。

唯一的问题是我无法确定它们是否可见。如果我尝试调用 IsWindowVisible() 并将 "action center" HWND 作为参数传递,函数总是 returns TRUE。我在其他 Metro UI 面板(电池使用面板、音量面板、搜索面板等)上得到的结果相同。

我刚刚找到了解决方案。由于至今没有答案,我认为这是最好的解决方案(目前我不知道其他解决问题的方法)。

所以基本上为了识别 window 是否可见,我调用 DwmGetWindowAttribute() 函数(除了 IsWindowVisible())传递 DWMA_CLOAKED 作为第二个参数。当 Windows 10 个特定面板在屏幕上可见时,此属性设置为 0