Concerning Windows 10 and its new virtual desktop feature, is there a way to determine which virtual desktop a particular window belongs to? And, which virtual desktop is active?
The problem can be seen using the Snipping Tool. Open the tool and select a New / Window Snip. As you move the mouse around, the snipping tool highlights areas where there is no window, but there is a window at that location on another virtual desktop.
In this picture, the Snipping Tool is highlighting an empty spot.
Snipping Tool doesn't know which virtual desktop a particular window is on.
Here's the same question on MSDN Forums, unanswered, but with lots of additional detail.
Sorry, my status isn't high enough to insert images or include more links.
The Windows SDK Support Team Blog posted a C# demo to switch Desktops via IVirtualDesktopManager:
Call
GetWindowDesktopId
to get the Desktop GUID.