I've been using the particularly handy EnumWindows() to collect the handles of currently open windows. Unfortunately, this function only picks up handles from the current desktop - if I open a new virtual desktop and open windows there, only the currently shown desktop's windows will be enumerated.
The Windows virtual desktop API docs seem pretty thin on the ground - does anyone know of a solution that would let me pick up window handles from all open windows across all virtual desktops?