#include <WindowsConstants.au3>
#include <MenuConstants.au3>
#Include <WinAPI.au3>
#Include <WinAPIEx.au3>
#Include <APIConstants.au3>
GUICreate('全部按钮', Default, Default, Default, Default,BitOR($GUI_SS_DEFAULT_GUI,$WS_MAXIMIZEBOX))
GUISetState()
Do
Until GUIGetMsg() = -3
GUIDelete()
Sleep(1000)
; =========================================================================
GUICreate('空白窗口', Default, Default, Default, Default, $WS_CAPTION)
GUISetState()
Sleep(3000)
GUIDelete()
Sleep(1000)
; =========================================================================
GUICreate('只有关闭按钮', Default, Default, Default, Default, Bitor($WS_CAPTION,$WS_SYSMENU))
GUISetState()
Do
Until GUIGetMsg() = -3
GUIDelete()
Sleep(1000)
; =========================================================================
GUICreate('最小化按钮不可用', Default, Default, Default, Default,$GUI_SS_DEFAULT_GUI - $WS_MAXIMIZEBOX)
GUISetState()
Do
Until GUIGetMsg() = -3
GUIDelete()
Sleep(1000)
; =========================================================================
Const $MF_BYCOMMAND = 0x00000000
$Form = GUICreate("关闭按钮不可用")
; EnableMenultem(GetSystemMenu(hwnd,FALSE),SC_CLOSE,MF_BYCOMMAND I MF_GRAYED);
$HWND = DllCall("User32.dll","HANDLE","GetSystemMenu","HWND",$Form,"BOOL",False) ;得到菜单句柄
DllCall("User32.dll","BOOL","EnableMenuItem","HANDLE",$HWND[0],"UINT",$SC_CLOSE,"UINT",BitOR($MF_BYCOMMAND,$MF_GRAYED))
GUISetState()
Sleep(3000)
GUIDelete()
Sleep(1000)
; =========================================================================
GUICreate('无边框', Default, Default, Default, Default,BitOR($WS_SYSMENU, $WS_POPUP))
GUISetState()
Do
Until GUIGetMsg() = -3
GUIDelete()
Sleep(1000)
; =========================================================================
$hForm = GUICreate('无控制菜单',Default,Default,Default,Default, BitOR($WS_CAPTION, $WS_POPUP, $WS_SYSMENU), $WS_EX_DLGMODALFRAME)
_WinAPI_DestroyIcon(_WinAPI_GetClassLongEx($hForm, $GCL_HICON))
_WinAPI_SetClassLongEx($hForm, $GCL_HICON, 0)
_WinAPI_SetClassLongEx($hForm, $GCL_HICONSM, 0)
GUISetState()
Do
Until GUIGetMsg() = -3
GUIDelete()
Sleep(1000)
; =========================================================================
GUICreate("我不会在任务栏显示", 400, 300, -1, -1, -1, -1, WinGetHandle(AutoItWinGetTitle()))
GUISetState()
Do
Until GUIGetMsg() = -3