Jump to content

Listing items:)


Roofel
 Share

Recommended Posts

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

Link to comment
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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...