Thanks guys both solutions worked. How should I go about filtering these windows?
For example here follows some of the output produced by the above code.
...
Task Switching
Microsoft Visual Studio
CiceroUIWndFrame
Battery Meter
Network Flyout
...
Out of those 5 entries, and blank spaces, only Microsoft Virtual Studio is an actual window, the rest are services I assume run in the background or perhaps have transparent 0x0 pixel windows?