Quote Originally Posted by MSDN
The GetWindow function retrieves a handle to a window that has the specified relationship (Z-Order or owner) to the specified window.
start with HWND 0 (desktop) and step through all windows.