HotKeySet("{ESC}", "Terminate") #include #include Local $msg, $hwnd, $Nhandle $hwnd = GUICreate("MyTest") GUISetState() $Nhandle = WinGetHandle("Untitled - Notepad") _WinAPI_SetParent($Nhandle, $hwnd) _WinAPI_SetWindowLong($Nhandle, $GWL_STYLE, $WS_POPUP + $WS_VISIBLE) WinMove($Nhandle, "", 0, 0) While ProcessExists() $msg = GUIGetMsg() Switch Case $GUI_EVENT_CLOSE ProcessClose() EndSwitch WEnd ; Exit Function (HotKeySet "ESC") Func Terminate() Exit EndFunc ;==>Terminate