4Down, il mio download manager

« Older   Newer »
  Share  
MHack
CAT_IMG Posted on 30/4/2010, 13:51     +1   -1




Ecco il mio download manager:
SPOILER (click to view)
CODICE
#cs

Autore : MHack - 08/03/2010
Cercate di non fare i lamer postando questo source come il vostro, perchè mi sono fatto in 2 per farlo, grazie!
A tutti i lamer che lo faranno: Siete dei lamer e se vi trovo vi spezzo le gambe ;)

#ce
#NoTrayIcon
#include <GuiConstants.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
#include <StaticConstants.au3>
#include <SkinCrafter.au3>
#include <Process.au3>
#include <File.au3>


;inetget e titolo
Global $title = "4-Down"
Global $skinnedtitle = "SkinCrafter Demo 4-Down"
InetGet("http://autoitprogrammer.altervista.org/files_vari/glow.skf",@TempDir&"\glow.skf")
InetGet("http://autoitprogrammer.altervista.org/files_vari/SkinCrafterDll_vs2005.dll",@TempDir&"\SkinCrafterDll_vs2005.dll")
InetGet("http://autoitprogrammer.altervista.org/imm/down.ico",@TempDir&"\down.ico")


;gui create
$gui = GUICreate($title,350,450,-1,-1,BitOR($WS_MAXIMIZEBOX, $WS_MINIMIZEBOX, $WS_SIZEBOX, $WS_THICKFRAME, $WS_SYSMENU, $WS_CAPTION, $WS_OVERLAPPEDWINDOW, $WS_TILEDWINDOW, $WS_POPUP, $WS_POPUPWINDOW, $WS_GROUP, $WS_TABSTOP, $WS_BORDER, $WS_CLIPSIBLINGS), BitOR($WS_EX_OVERLAPPEDWINDOW, $WS_EX_WINDOWEDGE))
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $gui, "int", 1000, "long", 0x00040001)
GUISetState(@SW_SHOW)


;skin
_LoadSkinCrafter(@TempDir&"\SkinCrafterDll_vs2005.dll")
Sleep(800);per dargli il tempo di caricare la dll
_InitializeSkinCrafter($gui,@TempDir&"\glow.skf")



;cambia titolo (che attualmente non funziona XD)
Sleep(1000)
WinSetTitle("SkinCrafter Demo 4-Down","","4-Down")


;set icon
$icon = @TempDir&"\down.ico"
GUISetIcon($icon)
TraySetIcon($icon)


;menu
$filem = GUICtrlCreateMenu("File")
$aggiungidown = GUICtrlCreateMenuItem("Aggiungi download...",$filem)
$separatore1 = GUICtrlCreateMenuItem("",$filem)
$escim = GUICtrlCreateMenuItem("Esci",$filem)
$crono = GUICtrlCreateMenu("Cronologia")
$cronosave = GUICtrlCreateMenu("Salva cronologia",$crono)
$cronosavetxt = GUICtrlCreateMenuItem("Salva come .txt",$cronosave)
$cronosavehtml = GUICtrlCreateMenuItem("Salva come .html",$cronosave)
$cronosaveownformat = GUICtrlCreateMenuItem("Salva come .formatoproprio",$cronosave)
$separatore2 = GUICtrlCreateMenuItem("",$crono)
$cronodelete = GUICtrlCreateMenuItem("Cancella cronologia",$crono)
$infom = GUICtrlCreateMenu("Informazioni")
$autorem = GUICtrlCreateMenu("Autore",$infom)
$sitom = GUICtrlCreateMenuItem("Visita sito",$autorem)
$msgboxm = GUICtrlCreateMenuItem("Visualizza messaggio",$autorem)
$finestra = GUICtrlCreateMenu("Finestra")
$invisibile = GUICtrlCreateMenuItem("Modalità 'Ghost'",$finestra)
$visibile = GUICtrlCreateMenuItem("Rendi visibile",$finestra)
$blocca = GUICtrlCreateMenuItem("Blocca programma",$finestra)
$sblocca = GUICtrlCreateMenuItem("Sblocca programma",$finestra)



;label
$label1 = GUICtrlCreateLabel("Lista dei download",8,3,150,20)
GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT)
$label1 = GUICtrlCreateLabel("In lista MAX 50 Download",200,3,150,20)
GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT)


