#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$GUI = GUICreate("函数演示", 400, 300) ; 创建居中显示的对话框窗口
GUISetState()
$form = GUICreate("", 300, 200,-1, -1, $WS_POPUP + $WS_BORDER, $WS_EX_MDICHILD, $GUI) ;子窗口
GUISetBkColor(0xffff00)
$label = GUICtrlCreateLabel("黄色窗口是子窗口", 100, 100, 120, 30)
GUICtrlSetResizing($label, $GUI_DOCKALL)
GUISetState()
WM_MOVE()
GUIRegisterMsg($WM_MOVE, "WM_MOVE")
; 运行 GUI,直到对话框窗口关闭
While 1
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE Then Exit
WEnd
Func WM_MOVE()
Local $pos = WinGetPos($GUI)
WinMove($form, "", $pos[0] + 50, $pos[1] + 50)
EndFunc ;==>WM_MOVE
|