1. Dashboard
  2. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team
    4. Mitgliedersuche
  3. Forenregeln
  4. Forum
    1. Unerledigte Themen
  • Anmelden
  • Registrieren
  • Suche
Alles
  • Alles
  • Artikel
  • Seiten
  • Forum
  • Erweiterte Suche
  1. AutoIt.de - Das deutschsprachige Forum.
  2. Mitglieder
  3. Paul01

Beiträge von Paul01

  • Patcher patcht nur teilweise

    • Paul01
    • 17. Februar 2017 um 17:27
    AutoIt
    Do
               If($GUI_EVENT_CLOSE) Then
                  _Crypt_Shutdown()
                  Exit
                Else
                $BytesDownloaded = InetGetInfo($Download, 0)
                $FileProgress = Floor(($BytesDownloaded / $sizeb) * 100)
                If GUICtrlRead($progr_dateidown) <> $FileProgress Then
                    GUICtrlSetData($progr_dateidown, $FileProgress)
                    GUICtrlSetData($label_dateidown, $FileProgress & " %")
                 EndIf
                EndIf
            Until InetGetInfo($Download, 2)
            GUICtrlSetData($label_dateidown, "")
    Alles anzeigen

    Kann man das so machen?
    Bin noch Anfänger :)

  • Patcher patcht nur teilweise

    • Paul01
    • 17. Februar 2017 um 17:01

    Das mit der Do-Until Schleife erscheint mir gerade am einfachsten ist aber denke ich nicht die beste Möglichkeit, was? :D
    Naja ich versuchs mal mit ner Do-Until Schleife. Die muss dann in _patch oder?

    EDIT:

    Zitat von Zeitriss

    Ich glaube er meinte das er wärend des Patch vorgangs das Programm nicht schließen kann,

    ^ hab ich aber auch 3 mal geschrieben? :D

  • Patcher patcht nur teilweise

    • Paul01
    • 17. Februar 2017 um 16:54

    Meinst du so?

    AutoIt
    While 1
    	$nMsg = GUIGetMsg()
    	Switch $nMsg
    	Case $GUI_EVENT_CLOSE
    			_Crypt_Shutdown()
    			Exit
    		Case $button_cc
    			Run( "config.exe", @WorkingDir)
    		Case $button_patch
    MsgBox(0, "Box", "")
    			_patch()
    		Case $button_homepage
    			ShellExecute($homepage)
    		Case $button_start
    			Run($execute, @WorkingDir)
    			Exit
    	EndSwitch
    WEnd
    Alles anzeigen

    Weil wenn ja, versteh ich den Sinn noch nicht

  • Patcher patcht nur teilweise

    • Paul01
    • 17. Februar 2017 um 16:37

    Also das Problem hab ich nur wenn er gerade was läd.
    Wenn der so offen ist und ich nichts mach, kann ich ihn auch schließen.

    Wenn ich nichts mache: -3
    Mit patchen: Passiert iwie gar nichts, nichtma ne Ausgabe. Also ruft er die Case Abfrage ja nichma auf oder?

  • Patcher patcht nur teilweise

    • Paul01
    • 17. Februar 2017 um 16:00

    Patcht du auch was? Weil das ist nur der Fall, wenn er gerade was läd.

    AutoIt
    #RequireAdmin
    #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
    #AutoIt3Wrapper_Res_Comment=
    #AutoIt3Wrapper_Res_Description=
    #AutoIt3Wrapper_Res_Fileversion=1.0.0.1
    #AutoIt3Wrapper_Res_LegalCopyright=
    #AutoIt3Wrapper_Res_Language=1031
    #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <GUIListBox.au3>
    #include <GUIListView.au3>
    #include <MsgBoxConstants.au3>
    #include <ProgressConstants.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <InetConstants.au3>
    #include <File.au3>
    #include <Array.au3>
    #include <Crypt.au3>
    #include <WinAPI.au3>
    #include <ColorConstants.au3>
    Global $a__GUICtrl_SOH_Ctrls[1][1]
    Global $a__GUICtrl_SOH_LastHoveredElements[2] 		= [-1, -1]
    Global $a__GUICtrl_SOH_LastHoveredElementsMark 		= -1
    Global $h__GUICtrl_SOH_LastClickedElementMark 		= -1
    Global $i__GUICtrl_SOH_CtrlsModified				= 0
    Global $i__GUICtrl_SOH_HoverOnBackWin				= 1
    Global $i__GUICtrl_SOH_LastPrimaryDownCtrlID		= 0
    Global $p__GUICtrl_SOH_TimerProc 					= 0
    Global $i__GUICtrl_SOH_TimerID 						= 0
    Global $s__GUICtrl_SOH_User32_Dll					= @SystemDir & "\User32.dll"
    Global $s__GUICtrl_SOH_OnExitFunc 					= ""
    Global Const $n__GUICtrl_SOH_WM_COMMAND				= 0x0111
    Global Const $n__GUICtrl_SOH_WM_LBUTTONDOWN			= 0x0201
    
    
    Global $serverhttp = "http://localhost/"
    Global $patcherini = (@TempDir & "\patcher.ini")
    Global $patcherurl = ($serverhttp & "patcher.ini")
    Global $homepage = ""
    Global $execute = "start.exe"
    
    
    If FileExists($patcherini) Then
    	FileDelete($patcherini)
    EndIf
    If InetGetSize($patcherurl) = 0 Then
    	MsgBox(0, "Error", "Patcherini konnte nicht geladen werden. Patchserver konnte nicht erreicht werden.")
    	Exit
    Else
    	InetGet($patcherurl, $patcherini, $INET_FORCERELOAD)
    EndIf
    
    
    DirCreate(@ScriptDir & "\data")
    
    
    
    
    $font="Verdana"
    
    
    GUICreate("Patcher", 450, 360, 192, 124, $WS_POPUP)
    ;GUISetStyle ($WS_BORDER)
    GUICtrlCreatePic(@ScriptDir & '\data\background.jpg', 0, 0, 450, 360)
    GUICtrlSetState(-1, $GUI_DISABLE)
    
    
    
    
    $labelFortschritt = GUICtrlCreateLabel("Gesamtfortschritt", 8, 84, 130, 17)
    GUICtrlSetFont ($labelFortschritt,9, 600, -1, $font)
    GUICtrlSetColor($labelFortschritt, $COLOR_WHITE)
    GUICtrlSetBkColor($labelFortschritt, $GUI_BKCOLOR_TRANSPARENT)
    
    
    $labelNews = GUICtrlCreateLabel("News:", 8, 180, 37, 17)
    GUICtrlSetColor($labelNews, $COLOR_WHITE)
    GUICtrlSetBkColor ( $labelNews, $GUI_BKCOLOR_TRANSPARENT)
    
    
    $labelDatei = GUICtrlCreateLabel("Datei Download", 8, 20, 120, 17)
    GUICtrlSetFont ($labelDatei,9, 600, -1, $font)
    GUICtrlSetColor($labelDatei, $COLOR_WHITE)
    GUICtrlSetBkColor ( $labelDatei, $GUI_BKCOLOR_TRANSPARENT)
    
    
    $progr_fortschritt = GUICtrlCreateProgress(8, 104, 249, 25)
    $progr_dateidown = GUICtrlCreateProgress(8, 40, 249, 17)
    $label_dateidown = GUICtrlCreateLabel("", 130, 20, 68, 17)
    GUICtrlSetColor($label_dateidown, $COLOR_WHITE)
    GUICtrlSetBkColor ($label_dateidown, $GUI_BKCOLOR_TRANSPARENT)
    
    
    $button_patch = GUICtrlCreatePic(@ScriptDir & '\data\patchen.jpg', 280, 8, 160, 33)
    _GUICtrl_OnHoverRegister(-1, "_Hover_Proc", "_Leave_Hover_Proc")
    
    
    
    
    $button_homepage = GUICtrlCreatePic(@ScriptDir & '\data\homepage.jpg', 280, 48, 160, 33)
    _GUICtrl_OnHoverRegister(-1, "_Hover_Proc", "_Leave_Hover_Proc")
    
    
    
    
    $button_cc = GUICtrlCreatePic(@ScriptDir & '\data\config.jpg', 280, 88, 160, 33)
    _GUICtrl_OnHoverRegister(-1, "_Hover_Proc", "_Leave_Hover_Proc")
    
    
    $button_start = GUICtrlCreatePic(@ScriptDir & '\data\start.jpg', 280, 128, 160, 33)
    _GUICtrl_OnHoverRegister(-1, "_Hover_Proc", "_Leave_Hover_Proc")
    
    
    
    
    
    
    
    
    
    
    
    
    Func _Hover_Proc($iCtrlID)
    	Switch $iCtrlID
    		Case $button_patch
    			GUICtrlSetImage($iCtrlID,@ScriptDir & '\data\patchen_hover.jpg')
    		Case $button_homepage
    			GUICtrlSetImage($iCtrlID,@ScriptDir & '\data\homepage_hover.jpg')
    		Case $button_cc
    			GUICtrlSetImage($iCtrlID,@ScriptDir & '\data\config_hover.jpg')
    		Case $button_start
    			GUICtrlSetImage($iCtrlID,@ScriptDir & '\data\start_hover.jpg')
    	EndSwitch
    EndFunc
    
    
    Func _Leave_Hover_Proc($iCtrlID)
    	Switch $iCtrlID
    		Case $button_patch
    			GUICtrlSetImage($iCtrlID,@ScriptDir & '\data\patchen.jpg')
    		Case $button_homepage
    			GUICtrlSetImage($iCtrlID,@ScriptDir & '\data\homepage.jpg')
    		Case $button_cc
    			GUICtrlSetImage($iCtrlID,@ScriptDir & '\data\config.jpg')
    		Case $button_start
    			GUICtrlSetImage($iCtrlID,@ScriptDir & '\data\start.jpg')
    
    
    	EndSwitch
    EndFunc
    
    
    
    
    
    
    $list_news = GUICtrlCreateListView("Datum|Nachricht", 8, 195, 434, 146)
    _GUICtrlListView_SetColumnWidth($list_news, 1, 290)
    $labelMadeBy = GUICtrlCreateLabel("By Paul01", 340, 345, 140, 20)
    GUICtrlSetColor($labelMadeBy, $COLOR_WHITE)
    GUICtrlSetBkColor ($labelMadeBy, $GUI_BKCOLOR_TRANSPARENT)
    GUISetState(@SW_SHOW)
    
    
    GUICtrlSetState($button_start, $GUI_DISABLE)
    
    
    Local $val1
    $val1 = IniReadSection($patcherini, "News")
    If Not IsArray($val1) Then
    	MsgBox(0, "Error", "1002. Array Defekt.")
    	Exit
    EndIf
    For $i = 1 To UBound($val1) -1
    GUICtrlCreateListViewItem($val1[$i][1], $list_news)
    Next
    
    
    While 1
    	$nMsg = GUIGetMsg()
    	Switch $nMsg
    		Case $GUI_EVENT_CLOSE
    			_Crypt_Shutdown()
    			Exit
    		Case $button_cc
    			Run( "config.exe", @WorkingDir)
    		Case $button_patch
    			_patch()
    		Case $button_homepage
    			ShellExecute($homepage)
    		Case $button_start
    			Run($execute, @WorkingDir)
    			Exit
    	EndSwitch
    WEnd
    
    
    Func _patch()
    Local $val
    $val = IniReadSection($patcherini, "Files")
    If Not IsArray($val) Then
    	MsgBox(0, "Error", "1003. Array Defekt.")
    	Exit
    EndIf
    _Crypt_Startup()
    For $i = 1 To UBound($val) -1
    	GUICtrlSetData($progr_fortschritt, 100/Ubound($val) * $i)
    	Sleep(150)
    	$localfile = StringReplace($val[$i][0], "/", "\")
    	$localhash = _Crypt_HashFile($localfile, $CALG_MD5)
    	$remotehash = $val[$i][1]
    	If $localhash = $remotehash Then
    		sleep(1)
    	Else
    		FileDelete($localfile)
    		$Download = InetGet($serverhttp & $val[$i][0], $localfile, $INET_FORCERELOAD, 1)
    		$sizeb = InetGetSize($serverhttp & $val[$i][0], $INET_FORCERELOAD)
    		Do
    			$BytesDownloaded = InetGetInfo($Download, 0)
    			$FileProgress = Floor(($BytesDownloaded / $sizeb) * 100)
    			If GUICtrlRead($progr_dateidown) <> $FileProgress Then
    				GUICtrlSetData($progr_dateidown, $FileProgress)
    				GUICtrlSetData($label_dateidown, $FileProgress & " %")
    			EndIf
    		Until InetGetInfo($Download, 2)
    		GUICtrlSetData($label_dateidown, "")
    	EndIf
    Next
    GUICtrlSetData($progr_fortschritt, 100)
    _Crypt_Shutdown()
    GUICtrlSetState($button_start, $GUI_ENABLE)
    MsgBox(0, "Fertig", "Der Patcher ist fertig, du kannst das Spiel nun starten.")
    EndFunc
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    ;Button Hover
    #Region Header
    
    
    #include-once
    
    
    
    
    
    
    #EndRegion Header
    
    
    #Region Internal Global Variables
    
    
    
    
    
    
    #EndRegion Internal Global Variables
    
    
    #Region Public Functions
    
    
    
    
    Func _GUICtrl_OnHoverRegister($iCtrlID, $sHover_Func="", $sLeaveHover_Func=-1, $sPrimaryDownFunc=-1, $sPrimaryUpFunc=-1, $iKeepCall_PrDn_Func=1, $iKeepCall_Hover_Func=0)
    	Local $hCtrlID = GUICtrlGetHandle($iCtrlID)
    
    
    	If Not $hCtrlID Then
    		Return SetError(1, 0, 0)
    	EndIf
    
    
    	If $p__GUICtrl_SOH_TimerProc = 0 Then
    		$p__GUICtrl_SOH_TimerProc = DllCallbackRegister("__GUICtrl_SOH_CALLBACK", "none", "hwnd;int;uint_ptr;dword")
    		$i__GUICtrl_SOH_TimerID = DllCall($s__GUICtrl_SOH_User32_Dll, "int", "SetTimer", _
    			"hwnd", 0, "uint_ptr", Round(TimerInit()), "uint", 30, "ptr", DllCallbackGetPtr($p__GUICtrl_SOH_TimerProc))
    
    
    		GUIRegisterMsg($n__GUICtrl_SOH_WM_COMMAND, "__GUICtrl_SOH_WM_COMMAND")
    		GUIRegisterMsg($n__GUICtrl_SOH_WM_LBUTTONDOWN, "__GUICtrl_SOH_WM_LBUTTONDOWN")
    
    
    		If IsArray($i__GUICtrl_SOH_TimerID) Then
    			$i__GUICtrl_SOH_TimerID = $i__GUICtrl_SOH_TimerID[0]
    		EndIf
    	EndIf
    
    
    	;UnSet Hovering for specified control (remove control id from hovering checking process)
    	If $sHover_Func = "" And @NumParams <= 2 Then
    		Local $a__GUICtrl_SOH_Ctrls_Tmp[1][1]
    		Local $a__GUICtrl_SOH_Ctrls_Swap = $a__GUICtrl_SOH_Ctrls ;This one prevents a bug with "dimension range exceeded"
    
    
    		For $i = 1 To $a__GUICtrl_SOH_Ctrls_Swap[0][0]
    			If $hCtrlID <> $a__GUICtrl_SOH_Ctrls_Swap[$i][0] Then
    				$a__GUICtrl_SOH_Ctrls_Tmp[0][0] += 1
    				ReDim $a__GUICtrl_SOH_Ctrls_Tmp[$a__GUICtrl_SOH_Ctrls_Tmp[0][0]+1][7]
    
    
    				$a__GUICtrl_SOH_Ctrls_Tmp[$a__GUICtrl_SOH_Ctrls_Tmp[0][0]][0] = $a__GUICtrl_SOH_Ctrls_Swap[$i][0]
    				$a__GUICtrl_SOH_Ctrls_Tmp[$a__GUICtrl_SOH_Ctrls_Tmp[0][0]][1] = $a__GUICtrl_SOH_Ctrls_Swap[$i][1]
    				$a__GUICtrl_SOH_Ctrls_Tmp[$a__GUICtrl_SOH_Ctrls_Tmp[0][0]][2] = $a__GUICtrl_SOH_Ctrls_Swap[$i][2]
    				$a__GUICtrl_SOH_Ctrls_Tmp[$a__GUICtrl_SOH_Ctrls_Tmp[0][0]][3] = $a__GUICtrl_SOH_Ctrls_Swap[$i][3]
    				$a__GUICtrl_SOH_Ctrls_Tmp[$a__GUICtrl_SOH_Ctrls_Tmp[0][0]][4] = $a__GUICtrl_SOH_Ctrls_Swap[$i][4]
    				$a__GUICtrl_SOH_Ctrls_Tmp[$a__GUICtrl_SOH_Ctrls_Tmp[0][0]][5] = $a__GUICtrl_SOH_Ctrls_Swap[$i][5]
    				$a__GUICtrl_SOH_Ctrls_Tmp[$a__GUICtrl_SOH_Ctrls_Tmp[0][0]][6] = $a__GUICtrl_SOH_Ctrls_Swap[$i][6]
    			EndIf
    		Next
    
    
    		If $a__GUICtrl_SOH_Ctrls_Tmp[0][0] < 1 Then
    			__GUICtrl_SOH_ReleaseResources() ;Release the callbacks
    		Else
    			$i__GUICtrl_SOH_CtrlsModified = 1
    			$a__GUICtrl_SOH_Ctrls = $a__GUICtrl_SOH_Ctrls_Tmp
    		EndIf
    
    
    		Return 1
    	EndIf
    
    
    	;Check if the hovering process already handle the passed CtrlID, if so, just assign new values (functions)
    	For $i = 1 To $a__GUICtrl_SOH_Ctrls[0][0]
    		If $hCtrlID = $a__GUICtrl_SOH_Ctrls[$i][0] Then
    			$a__GUICtrl_SOH_Ctrls[$i][0] = $hCtrlID
    			$a__GUICtrl_SOH_Ctrls[$i][1] = $sHover_Func
    			$a__GUICtrl_SOH_Ctrls[$i][2] = $sLeaveHover_Func
    			$a__GUICtrl_SOH_Ctrls[$i][3] = $sPrimaryDownFunc
    			$a__GUICtrl_SOH_Ctrls[$i][4] = $sPrimaryUpFunc
    			$a__GUICtrl_SOH_Ctrls[$i][5] = $iKeepCall_PrDn_Func
    			$a__GUICtrl_SOH_Ctrls[$i][6] = $iKeepCall_Hover_Func
    
    
    			Return 2
    		EndIf
    	Next
    
    
    	$a__GUICtrl_SOH_Ctrls[0][0] += 1
    	ReDim $a__GUICtrl_SOH_Ctrls[$a__GUICtrl_SOH_Ctrls[0][0]+1][7]
    
    
    	$a__GUICtrl_SOH_Ctrls[$a__GUICtrl_SOH_Ctrls[0][0]][0] = $hCtrlID
    	$a__GUICtrl_SOH_Ctrls[$a__GUICtrl_SOH_Ctrls[0][0]][1] = $sHover_Func
    	$a__GUICtrl_SOH_Ctrls[$a__GUICtrl_SOH_Ctrls[0][0]][2] = $sLeaveHover_Func
    	$a__GUICtrl_SOH_Ctrls[$a__GUICtrl_SOH_Ctrls[0][0]][3] = $sPrimaryDownFunc
    	$a__GUICtrl_SOH_Ctrls[$a__GUICtrl_SOH_Ctrls[0][0]][4] = $sPrimaryUpFunc
    	$a__GUICtrl_SOH_Ctrls[$a__GUICtrl_SOH_Ctrls[0][0]][5] = $iKeepCall_PrDn_Func
    	$a__GUICtrl_SOH_Ctrls[$a__GUICtrl_SOH_Ctrls[0][0]][6] = $iKeepCall_Hover_Func
    
    
    	Return 1
    EndFunc
    
    
    ;Set the hovering mode:
    ;                      $iSetBackWin = 1 (default) hovering process will proceed even when GUI is not active (in background).
    ;                      $iSetBackWin <> 1 hovering process will NOT proceed when GUI is not active.
    Func _GUICtrl_SetHoverOnBackWindow($iSetBackWin)
    	$i__GUICtrl_SOH_HoverOnBackWin = Number($iSetBackWin = 1)
    EndFunc
    
    
    ;Releases all resources used by this UDF
    Func _GUICtrl_OnHoverReleaseResources()
    	__GUICtrl_SOH_ReleaseResources()
    EndFunc
    
    
    #EndRegion Public Functions
    
    
    #Region Backwards Compatibility Functions
    
    
    ;Backwards compatibility function #1
    Func _GUICtrl_SetOnHover($iCtrlID, $sHover_Func="", $sLeaveHover_Func=-1, $sPrimaryDownFunc=-1, $sPrimaryUpFunc=-1, $iKeepCall_PrDn_Func=1, $iKeepCall_Hover_Func=0)
    	_GUICtrl_OnHoverRegister($iCtrlID, $sHover_Func, $sLeaveHover_Func, $sPrimaryDownFunc, $sPrimaryUpFunc, $iKeepCall_PrDn_Func, $iKeepCall_Hover_Func)
    EndFunc
    
    
    ;Backwards compatibility function #2
    Func GUICtrl_SetOnHover($iCtrlID, $sHover_Func="", $sLeaveHover_Func=-1, $sPrimaryDownFunc=-1, $sPrimaryUpFunc=-1, $iKeepCall_PrDn_Func=1, $iKeepCall_Hover_Func=0)
    	_GUICtrl_OnHoverRegister($iCtrlID, $sHover_Func, $sLeaveHover_Func, $sPrimaryDownFunc, $sPrimaryUpFunc, $iKeepCall_PrDn_Func, $iKeepCall_Hover_Func)
    EndFunc
    
    
    ;Backwards compatibility function #3
    Func GUICtrlSetOnHover($iCtrlID, $sHover_Func="", $sLeaveHover_Func=-1, $sPrimaryDownFunc=-1, $sPrimaryUpFunc=-1, $iKeepCall_PrDn_Func=1, $iKeepCall_Hover_Func=0)
    	_GUICtrl_OnHoverRegister($iCtrlID, $sHover_Func, $sLeaveHover_Func, $sPrimaryDownFunc, $sPrimaryUpFunc, $iKeepCall_PrDn_Func, $iKeepCall_Hover_Func)
    EndFunc
    
    
    ;Backwards compatibility function #4
    Func _GUICtrlSetOnHover($iCtrlID, $sHover_Func="", $sLeaveHover_Func=-1, $sPrimaryDownFunc=-1, $sPrimaryUpFunc=-1, $iKeepCall_PrDn_Func=1, $iKeepCall_Hover_Func=0)
    	_GUICtrl_OnHoverRegister($iCtrlID, $sHover_Func, $sLeaveHover_Func, $sPrimaryDownFunc, $sPrimaryUpFunc, $iKeepCall_PrDn_Func, $iKeepCall_Hover_Func)
    EndFunc
    
    
    #EndRegion Backwards Compatibility Functions
    
    
    #Region Internal Functions
    
    
    ;CallBack function to handle the hovering process
    Func __GUICtrl_SOH_CALLBACK($hWnd, $uiMsg, $idEvent, $dwTime)
    	$i__GUICtrl_SOH_CtrlsModified = 0
    
    
    	If $a__GUICtrl_SOH_Ctrls[0][0] < 1 Then
    		Return
    	EndIf
    
    
    	If $i__GUICtrl_SOH_HoverOnBackWin Then
    		Local $iControl_Hovered = __GUICtrl_SOH_ControlGetHovered()
    	Else
    		Local $iControl_Hovered = GUIGetCursorInfo()
    
    
    		If Not IsArray($iControl_Hovered) Then
    			Return
    		EndIf
    
    
    		$iControl_Hovered = GUICtrlGetHandle($iControl_Hovered[4])
    	EndIf
    
    
    	Local $sCheck_LHE = $a__GUICtrl_SOH_LastHoveredElements[1]
    	Local $iCheck_LCEM = $h__GUICtrl_SOH_LastClickedElementMark
    	Local $iCtrlID
    
    
    	;Leave Hovering Process and reset variables
    	If Not $iControl_Hovered Or ($sCheck_LHE <> -1 And $iControl_Hovered <> $sCheck_LHE) Then
    		If $a__GUICtrl_SOH_LastHoveredElementsMark = -1 Then
    			Return
    		EndIf
    
    
    		Local $a__Tmp_GUICtrl_SOH_LastHoveredElements[2] = [$a__GUICtrl_SOH_LastHoveredElements[0], $a__GUICtrl_SOH_LastHoveredElements[1]]
    
    
    		$a__GUICtrl_SOH_LastHoveredElements[0] = -1
    		$a__GUICtrl_SOH_LastHoveredElements[1] = -1
    		$a__GUICtrl_SOH_LastHoveredElementsMark = -1
    		$h__GUICtrl_SOH_LastClickedElementMark = -1
    
    
    		If $a__Tmp_GUICtrl_SOH_LastHoveredElements[0] <> -1 Then
    			$iCtrlID = DllCall($s__GUICtrl_SOH_User32_Dll, "int", "GetDlgCtrlID", "hwnd", $a__Tmp_GUICtrl_SOH_LastHoveredElements[1])
    
    
    			If IsArray($iCtrlID) Then
    				$iCtrlID = $iCtrlID[0]
    			EndIf
    
    
    			;2 is the indicator of OnLeavHover process
    			__GUICtrl_SOH_Call($a__Tmp_GUICtrl_SOH_LastHoveredElements[0], $iCtrlID, 2, $iControl_Hovered)
    		EndIf
    	Else ;Hovering Process, Primary Down/Up handler, and set $a__GUICtrl_SOH_LastHoveredElements
    		If $i__GUICtrl_SOH_CtrlsModified = 1 Then
    			$i__GUICtrl_SOH_CtrlsModified = 0
    			Return
    		EndIf
    
    
    		Local $iUbound = UBound($a__GUICtrl_SOH_Ctrls)-1
    
    
    		For $i = 1 To $a__GUICtrl_SOH_Ctrls[0][0]
    			If $i > $iUbound Then
    				ExitLoop
    			EndIf
    
    
    			If $a__GUICtrl_SOH_Ctrls[$i][0] = $iControl_Hovered Then
    				$iCtrlID = DllCall($s__GUICtrl_SOH_User32_Dll, "int", "GetDlgCtrlID", "hwnd", $iControl_Hovered)
    
    
    				If IsArray($iCtrlID) Then
    					$iCtrlID = $iCtrlID[0]
    				EndIf
    
    
    				;Primary Down/Up handler
    				If ($a__GUICtrl_SOH_Ctrls[$i][3] <> "" Or $a__GUICtrl_SOH_Ctrls[$i][4] <> "") And ($iCheck_LCEM = -1 Or $iCheck_LCEM = $iControl_Hovered) Then
    					Local $aCursorInfo = 0
    					Local $hParent_Wnd = DllCall($s__GUICtrl_SOH_User32_Dll, "hwnd", "GetParent", "hwnd", $iControl_Hovered)
    
    
    					If Not @error And IsArray($hParent_Wnd) Then
    						$hParent_Wnd = $hParent_Wnd[0]
    						$aCursorInfo = GUIGetCursorInfo($hParent_Wnd)
    					Else
    						$aCursorInfo = GUIGetCursorInfo()
    					EndIf
    
    
    					If IsArray($aCursorInfo) Then
    						;Primary Down...
    						;* First condition is to prevent function call when holding down m.button from other control
    						;* Last condition is to Prevent/Allow multiple function call
    						;(depending on $iKeepCall_PrDn_Func param).
    						If ($i__GUICtrl_SOH_LastPrimaryDownCtrlID = $iControl_Hovered Or $i__GUICtrl_SOH_LastPrimaryDownCtrlID = 0) And WinActive($hParent_Wnd) And _
    							$aCursorInfo[2] = 1 And $a__GUICtrl_SOH_Ctrls[$i][3] <> -1 And _
    							(($a__GUICtrl_SOH_Ctrls[$i][5] < 1 And $iCheck_LCEM <> $iControl_Hovered) Or $a__GUICtrl_SOH_Ctrls[$i][5] > 0) Then
    
    
    							;1 is the indicator of Primary*Down* event
    							__GUICtrl_SOH_Call($a__GUICtrl_SOH_Ctrls[$i][3], $iCtrlID, 1)
    
    
    							$h__GUICtrl_SOH_LastClickedElementMark = $iControl_Hovered
    						;Primary Up
    						ElseIf $aCursorInfo[2] = 0 And $a__GUICtrl_SOH_Ctrls[$i][4] <> -1 And $iCheck_LCEM = $iControl_Hovered Then
    							;2 is the indicator of Primary*Up* event
    							__GUICtrl_SOH_Call($a__GUICtrl_SOH_Ctrls[$i][4], $iCtrlID, 2)
    
    
    							$h__GUICtrl_SOH_LastClickedElementMark = -1
    						EndIf
    					EndIf
    				EndIf
    
    
    				If $i__GUICtrl_SOH_CtrlsModified = 1 Then
    					ExitLoop
    				EndIf
    
    
    				If $a__GUICtrl_SOH_Ctrls[$i][6] < 1 And $a__GUICtrl_SOH_LastHoveredElementsMark = $a__GUICtrl_SOH_Ctrls[$i][0] Then
    					ExitLoop
    				Else
    					$a__GUICtrl_SOH_LastHoveredElementsMark = $a__GUICtrl_SOH_Ctrls[$i][0]
    				EndIf
    
    
    				If $a__GUICtrl_SOH_Ctrls[$i][2] <> -1 Then
    					$a__GUICtrl_SOH_LastHoveredElements[0] = $a__GUICtrl_SOH_Ctrls[$i][2]
    					$a__GUICtrl_SOH_LastHoveredElements[1] = $iControl_Hovered
    				EndIf
    
    
    				__GUICtrl_SOH_Call($a__GUICtrl_SOH_Ctrls[$i][1], $iCtrlID, 1, 0) ;1 is the indicator of OnHover process
    
    
    				If $i__GUICtrl_SOH_CtrlsModified = 1 Then
    					ExitLoop
    				EndIf
    
    
    				ExitLoop
    			EndIf
    		Next
    	EndIf
    
    
    	$i__GUICtrl_SOH_CtrlsModified = 0
    EndFunc
    
    
    Func __GUICtrl_SOH_WM_COMMAND($hWndGUI, $MsgID, $WParam, $LParam)
    	$i__GUICtrl_SOH_LastPrimaryDownCtrlID = $LParam
    
    
    	Local $iRet = Execute('CP_WM_COMMAND($hWndGUI, $MsgID, $WParam, $LParam)')
    	If $iRet <> '' Then Return $iRet
    EndFunc
    
    
    Func __GUICtrl_SOH_WM_LBUTTONDOWN($hWndGUI, $MsgID, $WParam, $LParam)
    	$i__GUICtrl_SOH_LastPrimaryDownCtrlID = 0
    EndFunc
    
    
    ;Thanks to amel27 for that one!!!
    Func __GUICtrl_SOH_ControlGetHovered()
    	Local $iOld_Opt_MCM = Opt("MouseCoordMode", 1)
    	Local $tPoint = DllStructCreate("int X;int Y")
    	Local $aMPos = MouseGetPos()
    
    
    	DllStructSetData($tPoint, "x", $aMPos[0])
    	DllStructSetData($tPoint, "y", $aMPos[1])
    
    
    	Local $tPointCast = DllStructCreate("int64", DllStructGetPtr($tPoint))
    	Local $aRet = DllCall($s__GUICtrl_SOH_User32_Dll, "hwnd", "WindowFromPoint", "int64", DllStructGetData($tPointCast, 1))
    
    
    	Opt("MouseCoordMode", $iOld_Opt_MCM)
    
    
    	If @error Or Not IsArray($aRet) Then
    		Return SetError(@error, @extended, 0)
    	EndIf
    
    
    	Return $aRet[0]
    EndFunc
    
    
    ;Call() function wrapper
    Func __GUICtrl_SOH_Call($sFunction, $sParam1="", $sParam2="", $sParam3="", $sParam4="", $sParam5="")
    	Local $iRet = Call($sFunction)
    
    
    	If @error <> 0xDEAD Then
    		Return $iRet
    	EndIf
    
    
    	$iRet = Call($sFunction, $sParam1)
    
    
    	If @error <> 0xDEAD Then
    		Return $iRet
    	EndIf
    
    
    	$iRet = Call($sFunction, $sParam1, $sParam2)
    
    
    	If @error <> 0xDEAD Then
    		Return $iRet
    	EndIf
    
    
    	$iRet = Call($sFunction, $sParam1, $sParam2, $sParam3)
    
    
    	If @error <> 0xDEAD Then
    		Return $iRet
    	EndIf
    
    
    	$iRet = Call($sFunction, $sParam1, $sParam2, $sParam3, $sParam4)
    
    
    	If @error <> 0xDEAD Then
    		Return $iRet
    	EndIf
    
    
    	$iRet = Call($sFunction, $sParam1, $sParam2, $sParam3, $sParam4, $sParam5)
    
    
    	If @error <> 0xDEAD Then
    		Return $iRet
    	EndIf
    
    
    	Return SetError(1, 0, 0)
    EndFunc
    
    
    ;Release resources function
    Func __GUICtrl_SOH_ReleaseResources()
    	If $p__GUICtrl_SOH_TimerProc > 0 Then
    		DllCallbackFree($p__GUICtrl_SOH_TimerProc)
    	EndIf
    
    
    	If $i__GUICtrl_SOH_TimerID > 0 Then
    		DllCall($s__GUICtrl_SOH_User32_Dll, "int", "KillTimer", "hwnd", 0, "uint_ptr", $i__GUICtrl_SOH_TimerID)
    	EndIf
    
    
    	GUIRegisterMsg($n__GUICtrl_SOH_WM_COMMAND, "")
    	GUIRegisterMsg($n__GUICtrl_SOH_WM_LBUTTONDOWN, "")
    
    
    	$a__GUICtrl_SOH_Ctrls = 0
    	Dim $a__GUICtrl_SOH_Ctrls[1][1]
    
    
    	$p__GUICtrl_SOH_TimerProc = 0
    	$i__GUICtrl_SOH_TimerID = 0
    EndFunc
    
    
    ;Release the CallBack resources when exit
    Func __GUICtrl_SOH_Exit()
    	If $s__GUICtrl_SOH_OnExitFunc <> "" Then
    		Call($s__GUICtrl_SOH_OnExitFunc)
    	EndIf
    
    
    	__GUICtrl_SOH_ReleaseResources()
    EndFunc
    
    
    #EndRegion Internal Functions
    Alles anzeigen
  • Patcher patcht nur teilweise

    • Paul01
    • 17. Februar 2017 um 15:22

    Ist genau der obere Code :3 Hab nur die Buttons durch Bilder erstetzt. Hat ja aber eig nichts mit dem Schließen zutun oder?

  • Patcher patcht nur teilweise

    • Paul01
    • 17. Februar 2017 um 12:07

    Okey, mach ich.
    Hab noch eine Frage, auch zum selben Programm.
    Ich eröffne mal kein neuen Thread, ich hoff das ist okey?

    Wenn der Patcher patcht, und ich den Patcher schließen möchte indem ich aufs Kreuz rechts oben vom Fenster klickt, ignoriert er es gekonnt.

    Habs mal so versucht:

    AutoIt
    Case $GUI_EVENT_CLOSE
    	_Crypt_Shutdown()
    	Exit

    Leider ohne Erfolg.

  • Patcher patcht nur teilweise

    • Paul01
    • 17. Februar 2017 um 08:43

    Okey nvm, liegt echt am Webspace. Danke dir.

  • Patcher patcht nur teilweise

    • Paul01
    • 16. Februar 2017 um 23:27

    Guten Abend Zusammen,

    ich habe hier einen Patcher am laufen, welcher sich von meinem Webspace Daten ziehen soll.
    Dies klappt auch soweit bei allen Datentypen, bis auf zwei. .eix & .epk.
    Die Dateien wurden zB mit 669KB Dateigröße aufs Webspace geladen und werden mit dem Patcher mit 7KB Dateigröße heruntergeladen.

    Kann ich mir nicht erklären..
    Der Code:

    AutoIt
    #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
    #AutoIt3Wrapper_Res_Comment=made by 
    #AutoIt3Wrapper_Res_Description=made by 
    #AutoIt3Wrapper_Res_Fileversion=1.0.0.1
    #AutoIt3Wrapper_Res_LegalCopyright=made by 
    #AutoIt3Wrapper_Res_Language=1031
    #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <GUIListBox.au3>
    #include <GUIListView.au3>
    #include <MsgBoxConstants.au3>
    #include <ProgressConstants.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <InetConstants.au3>
    #include <File.au3>
    #include <Array.au3>
    #include <Crypt.au3>
    
    
    
    
    Global $serverhttp = "http://localhost/"
    Global $patcherini = (@TempDir & "\patcher.ini")
    Global $patcherurl = ($serverhttp & "patcher.ini")
    Global $homepage = "http://localhost/"
    Global $execute = "starter.exe"
    
    
    If FileExists($patcherini) Then
    	FileDelete($patcherini)
    EndIf
    If InetGetSize($patcherurl) = 0 Then
    	MsgBox(0, "Error", "Patcherini konnte nicht geladen werden. Patchserver konnte nicht erreicht werden.")
    	Exit
    Else
    	InetGet($patcherurl, $patcherini, $INET_FORCERELOAD)
    EndIf
    
    
    GUICreate("Patcher", 377, 313, 192, 124)
    GUICtrlCreateLabel("Fortschritt:", 8, 80, 56, 17)
    GUICtrlCreateLabel("News:", 8, 144, 37, 17)
    GUICtrlCreateLabel("Datei Download:", 8, 16, 83, 17)
    $progr_fortschritt = GUICtrlCreateProgress(8, 104, 249, 25)
    $progr_dateidown = GUICtrlCreateProgress(8, 40, 249, 17)
    $label_dateidown = GUICtrlCreateLabel("", 96, 16, 68, 17)
    $button_start = GUICtrlCreateButton("Start", 280, 112, 89, 49)
    $button_patch = GUICtrlCreateButton("Patch", 280, 8, 89, 33)
    $button_cc = GUICtrlCreateButton("Config Client", 280, 80, 89, 25)
    $button_homepage = GUICtrlCreateButton("Homepage", 280, 48, 89, 25)
    $list_news = GUICtrlCreateListView("Datum|Nachricht", 8, 168, 361, 136)
    _GUICtrlListView_SetColumnWidth($list_news, 1, 290)
    GUISetState(@SW_SHOW)
    GUICtrlSetState($button_start, $GUI_DISABLE)
    
    
    Local $val1
    $val1 = IniReadSection($patcherini, "News")
    If Not IsArray($val1) Then
    	MsgBox(0, "Error", "1002. Array Defekt.")
    	Exit
    EndIf
    For $i = 1 To UBound($val1) -1
    GUICtrlCreateListViewItem($val1[$i][1], $list_news)
    Next
    
    
    While 1
    	$nMsg = GUIGetMsg()
    	Switch $nMsg
    		Case $GUI_EVENT_CLOSE
    			Exit
    		Case $button_cc
    			Run( "config.exe", @WorkingDir)
    		Case $button_patch
    			_patch()
    		Case $button_homepage
    			ShellExecute($homepage)
    		Case $button_start
    			Run($execute, @WorkingDir)
    			Exit
    	EndSwitch
    WEnd
    
    
    Func _patch()
    Local $val
    $val = IniReadSection($patcherini, "Files")
    If Not IsArray($val) Then
    	MsgBox(0, "Error", "1003. Array Defekt.")
    	Exit
    EndIf
    _Crypt_Startup()
    For $i = 1 To UBound($val) -1
    	GUICtrlSetData($progr_fortschritt, 100/Ubound($val) * $i)
    	Sleep(150)
    	$localfile = StringReplace($val[$i][0], "/", "\")
    	$localhash = _Crypt_HashFile($localfile, $CALG_MD5)
    	$remotehash = $val[$i][1]
    	If $localhash = $remotehash Then
    		sleep(1)
    	Else
    		FileDelete($localfile)
    		$Download = InetGet($serverhttp & $val[$i][0], $localfile, $INET_FORCERELOAD, 1)
    		$sizeb = InetGetSize($serverhttp & $val[$i][0], $INET_FORCERELOAD)
    		Do
    			$BytesDownloaded = InetGetInfo($Download, 0)
    			$FileProgress = Floor(($BytesDownloaded / $sizeb) * 100)
    			If GUICtrlRead($progr_dateidown) <> $FileProgress Then
    				GUICtrlSetData($progr_dateidown, $FileProgress)
    				GUICtrlSetData($label_dateidown, $FileProgress & " %")
    			EndIf
    		Until InetGetInfo($Download, 2)
    		GUICtrlSetData($label_dateidown, "")
    	EndIf
    Next
    GUICtrlSetData($progr_fortschritt, 100)
    _Crypt_Shutdown()
    GUICtrlSetState($button_start, $GUI_ENABLE)
    EndFunc
    Alles anzeigen

    Wäre echt klasse, wenn dazu jemand eine Idee hat. Bis jetzt ists mir nur bei den zwei Dateitypen aufgefallen.


    Danke !

    Gruß
    Paul01

Spenden

Jeder Euro hilft uns, Euch zu helfen.

Download

AutoIt Tutorial
AutoIt Buch
Onlinehilfe
AutoIt Entwickler
  1. Datenschutzerklärung
  2. Impressum
  3. Shoutbox-Archiv
Community-Software: WoltLab Suite™