#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
$Form = GUICreate("测试", 420, 280, -1, -1)
$Group1 = GUICtrlCreateGroup("请勾选您要设置的项目", 165, 15, 250, 165)
GUICtrlCreateGroup("", -99, -99, 1, 1)
;要生成复选框, 使用 扩展样式 $LVS_EX_CHECKBOXES
;要使整行显示选中状态, 使用 扩展样式 $LVS_EX_FULLROWSELECT
$ListView1 = GUICtrlCreateListView("序号|数值", 175, 30, 230, 140, -1, BitOR($WS_EX_CLIENTEDGE, $LVS_EX_CHECKBOXES, $LVS_EX_FULLROWSELECT))
;设置列宽度
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 100)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 100)
$ListView1_0 = GUICtrlCreateListViewItem("001|1111111111", $ListView1)
$ListView1_0 = GUICtrlCreateListViewItem("002|2222222222", $ListView1)
$ListView1_0 = GUICtrlCreateListViewItem("003|3333333333", $ListView1)
$ListView1_0 = GUICtrlCreateListViewItem("004|4444444444", $ListView1)
$ListView1_0 = GUICtrlCreateListViewItem("005|5555555555", $ListView1)
$Button1 = GUICtrlCreateButton("确定执行(Y)", 90, 210, 80, 25)
GUICtrlSetState(-1,$GUI_FOCUS)
$Button2 = GUICtrlCreateButton("退出程序(N)", 250, 210, 80, 25)
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $Form, "int", 500, "long", 0x00080000);fade-in
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
;设置热键
HotKeySet("Y", "_Continue")
HotKeySet("y", "_Continue")
HotKeySet("N", "_Quit")
HotKeySet("n", "_Quit")
While 1
$nMsg = GUIGetMsg() ;捕获窗口消息
Switch $nMsg
Case $GUI_EVENT_CLOSE, $Button2
_Quit()
Case $Button1
_Continue()
EndSwitch
WEnd
Func _Continue()
MsgBox(4160, "测试", "继续执行", 0)
EndFunc ;==>_Continue
Func _Quit() ;退出程序
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $Form, "int", 500, "long", 0x00090000);fade-out
Exit
EndFunc ;==>_Quit