imperii Posted August 12, 2010 Share Posted August 12, 2010 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: expandcollapse popup#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 Link to comment Share on other sites More sharing options...
PsaltyDS Posted August 12, 2010 Share Posted August 12, 2010 ...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 Link to comment Share on other sites More sharing options...
Zibit Posted August 12, 2010 Share Posted August 12, 2010 i made something like that but if your trying to make windows explorer type of thing then i cant help you but i can give a hint on a command you should take a look at: _Filelisttoarray() would be easyer doing it with that function. Creator Of Xtreme DevelopersPixel Pattern UDFTray GUI UDFMathssend & recive register scriptMouse Control via Webcam Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now