How to detect windows8.1 start menu?

最后都变了- 提交于 2019-12-02 18:12:56

问题


When we press start menu on windows 8.1 it show up all new start menu with apps in form of tiles. This menu shows up on entire screen. Is there a way to detect if this menu is open in c++. Is there a winAPI to do so in 8.1 SDK.

Thanks in advance.


回答1:


Call CoCreateInstance(CLSID_AppVisibility,...) to get the object that implements IAppVisibility then call IAppVisibility::IsLauncherVisible to see if the start menu is visible.

This is demonstrated in the Start screen visibility sample




回答2:


I am unsure about whether there exists a dedicated WinAPI call, but what you could do is run EnumWindows with the start menu open and closed to determine the window handle and then examine its class and other parameters - that way if you know how to identify it you can always perform the same logic in your program - enumerate the windows, find the handle of the start menu, check if it is visible.




回答3:


you have to use hook, a special hook for shell https://msdn.microsoft.com/en-us/library/windows/desktop/ms644991%28v=vs.85%29.aspx, then on HSHELL_WINDOWACTIVATED event check for the ClassName of the returned GetForegroundWindow()



来源:https://stackoverflow.com/questions/33105881/how-to-detect-windows8-1-start-menu

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!