Function Reference


_GUICtrlComboBoxEx_AddDir

Adds the names of directories and files

#include <GuiComboBoxEx.au3>
_GUICtrlComboBoxEx_AddDir ( $hWnd, $sFilePath [, $iAttributes = 0 [, $bBrackets = True]] )

Parameters

$hWnd Handle to the control
$sFilePath Specifies an absolute path, relative path, or filename
$iAttributes [optional] Specifies the attributes of the files or directories to be added:
    $DDL_READWRITE - Includes read-write files with no additional attributes
    $DDL_READONLY - Includes read-only files
    $DDL_HIDDEN - Includes hidden files
    $DDL_SYSTEM - Includes system files
    $DDL_DIRECTORY - Includes subdirectories
    $DDL_ARCHIVE - Includes archived files
    $DDL_DRIVES - All mapped drives are added to the list
    $DDL_EXCLUSIVE - Includes only files with the specified attributes
$bBrackets [optional] include/exclude brackets when $DDL_DRIVES is used

Return Value

Success: a 0-based index of the last name added.
Failure: -1.

Remarks

If there is insufficient space to store the new strings, the return value is $CB_ERRSPACE.

Above constants require #include <DirConstants.au3>

Related

_GUICtrlComboBoxEx_InitStorage

Example

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

Example()

Func Example()
        Local $hGUI, $hCombo

        ; Create GUI
        $hGUI = GUICreate("ComboBoxEx Add Dir", 400, 300, -1, -1, -1)
        $hCombo = _GUICtrlComboBoxEx_Create($hGUI, "", 2, 2, 394, 100)
        GUICtrlCreateInput("Input control", 2, 30, 120)
        GUISetState(@SW_SHOW)

        ; Add files
        _GUICtrlComboBoxEx_BeginUpdate($hCombo)
        _GUICtrlComboBoxEx_AddDir($hCombo, @WindowsDir & "\*.exe")
        _GUICtrlComboBoxEx_EndUpdate($hCombo)

        Do
        Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc   ;==>Example