I'm wondering : is there any API or any way to access the task view feature windows or rectangles on Windows 10 ? C++ WinAPI in Windows10 coming maybe?
I need to have position of the windows thumbnails displayed while on Task View mode, and have their position and size, to know where they're displayed. I don't want to move them, only know where they're shown.
I've been on this for days now, I don't think it's possible (without a horrible hack) ... but maybe you know! :)
So that was my question ... here's what I found out :
I've looked everywhere, I've seen the perfect question (without an answer) on MSDN developer network, which redirected to "Windows 10 Developer Readiness", which redirected to MSDN developer network, in an infinite loop :
and
I won't put the 100 or so links that I looked to find an answer to that...
Here's what I know
I know that there's a window (one per monitor, actually) that seems to be created only when pressing Win+Tab. So it's hard to get the handle, but there's some ways to do it :
- Programmatically, with EnumWindows(), called after pressing the keys.
- Also with Spy++, but only after setting it to "Always On Top", pressing "Win+Tab" to show "Task View", and then pressing refresh. Then I can find the HWND in the windows list, but it's invalid after and I can't get the properties after (Which is why I think the windows are only created on the shortcut).
I found out that the windows are named "Task View", with the class name "MultitaskingViewFrame". The same window name and class name seems to be used for Alt+Tab too.
The windows have no children, so there's no way to get that, it would be too easy.
Everything seems to be painted "on-the-fly".
So here I am. The only way I can find right now, is to take a screenshot of everything, and do image processing ... But that's :
- Not very accurate (What about the background, and the borders that are outside the actual, clickable region).
- Most likely very slow, or at least taking too much CPU for such a seemingly small task.
- It's not clean at all.
Sorry for the long question, I usually never ask questions, because I find the answer somewhere, or find it out by myself, but I would like to do it cleaner and more accurate than the only solution I found!