shai,
That works:
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
; Create GUI
$hGUI = GUICreate("", 260, 100, -1, -1, BitOR($WS_CAPTION, $WS_SYSMENU), $WS_EX_LAYOUTRTL)
GUICtrlCreateLabel("username:", 10, 15, 80, 20)
$cOK = GUICtrlCreateButton("OK", 190, 10, 60, 50)
GUISetState()
; Create child to hold input
$hChild = GUICreate("", 80, 20, 80, 20, $WS_POPUP, $WS_EX_MDICHILD, $hGUI)
$cUsername = GUICtrlCreateInput("", 0, 0, 80, 20)
; But do not activate
GUISetState(@SW_SHOWNOACTIVATE, $hChild)
; Prevent child stealing active state
GUIRegisterMsg($WM_NCACTIVATE, "_WM_NCACTIVATE")
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE, $cOK
GUIDelete($hChild)
GUIDelete($hGUI)
ExitLoop
EndSwitch
WEnd
Func _WM_NCACTIVATE($hWnd, $Msg, $wParam, $lParam)
#forceref $hWnd, $Msg, $wParam, $lParam
Return 1
EndFunc ;==>_WM_NCACTIVATE
But it is a bit more complicated than I thought.
M23