NELyon Posted July 27, 2006 Share Posted July 27, 2006 (edited) When i run this script, it puts a "1" in the list box and throws my cpu to about 60. It's usually about 20 (I just re-formatted) Actually, with this code it does nothing with the list box Anyone know whats wrong? EDIT: I got the first file working, just not next file #include <GUIConstants.au3> $search = FileFindFirstFile("*.*") ; == GUI generated with Koda == $Form1 = GUICreate("AForm1", 516, 574, 192, 125) $List1 = GUICtrlCreateList("", 48, 16, 401, 500, -1, $WS_EX_CLIENTEDGE) $Button1 = GUICtrlCreateButton("refresh", 120, 536, 273, 25) GUISetState(@SW_SHOW) While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button1 GUICtrlSetData($List1, $search) While $search = 1 GUICtrlSetData($List1, FileFindNextFile($search)) WEnd EndSelect WEnd Exit Thanks all, Codemyster Edited July 27, 2006 by codemyster Link to comment Share on other sites More sharing options...
B3TA_SCR1PT3R Posted July 27, 2006 Share Posted July 27, 2006 (edited) #include <Process.au3> #include <GUIConstants.au3> $search = _RunDOS("dir /b >> Files.log") ; == GUI generated with Koda == $Form1 = GUICreate("AForm1", 516, 574, 192, 125) $List1 = GUICtrlCreateList("", 48, 16, 401, 500, -1, $WS_EX_CLIENTEDGE) $Button1 = GUICtrlCreateButton("refresh", 120, 536, 273, 25) GUISetState(@SW_SHOW) While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $button1 $file = FileOpen("Files.log", 0) While 1 $line = FileReadLine($file) If @error = -1 Then ExitLoop GUICtrlSetData($list1,$line) Wend EndSelect WEnd Exit ..your just listing the files right? //edit: Are you specifically needing to use the FileFind functions? because this works just as good with -2% hassle Edited July 27, 2006 by B3TA_SCR1PT3R [right][font="Courier New"]...Run these streets all day, I can sleep when I die.[/font] [/right] Link to comment Share on other sites More sharing options...
NELyon Posted July 27, 2006 Author Share Posted July 27, 2006 I'm just trying to get it to list the files in a list control. This will help me with my other project i'm working on (A program to help me transfer files between my pc-phone) Link to comment Share on other sites More sharing options...
GaryFrost Posted July 27, 2006 Share Posted July 27, 2006 might look at the function _GUICtrlListAddDir in the beta help SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. 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