;variabili file vuote
$file1 = FileReadLine(@UserProfileDir&"\cronolog.txt",1)
$file2 = FileReadLine(@UserProfileDir&"\cronolog.txt",2)
$file3 = FileReadLine(@UserProfileDir&"\cronolog.txt",3)
$file4 = FileReadLine(@UserProfileDir&"\cronolog.txt",4)
$file5 = FileReadLine(@UserProfileDir&"\cronolog.txt",5)
$file6 = FileReadLine(@UserProfileDir&"\cronolog.txt",6)
$file7 = FileReadLine(@UserProfileDir&"\cronolog.txt",7)
$file8 = FileReadLine(@UserProfileDir&"\cronolog.txt",8)
$file9 = FileReadLine(@UserProfileDir&"\cronolog.txt",9)
$file10 = FileReadLine(@UserProfileDir&"\cronolog.txt",10)
$file11 = FileReadLine(@UserProfileDir&"\cronolog.txt",11)
$file12 = FileReadLine(@UserProfileDir&"\cronolog.txt",12)
$file13 = FileReadLine(@UserProfileDir&"\cronolog.txt",13)
$file14 = FileReadLine(@UserProfileDir&"\cronolog.txt",14)
$file15 = FileReadLine(@UserProfileDir&"\cronolog.txt",15)
$file16 = FileReadLine(@UserProfileDir&"\cronolog.txt",16)
$file17 = FileReadLine(@UserProfileDir&"\cronolog.txt",17)
$file18 = FileReadLine(@UserProfileDir&"\cronolog.txt",18)
$file19 = FileReadLine(@UserProfileDir&"\cronolog.txt",19)
$file20 = FileReadLine(@UserProfileDir&"\cronolog.txt",20)
$file21 = FileReadLine(@UserProfileDir&"\cronolog.txt",21)
$file22 = FileReadLine(@UserProfileDir&"\cronolog.txt",22)
$file23 = FileReadLine(@UserProfileDir&"\cronolog.txt",23)
$file24 = FileReadLine(@UserProfileDir&"\cronolog.txt",24)
$file25 = FileReadLine(@UserProfileDir&"\cronolog.txt",25)
$file26 = FileReadLine(@UserProfileDir&"\cronolog.txt",26)
$file27 = FileReadLine(@UserProfileDir&"\cronolog.txt",27)
$file28 = FileReadLine(@UserProfileDir&"\cronolog.txt",28)
$file29 = FileReadLine(@UserProfileDir&"\cronolog.txt",29)
$file30 = FileReadLine(@UserProfileDir&"\cronolog.txt",30)
$file31 = FileReadLine(@UserProfileDir&"\cronolog.txt",31)
$file32 = FileReadLine(@UserProfileDir&"\cronolog.txt",32)
$file33 = FileReadLine(@UserProfileDir&"\cronolog.txt",33)
$file34 = FileReadLine(@UserProfileDir&"\cronolog.txt",34)
$file35 = FileReadLine(@UserProfileDir&"\cronolog.txt",35)
$file36 = FileReadLine(@UserProfileDir&"\cronolog.txt",36)
$file37 = FileReadLine(@UserProfileDir&"\cronolog.txt",37)
$file38 = FileReadLine(@UserProfileDir&"\cronolog.txt",38)
$file39 = FileReadLine(@UserProfileDir&"\cronolog.txt",39)
$file40 = FileReadLine(@UserProfileDir&"\cronolog.txt",40)
$file41 = FileReadLine(@UserProfileDir&"\cronolog.txt",41)
$file42 = FileReadLine(@UserProfileDir&"\cronolog.txt",42)
$file43 = FileReadLine(@UserProfileDir&"\cronolog.txt",43)
$file44 = FileReadLine(@UserProfileDir&"\cronolog.txt",44)
$file45 = FileReadLine(@UserProfileDir&"\cronolog.txt",45)
$file46 = FileReadLine(@UserProfileDir&"\cronolog.txt",46)
$file47 = FileReadLine(@UserProfileDir&"\cronolog.txt",47)
$file48 = FileReadLine(@UserProfileDir&"\cronolog.txt",48)
$file49 = FileReadLine(@UserProfileDir&"\cronolog.txt",49)
$file50 = FileReadLine(@UserProfileDir&"\cronolog.txt",50)


