本帖最后由 chzj589 于 2020-6-8 16:46 编辑
#include <GUIConstantsEx.au3>#include <WindowsConstants.au3>
#include <GuiConstants.au3>
#include <winapi.au3>
#include <GuiMenu.au3>
Opt("GUIOnEventMode", 1)
Global $form, $GUI
GUIa()
While 1
Sleep(100)
WEnd
Func GUIa()
$GUI = GUICreate("函数演示", 600, 400, -1, -1) ; 创建居中显示的对话框窗口
GUISetOnEvent($GUI_EVENT_CLOSE, "hMainClose")
;GUICtrlCreateLabel("这个绿色矩形是父窗口上的控件,子窗口不能在父窗口控件底下", 10, 10, 580, 40)
;GUICtrlSetBkColor(-1, 0x00ff00)
;GUICtrlSetState(-1, $GUI_DISABLE)
$but = GUICtrlCreateButton("上移子窗口", 20, 100, 80, 20)
GUISetState(@SW_SHOW, $GUI)
$form = GUICreate("A視窗", 400, 300, -300, -150, $WS_POPUP, $ws_ex_mdichild, $GUI);子窗口
GUISetBkColor(0xffff00)
GUISetOnEvent($GUI_EVENT_PRIMARYDOWN, "_Message");无边框窗口拖动
GUICtrlCreateLabel("拖动子窗口,当子窗口超出父窗口的部份或整个子窗口如何隐藏,简单的说就不是不想看到超出父窗口的子窗口部份", 40, 100, 320, 50)
_WinAPI_SetParent($form, $GUI)
GUISetState(@SW_SHOW, $form)
EndFunc ;==>GUIa
Func hMainClose()
GUIDelete()
Exit
EndFunc ;==>hMainClose
Func _Message()
;无边框窗口拖动
_SendMessage($form, $WM_SYSCOMMAND, $SC_MOVE + $HTCAPTION, 0)
EndFunc ;==>_Message
|