win12.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
WinSetParent (1.2)
Function Group  Overview                          Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_WINMESSAGEMGR
 
BOOL WinSetParent(hwnd, hwndNewParent, fRedraw)
HWND hwnd;             /* handle of the window whose parent is changed */
HWND hwndNewParent;    /* handle of the new parent window              */
BOOL fRedraw;          /* redraw flag                                  */
 
The WinSetParent function sets the parent window for the window identified
by the hwnd parameter to the window identified by the hwndNewParent
parameter.
 
Parameter      Description
────────────────────────────────────────────────────────────────────────────
 
hwnd           Identifies the window whose parent will be changed.
 
hwndNewParent  Identifies the new parent window. If this parameter is a
               desktop-window handle or HWND_DESKTOP, the hwnd window
               becomes a main window. The new parent window cannot be a
               descendant of the hwnd window. If hwndNewParent is not equal
               to HWND_OBJECT, the windows identified by the hwndNewParent
               and hwnd parameters must both be descendants of the same
               desktop window.
 
fRedraw        Specifies a redraw indicator. If this parameter is TRUE, any
               necessary redrawing of both the old parent and the new parent
               windows is performed (if the hwnd window is visible). If this
               parameter is FALSE, no redrawing of the old and new parent
               windows is performed. This avoids an extra device update when
               subsequent calls cause the windows to be redrawn.
 
Return Value
 
The return value is TRUE if the parent window is successfully changed.
Otherwise, it is FALSE, indicating that the parent window was not
successfully changed.
 
See Also
 
WinIsChild, WinSetOwner