The GetWindow function retrieves the handle of a window that has the specified relationship (Z order or owner) to the specified window.
HWND GetWindow(
HWND hWnd, // handle of original window UINT uCmd // relationship flag );
Return Values
If the function succeeds, the return value is a window handle. If no window exists with the specified relationship to the specified window, the return value is NULL. To get extended error information, call GetLastError.