The WindowEx.SetParent function changes the parent window of the specified child window.

number WindowEx.SetParent(

number hWndChild, --handle of window whose parent is changing
number hWndNewParent --handle of new parent window
);

Parameters

hWndChild

Identifies the child window.

hWndNewParent

Identifies the new parent window. If this parameter is 0, the desktop window becomes the new parent window.

Return Values

If the function succeeds, the return value is the handle of the previous parent window.
If the function fails, the return value is 0.

Remarks

An application can use the WindowEx.SetParent function to set the parent window of a pop-up, overlapped, or child window. The new parent window and the child window must belong to the same application.


If the window identified by the hWndChild parameter is visible, Windows performs the appropriate redrawing and repainting