Meine Proyect
Spoiler anzeigen
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <File.au3>
#include <Array.au3>
#include <GuiMenu.au3>
#include <GuiListView.au3>
#include <GuiListBox.au3>
$Form1 = GUICreate("Extragere Fisier by C0dex v2.1", 627, 569, 192, 124)
$Button1 = GUICtrlCreateButton("Adauga Folder", 8, 8, 99, 25, -1, $WS_EX_STATICEDGE)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Input1 = GUICtrlCreateInput("Running...", 112, 8, 505, 24, -1, BitOR($WS_EX_CLIENTEDGE,$WS_EX_STATICEDGE))
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
$Label1 = GUICtrlCreateLabel("Arata doar fisier cu extensia :", 8, 40, 204, 23, -1, $WS_EX_STATICEDGE)
GUICtrlSetFont(-1, 10, 800, 0, "Comic Sans MS")
GUICtrlSetColor(-1, 0x000000)
GUICtrlSetBkColor(-1, 0xFF0000)
$Input2 = GUICtrlCreateInput("txt", 216, 40, 81, 24, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER), BitOR($WS_EX_CLIENTEDGE,$WS_EX_STATICEDGE))
GUICtrlSetFont(-1, 9, 800, 0, "Comic Sans MS")
$Button2 = GUICtrlCreateButton("Salveaza Lista Fisierelor", 304, 40, 163, 25, -1, $WS_EX_STATICEDGE)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Button3 = GUICtrlCreateButton("Sterge Lista", 472, 40, 147, 25, -1, $WS_EX_STATICEDGE)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$ListView1 = GUICtrlCreateListView("Numar Fisier|Nume Fisier", 8, 72, 610, 366)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 100)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 700)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Progress1 = GUICtrlCreateProgress(8, 448, 610, 17)
GUICtrlSetColor(-1, 0x000000)
GUICtrlSetBkColor(-1, 0xFF0000)
$Button4 = GUICtrlCreateButton("Arata Statistica cu procentaj % din toate fisierele ", 8, 472, 611, 25, -1, $WS_EX_STATICEDGE)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Label2 = GUICtrlCreateLabel("Extensia selectata de tine este :", 8, 504, 215, 23, -1, $WS_EX_STATICEDGE)
GUICtrlSetFont(-1, 10, 800, 0, "Comic Sans MS")
GUICtrlSetColor(-1, 0x000000)
GUICtrlSetBkColor(-1, 0xFF0000)
$Input3 = GUICtrlCreateInput("", 232, 504, 81, 24, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER), BitOR($WS_EX_CLIENTEDGE,$WS_EX_STATICEDGE))
GUICtrlSetFont(-1, 9, 800, 0, "Comic Sans MS")
$Label3 = GUICtrlCreateLabel("Fisiere ramase alte extensi:", 320, 504, 182, 23, -1, $WS_EX_STATICEDGE)
GUICtrlSetFont(-1, 10, 800, 0, "Comic Sans MS")
GUICtrlSetColor(-1, 0x000000)
GUICtrlSetBkColor(-1, 0xFF0000)
$Input4 = GUICtrlCreateInput("", 512, 504, 105, 24, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER), BitOR($WS_EX_CLIENTEDGE,$WS_EX_STATICEDGE))
GUICtrlSetFont(-1, 9, 800, 0, "Comic Sans MS")
$Button5 = GUICtrlCreateButton("Contact", 8, 536, 163, 25, -1, $WS_EX_STATICEDGE)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Button6 = GUICtrlCreateButton("Info", 176, 536, 163, 25, -1, $WS_EX_STATICEDGE)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Button7 = GUICtrlCreateButton("Exit Programm", 344, 536, 163, 25, -1, $WS_EX_STATICEDGE)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Label4 = GUICtrlCreateLabel("By C0dex ", 512, 538, 106, 21, $SS_CENTER, BitOR($WS_EX_STATICEDGE,$GUI_WS_EX_PARENTDRAG))
GUICtrlSetFont(-1, 9, 800, 0, "Palatino Linotype")
GUICtrlSetColor(-1, 0x000000)
GUICtrlSetBkColor(-1, 0xFF0000)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
$adauga = FileSelectFolder("Adauga Folder",@DesktopCommonDir,1+2+4,"",$Form1)
GUICtrlSetData($Input1,$adauga)
$fisiere= _FileListToArrayEx($adauga,"*."&GUICtrlRead($Input2),12)
If IsArray($fisiere) Then
For $i = 1 To $fisiere[0]
GUICtrlCreateListViewItem($I&"|"&$fisiere[$i], $ListView1)
GUICtrlSetData($Progress1,$i+100-$i)
Next
MsgBox(0,"","Afisare completa !")
EndIf
#cs
ProgressOn("Progress Meter", "Increments every second", "0 percent")
For $i = 10 To 100 Step 10
Sleep(1000)
ProgressSet($i, $i & " percent")
Next
ProgressSet(100, "Done", "Complete")
Sleep(500)
ProgressOff()
#ce
Case $Button2
salveazatxt()
º
case $Button3
$stergere = _GUICtrlListView_DeleteAllItems(GUICtrlGetHandle($ListView1))
Case $Button4
GUICtrlSetData($Input3,_GUICtrlListView_GetItemCount($ListView1))
$toate = _FileListToArrayEx($adauga,"*.*",12)
For $ii = 1 To $toate[0]
GUICtrlSetData($Input4,$ii-GUICtrlRead($Input3))
Next
Case $Button5
;MsgBox features: Title=Yes, Text=Yes, Buttons=OK, Icon=Warning
MsgBox(48,"Info","Created by C0dex" & @CRLF & "Contact : hellshare60@gmail.com" & @CRLF & "__________________________")
Case $Button6
;MsgBox features: Title=Yes, Text=Yes, Buttons=OK, Icon=Info
MsgBox(64,"Info","Acest Programm a fost creat de catre C0dex" & @CRLF & "Anul = 2012/2013" & @CRLF & "---------------------------------------------------------------------" & @CRLF & "HELLSHARE60@GMAIL.COM" & @CRLF & "---------------------------------------------------------------------" & @CRLF & "Toate drepturile rezervate." & @CRLF & "---------------------------------------------------------------------" & @CRLF & "-------------------------Bye --------------------------------------")
Case $Button7
Exit(-1)
EndSwitch
WEnd
Func _FileListToArrayEx($sPath, $sFilter = "*", $iFlag = 0)
Local $hSearch, $sFile, $sFileList, $iFlags = StringReplace(BitAND($iFlag, 1) + BitAND($iFlag, 2), "3", "0"), $sSDir = BitAND($iFlag, 4), $FPath = "", $sDelim = "|", $sSDirFTMP = $sFilter
$sPath = StringRegExpReplace($sPath, "[\\/]+\z", "") & "\"
If Not FileExists($sPath) Then Return SetError(1, 1, "")
If BitAND($iFlag, Then $FPath = $sPath
If StringRegExp($sFilter, "[\\/:><]|(?s)\A\s*\z") Then Return SetError(2, 2, "")
If Not ($iFlags = 0 Or $iFlags = 1 Or $iFlags = 2 Or $sSDir = 4 Or $FPath <> "") Then Return SetError(3, 3, "")
$hSearch = FileFindFirstFile($sPath & "*")
If @error Then Return SetError(4, 4, "")
Local $hWSearch = $hSearch, $hWSTMP = $hSearch, $SearchWD, $sSDirF[3] = [0, StringReplace($sSDirFTMP, "*", ""), "(?i)(" & StringRegExpReplace(StringRegExpReplace(StringRegExpReplace(StringRegExpReplace(StringRegExpReplace(StringRegExpReplace("|" & $sSDirFTMP & "|", '\|\h*\|[\|\h]*', "\|"), '[\^\$\(\)\+\[\]\{\}\,\.\]', "\\$0"), "\|([^\*])", "\|^$1"), "([^\*])\|", "$1\$\|"), '\*', ".*"), '^\||\|$', "") & ")"]
While 1
$sFile = FileFindNextFile($hWSearch)
If @error Then
If $hWSearch = $hSearch Then ExitLoop
FileClose($hWSearch)
$hWSearch -= 1
$SearchWD = StringLeft($SearchWD, StringInStr(StringTrimRight($SearchWD, 1), "\", 1, -1))
ElseIf $sSDir Then
$sSDirF[0] = @extended
If ($iFlags + $sSDirF[0] <> 2) Then
If $sSDirF[1] Then
If StringRegExp($sFile, $sSDirF[2]) Then $sFileList &= $sDelim & $FPath & $SearchWD & $sFile
Else
$sFileList &= $sDelim & $FPath & $SearchWD & $sFile
EndIf
EndIf
If Not $sSDirF[0] Then ContinueLoop
$hWSTMP = FileFindFirstFile($sPath & $SearchWD & $sFile & "\*")
If $hWSTMP = -1 Then ContinueLoop
$hWSearch = $hWSTMP
$SearchWD &= $sFile & "\"
Else
If ($iFlags + @extended = 2) Or StringRegExp($sFile, $sSDirF[2]) = 0 Then ContinueLoop
$sFileList &= $sDelim & $FPath & $sFile
EndIf
WEnd
FileClose($hSearch)
If Not $sFileList Then Return SetError(4, 4, "")
Return StringSplit(StringTrimLeft($sFileList, 1), "|")
EndFunc
Func salveazatxt()
$sfile = FileSaveDialog("Salvati Fisierele",@DesktopDir,"Text files (*.txt)","",GUICtrlRead($ListView1),$Form1)
If Not @error Then
Local $file = FileOpen($sfile&".txt", 1)
For $i = 0 To _GUICtrlListView_GetItemCount($ListView1)-1
FileWrite($file,_GUICtrlListView_GetItemTextString($ListView1,$i)&@CRLF)
Next
EndIf
EndFunc
Edit (Xeno) : Spoiler.
Tank's AutoiT.DE