Changes the parent window of the specified child window
#include <WinAPISysWin.au3>
_WinAPI_SetParent ( $hWndChild, $hWndParent )
$hWndChild | Window handle of child window |
$hWndParent | Handle to the new parent window. If 0, the desktop window becomes the new parent window. |
Success: | A handle to the previous parent window |
Failure: | 0, call _WinAPI_GetLastError() to get extended error information |
An application can use the 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.
Search SetParent in MSDN Library.
#include <GUIConstantsEx.au3>
#include <WinAPISysWin.au3>
#include <WindowsConstants.au3>
Local $hParent = WinGetHandle('[CLASS:Progman;TITLE:Program Manager]')
Local $hForm = GUICreate('Test ' & StringReplace(@ScriptName, '.au3', '()'), 400, 400, 100, 100, -1, $WS_EX_TOOLWINDOW)
; Attach window to the desktop (always on bottom)
_WinAPI_SetParent($hForm, $hParent)
GUISetState(@SW_SHOWNOACTIVATE)
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE