Hey liebe AutoIT Freunde. Und zwar habe ich ein Problem mit meinem Downloader.
Und zwar wenn Windows Vista's/7's Aero aus ist, flackert das Programm
Bei Win XP genau das selbe.
Da ich den "Source" eigendlich nicht veröffentlichen will (Spoiler) vergebe ich ihn nur an "vertrauten" Personen via PN.
Um selber das Problem zu testen :
http://lthd.de/downloads/LtHD-Setup.exe
Der Ganze Downloader Basiert auf diesem Script :
Spoiler anzeigen
#include <GUIConstantsEx.au3>
#include <GuiListView.au3>
#include <ListViewConstants.au3>
#include <StructureConstants.au3>
#include <WindowsConstants.au3>
#include <Array.au3>
Global $created = 0, $ID
Global $Pic, $Label, $Packname = 'nochkeins'
Global $hListView
Dim $aArray[3][5]=[['DL1','Link1','1','20 MB','/vorschau1.jpg'],['DL2','Link2','2','20 MB','/vorschau2.jpg'],['DL3','Link3','3','20 MB','/vorschau3.jpg']]
GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
If FileExists(@TempDir&'/vorschau1.jpg') = 0 Then InetGet('http://www.pixey.de/wp-content/uploads/2007/07/texturmauer.jpg',@TempDir&'/vorschau1.jpg',0)
If FileExists(@TempDir&'/vorschau2.jpg') = 0 Then InetGet("http://h3.abload.de/img/minecraftlogovwfaf.jpg", @TempDir&'/vorschau2.jpg',0)
If FileExists(@TempDir&'/vorschau3.jpg') = 0 Then InetGet('http://www.designersfondcollection.de/bild.aspx?id=122&G=32768',@Tempdir&'/vorschau3.jpg',0)
Global $GUI = GUICreate("Downloader", 547, 470)
Global $Processbar = GUICtrlCreateProgress(24, 392, 497, 25)
$Group1 = GUICtrlCreateGroup("Vorschau", 24, 112, 497, 257)
$Group1 = GUICtrlCreateGroup("Vorschau", 24, 112, 497, 257)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button2 = GUICtrlCreateButton("Download", 24, 430, 97, 25, $WS_GROUP)
_createListView()
GUISetState(@SW_SHOW)
Func _createListView()
Global $hListView = _GUICtrlListView_Create($GUI, "", 24, 16, 497, 89)
_GUICtrlListView_SetExtendedListViewStyle($hListView, BitOR($LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT, $LVS_EX_SUBITEMIMAGES))
_GUICtrlListView_InsertColumn($hListView, 0, "Name", 165)
_GUICtrlListView_InsertColumn($hListView, 1, "Auflösung", 165)
_GUICtrlListView_InsertColumn($hListView, 2, "Größe", 165)
For $i = 0 To UBound($aArray) -1
_GUICtrlListView_AddItem($hListView, $aArray[$i][0], 0)
_GUICtrlListView_AddSubItem($hListView, $i, $aArray[$i][2], 1)
_GUICtrlListView_AddSubItem($hListView, $i, $aArray[$i][3], 2)
Next
EndFunc
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button2
_download($ID)
EndSwitch
WEnd
Func _download($ID)
GUICtrlSetState($Button2,$GUI_DISABLE)
$hFileSize = InetGetSize($aArray[$ID][1])
$Anzeige = Round($hFileSize / 100,-1) ; auf ganze Zahl runden
$hDownload = InetGet($aArray[$ID][1],@DesktopDir& '\' & $aArray[$ID][0]&'.zip',0,1)
do
$aData = InetGetInfo($hDownload)
GUICtrlSetData($Processbar,Round($aData[0]*100/$aData[1],-1))
Until InetGetInfo($hDownload,2) ; Download fertig
MsgBox(0,"Download Abgeschlossen","Der Download von"&$aArray[$ID][0]&" ist abgeschlossen")
GUICtrlSetData($Processbar,'')
GUICtrlSetState($Button2,$GUI_ENABLE)
InetClose($hDownload)
EndFunc
Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
#forceref $hWnd, $iMsg, $iwParam
Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView, $tInfo
$hWndListView = $hListView
If Not IsHWnd($hListView) Then $hWndListView = GUICtrlGetHandle($hListView)
$tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
$hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
$iIDFrom = DllStructGetData($tNMHDR, "IDFrom")
$iCode = DllStructGetData($tNMHDR, "Code")
Switch $hWndFrom
Case $hWndListView
Switch $iCode
Case $NM_CLICK
$tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam)
$ID = DllStructGetData($tInfo, "Index")
_createImage(DllStructGetData($tInfo, "Index"))
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_NOTIFY
Func _createImage($lvSubID)
If $created = 1 Then
GUICtrlDelete($Pic)
GUICtrlDelete($Label)
$created = 0
Endif
If $created = 0 Then
$Pic = GUICtrlCreatePic(@TempDir&$aArray[$lvSubID][4],40,140,460,200)
$created = 1
Endif
EndFunc
[/autoit]