GetParent

The GetParent function retrieves a handle to the specified child window's parent window.

HWND GetParent(
  HWND hWnd   // handle to child window
);
 

Parameters

hWnd
Handle to the window whose parent window handle is to be retrieved.

Return Values

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.

Remarks

Windows CE: Windows CE version 1.0 does not support owned windows, except for dialog boxes.

QuickInfo

  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.

See Also

Windows Overview, Window Functions, SetParent