Jump to content
Sign in to follow this  
imperii

Array Handle of File search.. i can't find the handle

Recommended Posts

imperii

hi all,

i've been (re)searching a lot about treeview and array's but i wanted to create a kind of windows explorer.

but here's the problem, i created a loop for looking for each directory but they've no name so i can't do anything with the folder's showed in the tree.

does someone knows a solution for this? (please dont refer to other projects, i just want to learn programming and it's technique's)

Please look at my Script:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <ButtonConstants.au3>
#include <TreeViewConstants.au3>
#include <StaticConstants.au3>

$maingui = GUICreate("Tree View Test", 800, 600)
GUISetState(@SW_SHOW, $maingui)

$MNU_file = GUICtrlCreateMenu("File")
$MNU_file_exit = GUICtrlCreateMenuItem("Exit", $MNU_file)

$dir_tree = GUICtrlCreateTreeView(5, 40, 200, 400, 0x00830000)
ReadFolderContents()




Func ReadFolderContents()
$Search = FileFindFirstFile("C:\*.*")
Do
    $NextSearch = FileFindNextFile($search)
    If @extended = 1 Then
        $treeitem = GUICtrlCreateTreeViewItem($NextSearch, $dir_tree)
    Endif
Until @error
EndFunc





While 1
$event = GUIGetMsg()
Select
Case $event = $MNU_file_exit ;handles the Exit application in the File menu
    GUIDelete($maingui)
    ExitLoop
Case $event = $GUI_EVENT_CLOSE ;handles the X button on the gui
    GUIDelete()
    ExitLoop
EndSelect
WEnd

Share this post


Link to post
Share on other sites
PsaltyDS

...i created a loop for looking for each directory but they've no name...

Couldn't make out what that meant.

Did you want to continue searching subdirectories of the parent directory? That would be a "recursive search". Many examples and topics about recursive searches out there already.

;)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.