- Offizieller Beitrag
Heyho,
Da es bei WinMove zwar ein Speed parameter gibt, der aber nicht für die größe zuständig ist, hab ich mir selbst mal was gebastelt. Er arbeitet mit Sinus damit das auch ganz hübsch aussieht
Sollte sonst selbsterklärend sein, falls es jemand braucht..:
Spoiler anzeigen
#include <WindowsConstants.au3>
#include <ProgressConstants.au3>
Global $bExpand = False
[/autoit] [autoit][/autoit] [autoit]Global $aGuiSize[2][2] = [[285,64],[285,184]]
[/autoit] [autoit][/autoit] [autoit]Opt("GuiOnEventMode",1)
Opt("GUIResizeMode",802)
$hMainGui = GUICreate("Download", 285, 56, 218, 249)
GUISetBkColor(0)
GUISetOnEvent(-3,"_Exit")
$hInpSearch = GUICtrlCreateInput("http://www.autoitscript.com/autoit3/files/beta/autoit/autoit-v3.3.5.3-beta-setup.exe", 8, 8, 193, 21)
$hButSearch = GUICtrlCreateButton("> Download >", 202, 8, 75, 21, $WS_GROUP)
GUICtrlSetOnEvent(-1,"_Download")
$hProg = GUICtrlCreateProgress(280,8,15,220,$PBS_VERTICAL)
$hLab = GUICtrlCreateLabel("",8, 42, 269, 60)
GUICtrlSetColor(-1,0x00ff00)
InetGet("http://www.autoitscript.com/autoit3/files/graphics/autoit_metal_wall_800x600.jpg",@ScriptDir&"\metal.jpg")
GUICtrlCreatePic("metal.jpg",55,42+65,80*2,60*2)
_WinSetSize($hMainGui,285,64);without animation
GUISetState()
#EndRegion ### END Koda GUI section ###
While 1
Sleep(500)
WEnd
Func _Exit()
Exit
EndFunc
Func _Download()
_WinSetSize($hMainGui,305,264,10,7);fast open
Local $sRead = GUICtrlRead($hInpSearch)
Local $sFileName = StringTrimLeft($sRead,StringInStr($sRead,"/",-1,-1))
Local $hRead = InetGet($sRead,@ScriptDir&"\"&$sFileName,1,1)
Do
$aInfo = InetGetInfo($hRead)
GUICtrlSetData($hLab,"File Name: "&$sFileName&@CRLF& _
"kbyte Downloaded: "&$aInfo[0]&@CRLF& _
"Size of Download: "&$aInfo[1]&@CRLF& _
"Download ongoing: "&Not $aInfo[2] & @cRLF)
GUICtrlSetData($hProg,100*$aInfo[0]/$aInfo[1])
Sleep(100)
Until $aInfo[2]
Sleep(500)
_WinSetSize($hMainGui,285,64,10,3);slow close
EndFunc
;By GtaSpider
Func _WinSetSize($hWnd, $iWidth, $iHeigth, $iSleep = -1,$iStep = 4)
If $iSleep < 0 Then Return WinMove($hWnd,"",Default,Default,$iWidth,$iHeigth)
Local $i, $iStepW = $iStep, $iStepH = $iStep,$iSin,$i2,$iLastI
Local $aWinPos = WinGetPos($hWnd)
If $iWidth < $aWinPos[2] Then $iStepW *= -1
If $iHeigth < $aWinPos[3] Then $iStepH *= -1
Local $iDegToRad = 3.14159265358979/180
Local $iSinMulW = ($iWidth - $aWinPos[2]) / 2.5
Local $iSinMulH = ($iHeigth - $aWinPos[3]) / 2.5
If $iSinMulW < 0 Then $iSinMulW *= -1
If $iSinMulH < 0 Then $iSinMulH *= -1
If $iWidth <> $aWinPos[2] Then
For $i = $aWinPos[2] To $iWidth Step $iStepW
$iLastI = $i
$iSin = $i - $aWinPos[2]
$iSin = Sin($iDegToRad * (180*$iSin/($iWidth - $aWinPos[2])))
WinMove($hWnd,"",Default,Default,$i + ($iSin * $iSinMulW),Default)
Sleep($iSleep)
Next
If Mod($iWidth - $aWinPos[2],$iStep) Then
If $iStepW < 0 Then
$iStepW = -1
Else
$iStepW = 1
EndIf
For $i = $iLastI -1 To $iWidth Step $iStepW
WinMove($hWnd,"",Default,Default,$i,Default)
Next
EndIf
EndIf
If $iHeigth <> $aWinPos[3] Then
For $i = $aWinPos[3] To $iHeigth Step $iStepH
$iLastI = $i
$iSin = $i - $aWinPos[3]
$iSin = Sin($iDegToRad*(180*$iSin/($iHeigth - $aWinPos[3])))
WinMove($hWnd,"",Default,Default,Default,$i + ($iSin * $iSinMulH))
Sleep($iSleep)
Next
If Mod($iHeigth - $aWinPos[3],$iStep) Then
If $iStepH < 0 Then
$iStepH = -1
Else
$iStepH = 1
EndIf
For $i = $iLastI -1 To $iHeigth Step $iStepH
WinMove($hWnd,"",Default,Default,Default,$i)
Next
EndIf
EndIf
EndFunc
Gruß
Spider