Referring to https://github.com/MScholtes/VirtualDesktop/issues/15
I'm looking to do 3 things programmatically, specifically:
- How to activate task view, i.e. Win-Tab
- How to deactivate task view
- How to tell if we are currently in task view
I was able to bring up task view by running the following in a command prompt:
explorer shell:::{3080F90E-D7AD-11D9-BD98-0000947B0257}
But is starting a process in C# every single time I need task view the best approach? I prefer a programmatic way of calling some functions etc. I tried the following for activating, but it did nothing
public static readonly Guid CLSID_taskview = new Guid("3080F90E-D7AD-11D9-BD98-0000947B0257");
Activator.CreateInstance(Type.GetTypeFromCLSID(Guids.CLSID_taskview));
Thank you.
I found a way to activate Task View without needing to launch a process:
The same call can be used to deactivate it as well.
To see if the Task View is open, it looks like you can get a handle to the current foreground window and check its class name, like so:
I haven't tested that function extensively, so I don't know if it works in all cases.