Roofel Posted February 24, 2008 Posted February 24, 2008 (edited) Hello again:)I was just wondering if it possible to click a button and then all the files in a directory shows up like this part of Valuater's Autoit 123?I know the files are "prepared" to be set there but is it possible to do the same but with other items?To do such thing what would be source be and is it anywhere in the Helpfile i can find it? I cant find it since im not sure what to look for(names etc)Was thinking about using _GDIPlus_ImageLoadFromFile.au3 to show the image but im not exactly sure how to add this to a GUI but i will figure out that later on:)Hope you understand, Not exactly sure how to formulate the question:)Best Regards, Roofel Edited February 24, 2008 by Roofel Never argue with an idiot, he will just bring you down to his own level and beat you with experience! :D
Zedna Posted February 24, 2008 Posted February 24, 2008 (edited) From helpfile: #Include <File.au3> #Include <Array.au3> $FileList=_FileListToArray(@DesktopDir) If @Error=1 Then MsgBox (0,"","No Files\Folders Found.") Exit EndIf _ArrayDisplay($FileList,"$FileList") Edited February 24, 2008 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search
Roofel Posted February 24, 2008 Author Posted February 24, 2008 Thanks:) Problem is that i get a whole new window and not in the one i got:) Any chance on fixing that? Using ListView inside the GUI any way to put the files inside there? Never argue with an idiot, he will just bring you down to his own level and beat you with experience! :D
Zedna Posted February 24, 2008 Posted February 24, 2008 (edited) For creating AutoIt GUIs use Koda tool which comes with Scite4AutoIt3 -> in menu Tools/KodaKoda link is also hereFor adding ListView items use FOR NEXT loop over your array of files and GUICtrlCreateListViewItem() -> details in AutoIt helpfile Edited February 24, 2008 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search
Roofel Posted February 24, 2008 Author Posted February 24, 2008 (edited) How would that work? Possible to give any examples? Trying to make an list of files in a folder then making it show in the Listview in my GUI. Tried to look at For...In...Next but couldnt really find anything to work at:S Current script: expandcollapse popup#include <GUIConstants.au3> #include <File.au3> #include <Array.au3> $Gui=GUICreate("MSN contact images", 210,200) $Listfiles=GUICtrlCreateButton("List Files", 5, 115, 100,40) $Copy=GUICtrlCreateButton("Copy images", 105, 115, 100, 40) $About=GUICtrlCreateButton("About", 105, 155, 100, 40) $Exit=GUICtrlCreateButton("Exit", 5,155, 100,40) $Listview=GUICtrlCreateListView("Thumbnails", 5,5,200, 105) GUISetState(@SW_SHOW) While 1 $msg=GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit Case $Listfiles Array() case $Copy FileCopy(@TempDir & "\Cache\*.*", "C:\Thumbnails\*.gif", 1) FileCreateShortcut("C:\Thumbnails\", @DesktopDir & "\Thumbnails","","","",@ProgramFilesDir & "\MSN Messenger\msnmsgr.exe", "","0") Case $About MsgBox(0, "About:", "This program was scripted by Roofel using the amasing software AutoIt3") Case $Exit Exit EndSwitch WEnd ;--Here is the part i messed up... Func Array() $String="" For $Listview In $List $String = $String & $Listview Next $ListViewItem=GUICtrlCreateListViewItem("", $Listview) Func Array() $String="" For $Listview In $List $String = $String & $Listview & @CRLF Next $ListViewItem=GUICtrlCreateListViewItem("", $Listview) $List=_FileListToArray(@TempDir & "\Cache") $Display=_ArrayDisplay($List) If @error=1 Then MsgBox(0, "", "No files or Folders were found!") EndIf EndFunc $Display=_ArrayDisplay($List) If @error=1 Then MsgBox(0, "", "No files or Folders were found!") EndIf EndFunc Edited February 24, 2008 by Roofel Never argue with an idiot, he will just bring you down to his own level and beat you with experience! :D
Zedna Posted February 24, 2008 Posted February 24, 2008 Func Array() $List = _FileListToArray(@TempDir & "\Cache") If @error Then MsgBox(0, "", "No files or Folders were found!") Return EndIf For $i = 1 To $List[0] GUICtrlCreateListViewItem($List[$i], $Listview) Next EndFunc ;==>Array Resources UDF ResourcesEx UDF AutoIt Forum Search
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