UDF > GUI > GuiComboBoxEx >


_GUICtrlComboBoxEx_InitStorage

Alloue de la m�moire pour stocker les �l�ments de la ListBox

#include <GuiComboBoxEx.au3>
_GUICtrlComboBoxEx_InitStorage ( $hWnd, $iNum, $iBytes )

Param�tres

$hWnd Handle du contr�le
$iNum Nombre d'�l�ments � ajouter
$iBytes La quantit� de m�moire � allouer pour les cha�nes des �l�ments, en octets

Valeur de retour

Succ�s: le nombre total de points pour lesquels la m�moire a �t� allou�e pr�.
�chec: $CB_ERRSPACE.

Remarques

Contribue � acc�l�rer l'initialisation de ComboBoxes qui ont un grand nombre d'articles (plus de 100 ).

Vous pouvez utiliser des estimations pour la iNum $et $param�tres de iBytes.
Si vous surestimez, la m�moire suppl�mentaire est allou�e.
Si vous sous-estimez, la r�partition normale est utilis�e pour les �l�ments qui d�passent le montant demand�.

En relation

_GUICtrlComboBoxEx_AddDir, _GUICtrlComboBoxEx_AddString, _GUICtrlComboBoxEx_InsertString

Exemple

#include <GuiComboBoxEx.au3>
#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>

Example()

Func Example()
    Local $hGUI, $hCombo

    ; Cr�e une GUI
    $hGUI = GUICreate("ComboBoxEx Init Storage", 400, 300)
    $hCombo = _GUICtrlComboBoxEx_Create($hGUI, "", 2, 2, 396, 296, $CBS_SIMPLE)
    GUISetState(@SW_SHOW)

    MsgBox($MB_SYSTEMMODAL, "Information", "Init 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   ;==>Example