Jump to content
Sign in to follow this  

DDL_DIRECTORY for GUICtrlListBox_Dir doesn't record subdirectories

Recommended Posts


I have a gui that I would like to populate with all the subdirectories for any given directory. I obtain the directory variable using FileSelectFolder and then feed that to _GUICtrlListBox_Dir($list1, $current, $DDL_DIRECTORY). The reultant set of directory listing in my List box ($list1 = _GUICtrlListBox_Create($Form1, "", 5, 70, 400, 100, $LBS_EXTENDEDSEL)

) only identifies the directory variable, $current, originally fed to the _GUICtrlListBox_Dir.

I have a script that allows my users to right click on any directory or drive desired for backup, then the user enters the name of the backup and their domain password. After the user clicks "Go", the job schedules on a remote CA BrightStor server. An additional GUI then appears allowing them to check the status of their backup at any time. Once the backup completes, the additional GUI updates with job status, media pool used, serial numbers of media used, and their JobStatus log.

The purpose for this new GUI is to allow the user to select multiple folders or drives to be scheduled in a single backup. Currently, when a user selects multiple folders in Windows explorer, right clicks, and selects Back This UP, my app launches once for every item selected.

I hope that this makes it clearer than mud.

Here's the code:

#include <Array.au3>

#include <GuiListBox.au3>

Dim $var = _ArrayCreate("")

$Form1 = GUICreate("Form1", 455, 240, 193, 125)

$Label1 = GUICtrlCreateLabel("Please select your target selections for backup from the list below.", 0, 16, 450, 17, $SS_CENTER)

$Label2 = GUICtrlCreateLabel("Be sure to hold the CTRL for multiple object selections.", 0, 56, 454, 17, $SS_CENTER)

$list1 = _GUICtrlListBox_Create($Form1, "", 5, 70, 400, 100, $LBS_EXTENDEDSEL)

$Button1 = GUICtrlCreateButton("Show me my Selections", 80, 210, 121, 25, 0)

$Button2 = GUICtrlCreateButton("Cancel", 280, 210, 113, 25, 0)

$current = FileSelectFolder("Locate the root directory", "c:\")


_GUICtrlListBox_Dir($list1, $current, $DDL_DIRECTORY)

While 1

$nMsg = GUIGetMsg()

Switch $nMsg



Case $Button2


Case $Button1

$selection = _GUICtrlListBox_GetSelItemsText($list1)

_ArrayDisplay($selection, "")



Share this post

Link to post
Share on other sites

Instead of relying on the _GUICtrlListBox_Dir, I borrowed a file search loop that identifies directories and then used the _GUICtrlListBox_AddString to add the directory listing to the list box. The resultant set of data is good, but it doesn't seem "clean". The code is attached.


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this