FinalVersion Posted June 25, 2010 Share Posted June 25, 2010 The following code lists all files & folders in the current directory. I was thinking of creating a counter, increase it every time a tree view item is added. Then in a for loop, check each item with a IsFolder() function, but there isn't a function that I'm aware of that does that.#include <GUIConstantsEx.au3> #include <TreeViewConstants.au3> #include <WindowsConstants.au3> Local $frmMain = GUICreate("Tree View", 234, 363, -1, -1) Local $tMain = GUICtrlCreateTreeView(0, 0, 250, 380) $hFiles = FileFindFirstFile("*.*") If $hFiles = -1 Then Exit While 1 $cFile = FileFindNextFile($hFiles) If @error Then ExitLoop GUICtrlCreateTreeViewItem($cFile, $tMain) WEnd FileClose($hFiles) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd [center][+] Steam GUI [+][+] Clipboard Tool [+][+] System :: Uptime [+][+] StarCraft II Mouse Trap [+][/center] Link to comment Share on other sites More sharing options...
UEZ Posted June 25, 2010 Share Posted June 25, 2010 (edited) You can use the @extended macro to check whether it is a folder! ... $cFile = FileFindNextFile($hFiles) If @extended then ConsoleWrite("Found a dir" & @CRLF) ... BR, UEZ Edited June 25, 2010 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
Xenobiologist Posted June 25, 2010 Share Posted June 25, 2010 Another way would be using Function _FileListToArray_FileListToArray with its parameter. Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
engjcowi Posted October 26, 2010 Share Posted October 26, 2010 Hi I like the code above. Simple to read and understand. Is it possible to use the list thats created in the gui so that if idouble click on the file, it then opens? thanks Drunken Frat-Boy Monkey Garbage 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