From: nick.swan on
Hi,
I have a list of handles of internet explorer windows and want to know
which was the last one that a user was looking at. I was thinking I
could do this by looking at the z order for each one, so I really have
2 questions,

Is this the best way of doing it?

And if so, how do i get the zorder for each HWND?

Thanks in advance

Nick

From: David Lowndes on
>I have a list of handles of internet explorer windows and want to know
>which was the last one that a user was looking at. I was thinking I
>could do this by looking at the z order for each one, so I really have
>2 questions,
>
>Is this the best way of doing it?

Dunno, it depends on your circumstance.

It may be possible to install a hook and remember which IE window was
the last active one, but never having needed to do such a thing, I
don't know if there'd be any significant problems attempting it.

>And if so, how do i get the zorder for each HWND?

I think you'll have to do it by enumerating all the top level windows
and match the ones that correspond with the window handles you have.
The enumeration order is the Z-order.

Dave
From: Kellie Fitton on
Hi,

You can use the following APIs to retrieve the handle of the
next or previous window in the Z order:

GetWindow()

GetNextWindow()

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowfunctions/getwindow.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowfunctions/getnextwindow.asp

Hope these suggestions helps,

Kellie.