How to detect windows8.1 start menu?

后端 未结 3 1280
北海茫月
北海茫月 2021-01-29 00:23

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 o

相关标签:
3条回答
  • 2021-01-29 01:09

    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

    0 讨论(0)
  • 2021-01-29 01:14

    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()

    0 讨论(0)
  • 2021-01-29 01:17

    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.

    0 讨论(0)
提交回复
热议问题