From: Todd Aspeotis on
LONG GetWindowLong(
HWND hWnd,
int nIndex
);

GetWindowLong uses a handle to a window, it doesn't care what the z-order
is. You might want to try Set/GetWindowLong with nIndex set to GWL_ID and
GWL_USERDATA. I don't think it's a good idea to depend on the Win32 API to
return windows in the order you want (is it documented that any of these
functions can do this), and rather than crossing your fingers and doing
something like create-in-order and hope that it will enumerate-in-order, set
the ID or user data and then sort it later.

Note if you use GWL_USERDATA then you must allocate space in advance (ie set
WNDCLASSEX::cbWndExtra to the size of the user data you will store -
sizeof(long) if you would like to store an index).

"michelQA" <michelqa(a)yahoo.ca> wrote in message
news:a27de054-3c46-4f98-8d87-5bf7333b00d4(a)v2g2000vbb.googlegroups.com...
> GetWindowLong always use z-order
> In other words I want to list Dialogs without being affected by Z-
> order. Get the list of Dialog Child window in the same order all the
> time.