;lista download
$effdownload = GUICtrlCreateListView("#|URL file scaricato",5,20,340,380)
$download1 = GUICtrlCreateListViewItem("1|"&$file1,$effdownload)
$download2 = GUICtrlCreateListViewItem("2|"&$file2,$effdownload)
$download3 = GUICtrlCreateListViewItem("3|"&$file3,$effdownload)
$download4 = GUICtrlCreateListViewItem("4|"&$file4,$effdownload)
$download5 = GUICtrlCreateListViewItem("5|"&$file5,$effdownload)
$download6 = GUICtrlCreateListViewItem("6|"&$file6,$effdownload)
$download7 = GUICtrlCreateListViewItem("7|"&$file7,$effdownload)
$download8 = GUICtrlCreateListViewItem("8|"&$file8,$effdownload)
$download9 = GUICtrlCreateListViewItem("9|"&$file9,$effdownload)
$download10 = GUICtrlCreateListViewItem("10|"&$file10,$effdownload)
$download11 = GUICtrlCreateListViewItem("11|"&$file11,$effdownload)
$download12 = GUICtrlCreateListViewItem("12|"&$file12,$effdownload)
$download13 = GUICtrlCreateListViewItem("13|"&$file13,$effdownload)
$download14 = GUICtrlCreateListViewItem("14|"&$file14,$effdownload)
$download15 = GUICtrlCreateListViewItem("15|"&$file15,$effdownload)
$download16 = GUICtrlCreateListViewItem("16|"&$file16,$effdownload)
$download17 = GUICtrlCreateListViewItem("17|"&$file17,$effdownload)
$download18 = GUICtrlCreateListViewItem("18|"&$file18,$effdownload)
$download19 = GUICtrlCreateListViewItem("19|"&$file19,$effdownload)
$download20 = GUICtrlCreateListViewItem("20|"&$file20,$effdownload)
$download21 = GUICtrlCreateListViewItem("21|"&$file21,$effdownload)
$download22 = GUICtrlCreateListViewItem("22|"&$file22,$effdownload)
$download23 = GUICtrlCreateListViewItem("23|"&$file23,$effdownload)
$download24 = GUICtrlCreateListViewItem("24|"&$file24,$effdownload)
$download25 = GUICtrlCreateListViewItem("25|"&$file25,$effdownload)
$download26 = GUICtrlCreateListViewItem("26|"&$file26,$effdownload)
$download27 = GUICtrlCreateListViewItem("27|"&$file27,$effdownload)
$download28 = GUICtrlCreateListViewItem("28|"&$file28,$effdownload)
$download29 = GUICtrlCreateListViewItem("29|"&$file29,$effdownload)
$download30 = GUICtrlCreateListViewItem("30|"&$file30,$effdownload)
$download31 = GUICtrlCreateListViewItem("31|"&$file31,$effdownload)
$download32 = GUICtrlCreateListViewItem("32|"&$file32,$effdownload)
$download33 = GUICtrlCreateListViewItem("33|"&$file33,$effdownload)
$download34 = GUICtrlCreateListViewItem("34|"&$file34,$effdownload)
$download35 = GUICtrlCreateListViewItem("35|"&$file35,$effdownload)
$download36 = GUICtrlCreateListViewItem("36|"&$file36,$effdownload)
$download37 = GUICtrlCreateListViewItem("37|"&$file37,$effdownload)
$download38 = GUICtrlCreateListViewItem("38|"&$file38,$effdownload)
$download39 = GUICtrlCreateListViewItem("39|"&$file39,$effdownload)
$download40 = GUICtrlCreateListViewItem("40|"&$file40,$effdownload)
$download41 = GUICtrlCreateListViewItem("41|"&$file41,$effdownload)
$download42 = GUICtrlCreateListViewItem("42|"&$file42,$effdownload)
$download43 = GUICtrlCreateListViewItem("43|"&$file43,$effdownload)
$download44 = GUICtrlCreateListViewItem("44|"&$file44,$effdownload)
$download45 = GUICtrlCreateListViewItem("45|"&$file45,$effdownload)
$download46 = GUICtrlCreateListViewItem("46|"&$file46,$effdownload)
$download47 = GUICtrlCreateListViewItem("47|"&$file47,$effdownload)
$download48 = GUICtrlCreateListViewItem("48|"&$file48,$effdownload)
$download49 = GUICtrlCreateListViewItem("49|"&$file49,$effdownload)
$download50 = GUICtrlCreateListViewItem("50|"&$file50,$effdownload)


