问题
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!
Cheers, Jonathan
来源:https://stackoverflow.com/questions/32054300/c-sharp-z-order-of-all-open-windows