M.Hirsch,

I'm not a C guy and I don't have the time. However, I found this API call in the MSDN which looks like it could help you out:

GetNextWindow
The GetNextWindow function retrieves a handle to the next or previous window in the Z order. The next window is below the specified window; the previous window is above. If the specified window is a topmost window, the function retrieves a handle to the next (or previous) topmost window. If the specified window is a top-level window, the function retrieves a handle to the next (or previous) top-level window. If the specified window is a child window, the function searches for a handle to the next (or previous) child window.

HWND GetNextWindow(
HWND hWnd, // handle to current window
UINT wCmd // direction flag
);