分配用于存储列表框项目的内存
#include <GuiComboBoxEx.au3>
_GUICtrlComboBoxEx_InitStorage($hWnd, $iNum, $iBytes)
$hWnd | 控件句柄 |
$iNum | 项目数量 |
$iBytes | 内存分配字节数 |
#include <GuiComboBoxEx.au3>
#include <GUIConstantsEx.au3>
$Debug_CB = False ;检查传递给 ComboBox/ComboBoxEx 函数的类名, 设置为True并输出到一个控件的句柄,用于检查它是否工作
_Main()
Func _Main()
Local $hGUI, $hCombo
; 创建 GUI
$hGUI = GUICreate("ComboBoxEx Init Storage", 400, 300)
$hCombo = _GUICtrlComboBoxEx_Create($hGUI, "", 2, 2, 396, 296, $CBS_SIMPLE)
GUISetState()
MsgBox(4160, "信息", "Innit Storage Pre-Allocated Memory For: " & _GUICtrlComboBoxEx_InitStorage($hCombo, 150, 300) & " Items")
_GUICtrlComboBoxEx_BeginUpdate($hCombo)
For $x = 0 To 149
_GUICtrlComboBoxEx_AddString($hCombo, StringFormat("%03d : Random string", Random(1, 100, 1)))
Next
_GUICtrlComboBoxEx_EndUpdate($hCombo)
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc ;==>_Main