The GetParent function retrieves a handle to the specified child window's parent window.
HWND GetParent(
HWND hWnd // handle to child window
);
If the function succeeds, the return value is a handle to the parent window. If the window has no parent window, the return value is NULL. To get extended error information, call GetLastError.
Windows CE: Windows CE version 1.0 does not support owned windows, except for dialog boxes.
Windows NT: Requires version 3.1 or later.
Windows: Requires Windows 95 or later.
Windows CE: Requires version 1.0 or later.
Header: Declared in winuser.h.
Import Library: Use user32.lib.
Windows Overview, Window Functions, SetParent