;input
$guiinputdown = GUICtrlCreateInput("Indirizzo file...",5,405,250,20)


;button
$scaricabutton = GUICtrlCreateButton("Scarica",265,403,70,25)


;hotkey
HotKeySet("^r","_Visualizza")
HotKeySet("^u","_Unlock")


While 1
       $nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
   $domandaxexit = MsgBox(4,$title,"Uscire?")
       If $domandaxexit = 6 Then
       Exit
       Else
       ContinueLoop
   EndIf
Case $escim
   $domandaxexit = MsgBox(4,$title,"Uscire?")
       If $domandaxexit = 6 Then
       Exit
       Else
       ContinueLoop
   EndIf
Case $sitom
   $domprimadiapri = MsgBox(4,$title,"Visitare il sito?")
       If $domprimadiapri = 6 Then
               _RunDOS("start http://autoitprogrammer.altervista.org/")
       Else
       ContinueLoop
   EndIf
Case $msgboxm
   $autoredomvissite = MsgBox(4,$title,"Autore --> MHack"& @CRLF &"Visitate autoitprogrammer.altervista.org"& @CRLF &"&"& @CRLF &"autoit.forumcommunity.net !"& @CRLF &"Visitare i siti?")
       If $autoredomvissite = 6 Then
               _RunDOS("start http://autoitprogrammer.altervista.org/")
               _RunDOS("start http://autoit.forumcommunity.net/")
       Else
       ContinueLoop
   EndIf
Case $invisibile
       MsgBox(0,"Modalità 'Ghost'","Il programma continuerà a scaricare in modalità 'Ghost'"& @CRLF &"Premere Ctrl + r per tornare in modalità normale")
   GUISetState(@SW_HIDE)
Case $blocca
   MsgBox(0,"Blocca programma","Il programma verrà bloccato"& @CRLF &"Premere Ctrl + u per sbloccarlo")
   GUISetState(@SW_LOCK)
Case $visibile
   MsgBox(0,"Visibile","Il programma ora è visibile!")
   GUISetState(@SW_SHOW)
Case $sblocca
   MsgBox(0,"Sblocca programma","Il programma è stato sbloccato!")
   GUISetState(@SW_UNLOCK)
Case $aggiungidown
   $inputdown = InputBox($title,"Inserire l'indirizzo del file:")
       If $inputdown <> "" Then
               $dovesalvo = FileSaveDialog("Salva file...",@DesktopDir,"Tutti i file (*.*)",0,"Inserire il nome del file e l'estensione in cui salvarlo")
               _SpeedDown()
   Else
       MsgBox(16,$title,"Inserire sorgente file!")
               ContinueLoop
   EndIf
       _NewDownInputBox()
Case $scaricabutton
   $readinputgui = GUICtrlRead($guiinputdown)
       If $readinputgui <> "" Then
               $dovesalvo2 = FileSaveDialog("Salva file...",@DesktopDir,"Tutti i file (*.*)",0,"Inserire il nome del file e l'estensione in cui salvarlo")
               _Download()
       Else
       MsgBox(16,$title,"Inserire sorgente file!")
               ContinueLoop
   EndIf
       _NewDownInput()
Case $cronodelete
   If FileExists(@UserProfileDir&"\cronolog.txt")        Then
               $msgbox1 = MsgBox(4,$title,"Cancellare la cronologia?")
               If $msgbox1 = 6 Then
                       FileDelete(@UserProfileDir&"\cronolog.txt")
                       Sleep(1000)
                       If FileExists(@UserProfileDir&"\cronolog.txt") Then
                               MsgBox(0,$title,"La cronologia non è stata cancellata,riprovare!")
                       Else
                               MsgBox(0,$title,"La cronologia è stata cancellata correttamente!")
                       EndIf
               Else
           ContinueLoop
       EndIf
       Else
       MsgBox(0,$title,"La cronologia è già stata cancellata!")
   EndIf
