Sign in to follow this  
Followers 0
Roofel

Listing items:)

6 posts in this topic

#1 ·  Posted (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?

Posted Image

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 by Roofel

Never argue with an idiot, he will just bring you down to his own level and beat you with experience! :D

Share this post


Link to post
Share on other sites



#2 ·  Posted (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 by Zedna

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

For creating AutoIt GUIs use Koda tool which comes with Scite4AutoIt3 -> in menu Tools/Koda

Koda link is also here

For adding ListView items use FOR NEXT loop over your array of files and GUICtrlCreateListViewItem() -> details in AutoIt helpfile

Edited by Zedna

Share this post


Link to post
Share on other sites

#5 ·  Posted (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:

#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 by Roofel

Never argue with an idiot, he will just bring you down to his own level and beat you with experience! :D

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  
Followers 0