Quantcast
Channel: Windows Desktop Development for Accessibility and Automation forum
Viewing all articles
Browse latest Browse all 585

C# Z Order of All Open Windows

$
0
0

I am interested in getting the Z order for every window currently open by the user. For example, if they had 4 windows on top of each other, I'd like to know (by window title - which I can already get), the order - i.e. which is deepest in the stack and which is at the front of the stack.

Does anyone have an idea as to the code for this? I've been looking at GetTopWindow() and GetNextWindow() but GetTopWindow() seems to return the top window within an application and GetNextWindow() doesn't seem to be referenced in user32.dll (got this from Pinvoke).

Any code ideas/hints would be gratefully received. I'm hoping there is just an integer value which is the Z index of the windows and from that, I can work out the order!

UPDATE: I have tried playing around with GetWindow() to no avail as when I use GW_HWNDNEXT it doesn't return the correct window handle. Basically all I want is a list of all windows currently open (both inside and outside my application) in the z order they appear on screen.

Cheers, Jonathan


Viewing all articles
Browse latest Browse all 585

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>