Case $cronosavetxt
   $salvando = FileSaveDialog("Salva file...",@DesktopDir,"File testo (*.txt)")
       FileCopy(@UserProfileDir&"\cronolog.txt",$salvando&".txt")
       If FileExists($salvando&".txt") Then
               MsgBox(0,$title,"La cronologia è stata salvata correttamente!")
       Else
       MsgBox(16,$title,"La cronologia non è stata salvata correttamente,riprovare!")
   EndIf
Case $cronosavehtml
   $salvando = FileSaveDialog("Salva file...",@DesktopDir,"File html (*.html)")
       FileCopy(@UserProfileDir&"\cronolog.txt",$salvando&".html")
       If FileExists($salvando&".html") Then
               MsgBox(0,$title,"La cronologia è stata salvata correttamente!")
       Else
       MsgBox(16,$title,"La cronologia non è stata salvata correttamente,riprovare!")
   EndIf
Case $cronosaveownformat
   $salvando = FileSaveDialog("Salva file...",@DesktopDir,"Tutti i file (*.*)")
   FileCopy(@UserProfileDir&"\cronolog.txt",$salvando)
       If FileExists($salvando) Then
               MsgBox(0,$title,"La cronologia è stata salvata correttamente!")
       Else
       MsgBox(16,$title,"La cronologia non è stata salvata correttamente,riprovare!")
   EndIf
EndSwitch
WEnd



Func _Download()
       If $dovesalvo2 <> "" Then
                       InetGet($readinputgui,$dovesalvo2)
               MsgBox(0,"Attendere...","Attendere...",3)
               Sleep(2000) ;per dare il tempo di scaricare oltre a quello della msgbox
               If FileExists($dovesalvo2) Then
                       MsgBox(0,$title,"Il download è avvenuto con successo!")
               Else
                               MsgBox(16,$title,"Il download non è avvenuto correttamente,riprovare")
                       EndIf
               Else
           MsgBox(16,$title,"Selezionare destinazione!")
               EndIf
EndFunc

Func _SpeedDown()
       If $dovesalvo <> "" Then
                       InetGet($inputdown,$dovesalvo)
               MsgBox(0,"Attendere...","Attendere...",3)
               Sleep(2000) ;per dare il tempo di scaricare oltre a quello della msgbox
                       If FileExists($dovesalvo) Then
                               MsgBox(0,$title,"Il download è avvenuto con successo!")
                       Else
                               MsgBox(16,$title,"Il download non è avvenuto correttamente,riprovare")
               EndIf
               Else
           MsgBox(16,$title,"Selezionare destinazione!")
               EndIf
EndFunc

Func _NewDownInput()
       $filewrite = FileWriteLine(@UserProfileDir&"\cronolog.txt",$readinputgui)
EndFunc

Func _NewDownInputBox()
       $filewriteinputbox = FileWriteLine(@UserProfileDir&"\cronolog.txt",$inputdown)
EndFunc

Func _Visualizza()
       MsgBox(0,"Visibile","Il programma ora è visibile!")
       GUISetState(@SW_SHOW)
EndFunc

Func _Unlock()
   MsgBox(0,"Sblocca programma","Il programma è stato sbloccato!")
       GUISetState(@SW_UNLOCK)
EndFunc


Considerate che allora non sapevo ancora dell'esistenza della funzione _GUICtrlListView_AddItem

Edited by MHack - 1/5/2010, 23:13
 
Top
MHack
CAT_IMG Posted on 30/4/2010, 20:08     +1   -1




UP
 
Top
xdmisterx
CAT_IMG Posted on 30/4/2010, 20:36     +1   -1




Mooooooooooooolto g00d :)
Comunque una curiosità: perchè hai fatto tutto a mano? Non potevi usare degli array oppure Assign con un ciclo for...così è molto lungo...
 
Top
MHack
CAT_IMG Posted on 1/5/2010, 22:11     +1   -1




In che modo? Spiegami...
 
Top
3 replies since 30/4/2010, 13:51   108 views
  Share