删除控件
#include <GuiListBox.au3>
_GUICtrlListBox_Destroy(ByRef $hWnd)
$hWnd | 控件的控件ID/句柄 |
#include <GuiListBox.au3>
#include <GUIConstantsEx.au3>
#include <Constants.au3>
$Debug_LB = False ;检查传递给 ListBox 函数的类名, 设置为True并输出到一个控件的句柄,用于检查它是否工作
_Main()
Func _Main()
Local $hGUI, $hListBox
; 创建 GUI
$hGUI = GUICreate("(UDF Created) List Box Destroy", 400, 296)
$hListBox = _GUICtrlListBox_Create($hGUI, "", 2, 2, 396, 296)
GUISetState()
; 添加文件
_GUICtrlListBox_BeginUpdate($hListBox)
_GUICtrlListBox_ResetContent($hListBox)
_GUICtrlListBox_InitStorage($hListBox, 100, 4096)
_GUICtrlListBox_Dir($hListBox, @WindowsDir & "\win*.exe")
_GUICtrlListBox_AddFile($hListBox, @WindowsDir & "\notepad.exe")
_GUICtrlListBox_Dir($hListBox, "", $DDL_DRIVES)
_GUICtrlListBox_Dir($hListBox, "", $DDL_DRIVES, False)
_GUICtrlListBox_EndUpdate($hListBox)
MsgBox(4160, "信息", "Destroying ListBox")
_GUICtrlListBox_Destroy($hListBox)
; 循环直到用户退出
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc ;==>_Main