LetItRock
LetItRock

Reputation: 290

Detecting active virtual desktop on Windows 10 - Task View - virtual desktop switcher

Windows 10 provide for users switching between virtual desktops using Task View.

For developing purpose, I need to:

How can I do that? Is there any API?
Thank you for your help!

Upvotes: 8

Views: 4512

Answers (1)

blade
blade

Reputation: 12894

There is an interface that should provide most of the functionality you need: IVirtualDesktopManager interface

It has the following methods:

  • GetWindowDesktopId
  • IsWindowOnCurrentVirtualDesktop
  • MoveWindowToDesktop

In case that wasn't enough, there are even more unofficial APIs documented on this Russian website http://www.cyberforum.ru/blogs/105416/blog3671.html

Edit: here's a C# wrapper library for all the COM interfaces: https://github.com/Grabacr07/VirtualDesktop

Upvotes: 5

Related Questions