#include <GUIConstants.au3>
#include <GuiListView.au3>
#include <Array.au3>


GUICreate("File Queue",220,250, 100,200,-1,$WS_EX_ACCEPTFILES)

$listview = GUICtrlCreateListView ("Files                                         ",10,55,200,175);,$LVS_SORTDESCENDING)
Opt("GUIOnEventMode", 1)
GUISetOnEvent($GUI_EVENT_CLOSE"CLOSEClicked")
GUISetOnEvent($GUI_EVENT_DROPPED"FILEDropped")

$drop = GUICtrlCreateInput ( "", 10, 10 , 200 , 25 , -1)


GUICtrlSetState($drop,$GUI_DROPACCEPTED)   ; to allow drag and dropping

GUISetState()

While 1
    TransferFile(_GUICtrlListViewGetItemText($listview,0))
    Sleep(500)
WEnd

Func CLOSEClicked()
  Exit
EndFunc

Func FILEDropped()
    $cmdFilesArray = StringSplit(StringReplace(StringReplace(GUICtrlRead($drop)@CRLF"|") & "|""||""|")"|")
    _ArrayPop($cmdFilesArray)
    $cmdFilesArray[0] -= 1
    GUICtrlSetData($drop,"")
    For $i = 1 to $cmdFilesArray[0] Step 1
        GUICtrlCreateListViewItem($cmdFilesArray[$i]$listview)
    Next
EndFunc

Func TransferFile($srcFile)
    $dest = IniRead ( "path.ini""Path""SavePath""default")
    If $srcFile <> "" Then
        Run(@ComSpec & ' /c move "' & $srcFile & '" "' & $dest & '"'@ScriptDir@SW_HIDE)
        While FileExists($srcFile) = 1
            Sleep(500)
        WEnd
        
        _GUICtrlListViewDeleteItem($listview,0)        
    EndIf
EndFunc 





   PREV    NEXT    

http://autoit.enestad.com
http://www.enestad.com