On Windows 10, you can press Win+Tab to get a "Task View" view of all your windows. I'm trying to check if this is active at any given time. I have tried using a Low Level Keyboard Hook with WH_KEYBOARD_LL but this only allows me to detect the keypress, not if the switcher is active. I've looked at the Windows DWM API and haven't found anything else either.
I have also tried using EnumWindows() and EnumChildWindows(GetDesktopWindow(), ...) and did not find any difference in the output between having the task view shown and hidden.
Is there any accurate method to detect if this is being shown?
FindWindowpassing the special class name of the switcher. Unfortunately, you can't use the usual method (Spy++) to learn the class name, because using Spy++ will close the switcher. So instead do this: Make the gesture, instead of sending Win+Tab, do aEnumWindowswriting the window list to a file. Do the gesture with the switcher open, then look in the file to see what you found. Once you know the class name for the switcher, you can skipEnumWindowsand just doFindWindow. - Ben VoigtGetWindowThreadProcessIdto check if these windows belong to explorer.exe which is the process responsible for the task switcher I believe. UseGetClassNameto determine the class name. - zett42