Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/06/2018 in all areas

  1. Or ShellExecuteWait if you want to break up file and parameters more cleanly. Secondly, I would think about actually using the parameters - your winzip MSI for example is going to simply launch and then sit there. If you want to do this without user intervention run it like this: ShellExecuteWait("msiexec.exe", '/i "\\server1\folder1\winzip.msi" /qn')
    2 points
  2. You could do this: Local $oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1") $oHTTP.Open("GET", 'https://www.autoitscript.com', False) $oHTTP.Send() Local $sResponseText = $oHTTP.ResponseText Local $omHtmlFile = ObjCreate("mhtmlfile") ;~ ConsoleWrite(IsObj($oObject) & @CRLF) $omHtmlFile.write($sResponseText) Local $sInnerText=$omHtmlFile.body.innerText ConsoleWrite($sInnerText & @CRLF) Saludos
    1 point
  3. Load up the response into microsoft.xmldom (forum search this, many examples). it also has an innertext ability.
    1 point
  4. @youtuber : here is an example or how you can do it : #RequireAdmin #Include "Network.au3" Local $aNetAdapter = _GetNetworkAdapterList() For $i = 0 To UBound($aNetAdapter) - 1 If _IsWirelessAdapter($aNetAdapter[$i][0]) Then ConsoleWrite($aNetAdapter[$i][0] & ' is a wireless adapter') Else ConsoleWrite('"' & $aNetAdapter[$i][0] & '" is not a wireless adapter') _SetGateways($aNetAdapter[$i][0], "192.168.99.1") EndIf Next
    1 point
  5. Instead of shellexecute try runwait. You’re saying the installation is done as soon as the set up exists and that is incorrect
    1 point
  6. in WinSetTrans($hGUI, "", 0) ; <---- change to 1 to avoid the initial flash ;) GUISetState() change the 0 to a 1, to avoid the initial flash PS: Also this looks better too ConsoleWrite("Exit") For $z = 255 To 1 Step -$fStep WinSetTrans($hGUI, "", $z) Next GUIRegisterMsg($WM_TIMER, "") _WinAPI_DeleteObject($hHBmp_BG) _GDIPlus_Shutdown() GUIDelete($hGUI)
    1 point
  7. Great stuff there kaz. Thanks for keeping this alive.
    1 point
  8. An other dots animation : #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <Memory.au3> #include <GDIPlus.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <TrayConstants.au3> Global Const $sExcelColor = "217346", $sWordColor = "2b579a", $sOutlookColor = "B7472A" Global Const $sThemeColor = $sOutlookColor Local Const $PI = 3.141592653589793 Global Const $hDwmApiDll = DllOpen("dwmapi.dll") Global $sChkAero = DllStructCreate("int;") DllCall($hDwmApiDll, "int", "DwmIsCompositionEnabled", "ptr", DllStructGetPtr($sChkAero)) Global $bAero = DllStructGetData($sChkAero, 1) Global $fStep = 0.02 If Not $bAero Then $fStep = 1.25 _GDIPlus_Startup() Global $iW = 442, $iH = 30 $hGUI = GUICreate("Office", $iW, 252, @DesktopWidth / 2.95, @DesktopHeight / 3.2, $WS_POPUP) GUISetBkColor("0x" & $sThemeColor) ;GUISetBkColor(0xB7472A) ;GUISetBkColor(0x2b579a) ;Word Blue ;~ GUISetBkColor(0x217346) ;Excel Green $Label1 = GUICtrlCreateLabel("SciTE4AutoIt3", 8, 8, 102, 21) GUICtrlSetFont(-1, 10, 400, 0, "Segoe UI Light") GUICtrlSetColor(-1, 0xFFFFFF) $Label2 = GUICtrlCreateLabel("AutoIt 247", 64, 72, 314, 75, BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetFont(-1, 40, 400, 0, "Segoe UI Light") GUICtrlSetColor(-1, 0xFFFFFF) $Label3 = GUICtrlCreateLabel("Starting...", 10, 205, 54, 21) GUICtrlSetFont(-1, 10, 400, 0, "Segoe UI Light") GUICtrlSetColor(-1, 0xFFFFFF) $Label4 = GUICtrlCreateLabel("r", 410, 4, 20, 21) GUICtrlSetFont(-1, 12, 400, 0, "Webdings") GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlSetTip(-1, "Closes the splash screen.") $Label5 = GUICtrlCreateLabel("0", 385, 0, 20, 21) GUICtrlSetFont(-1, 12, 400, 0, "Webdings") GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlSetTip(-1, "Minimises the splash screen.") GUISetState(@SW_SHOW) Global Const $iPic = GUICtrlCreatePic("", 0, 150, $iW, $iH) GUICtrlSetState(-1, $GUI_DISABLE) WinSetTrans($hGUI, "", 0) GUISetState() Global $hHBmp_BG, $hB, $iSleep = 20 GUIRegisterMsg($WM_TIMER, "PlayAnim") DllCall("user32.dll", "int", "SetTimer", "hwnd", $hGUI, "int", 0, "int", $iSleep, "int", 0) global $iballs = 5 global $aPos[$iballs][3] For $i = 0 To $iballs - 1 $aPos[($iballs - 1) - $i][0] = -10 $aPos[($iballs - 1) - $i][1] = $iH / 2 Next $aPos[0][2] = 1 Global $z, $iPerc For $z = 1 To 255 Step $fStep WinSetTrans($hGUI, "", $z) Next Do Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $Label4 ConsoleWrite("Exit") GUIRegisterMsg($WM_TIMER, "") _WinAPI_DeleteObject($hHBmp_BG) _GDIPlus_Shutdown() For $z = 255 To 1 Step -$fStep WinSetTrans($hGUI, "", $z) Next GUIDelete($hGUI) Exit EndSwitch Until False Func PlayAnim() $hHBmp_BG = _GDIPlus_LinearBalls($iW, $iH, $iPerc, 3, $iballs) $hB = GUICtrlSendMsg($iPic, $STM_SETIMAGE, $IMAGE_BITMAP, $hHBmp_BG) If $hB Then _WinAPI_DeleteObject($hB) _WinAPI_DeleteObject($hHBmp_BG) If $aPos[$iballs - 1][2] = 2 Then For $i = 0 To $iballs - 1 $aPos[$i][0] = - 10 $aPos[$i][2] = 0 Next $aPos[0][2] = 1 EndIf EndFunc ;==>PlayAnim Func _GDIPlus_LinearBalls($iW, $iH, $iPerc, $iRadius = 5, $iballs = 3, $bHBitmap = True) Local Const $iDiameter = $iRadius * 2 Local $tPointF1 = DllStructCreate("float;float") Local $pPointF1 = DllStructGetPtr($tPointF1) Local $tPointF2 = DllStructCreate("float;float") Local $pPointF2 = DllStructGetPtr($tPointF2) DllStructSetData($tPointF1, 1, $iDiameter) DllStructSetData($tPointF1, 2, 0) DllStructSetData($tPointF2, 1, $iDiameter) DllStructSetData($tPointF2, 2, $iDiameter) Local $hBrushBall2 = DllCall($__g_hGDIPDll, "uint", "GdipCreateLineBrush", "ptr", $pPointF1, "ptr", $pPointF2, "uint", 0xFFcecbca, "uint", 0xFFf2eeed, "int", 1, "int*", 0) $hBrushBall2 = $hBrushBall2[6] Local $hBitmap = _GDIPlus_BitmapCreateFromScan0($iW, $iH) Local Const $hCtxt = _GDIPlus_ImageGetGraphicsContext($hBitmap) _GDIPlus_GraphicsSetSmoothingMode($hCtxt, 2) _GDIPlus_GraphicsSetPixelOffsetMode($hCtxt, $GDIP_PIXELOFFSETMODE_HIGHQUALITY) Local Const $hBrushBall1 = _GDIPlus_BrushCreateSolid("0xFF" & $sThemeColor) _GDIPlus_GraphicsFillRect($hCtxt, 0, 0, $iW, $iH, $hBrushBall1) Local $i, $fDH, $height local $ixPartScreen = $iW/16 For $i = 0 To $iballs - 1 Local $iSpeed, $x if $aPos[$i][2] = 1 then if $aPos[$i][0] < $ixPartScreen * 7 Then $x = $aPos[$i][0] if $x < 0 then $x = 0 $iSpeed = 5 + (20 * ((($ixPartScreen * 7) - $x) * 100 ) / ($ixPartScreen * 7)) / 100 ElseIf $aPos[$i][0] > ($ixPartScreen * 9 - ($i * $iRadius * 1.5)) Then $iSpeed = 20 + (60 * ((($aPos[$i][0] - $ixPartScreen * 9)) * 100 ) / ($ixPartScreen * 9)) / 100 Else $iSpeed = 2 EndIf if $i > 0 and $aPos[$i - 1][0] - ($aPos[$i][0] + $iSpeed) < 13 and $aPos[$i][0] < $ixPartScreen * 9 Then $aPos[$i][0] = $aPos[$i - 1][0] - 13 Else $aPos[$i][0] = $aPos[$i][0] + $iSpeed EndIf EndIf if $i < $iballs - 1 Then if $aPos[$i][0] > $ixPartScreen * 3 then $aPos[$i + 1][2] = 1 EndIf If $aPos[$i][0] > $iW + $iRadius Then $aPos[$i][2] = 0 if $i = $iballs - 1 Then $aPos[$i][2] = 2 EndIf _GDIPlus_GraphicsFillCircle($hCtxt, $aPos[$i][0], $aPos[$i][1], $iRadius , $hBrushBall2) Next _GDIPlus_GraphicsDispose($hCtxt) _GDIPlus_BrushDispose($hBrushBall1) _GDIPlus_BrushDispose($hBrushBall2) If $bHBitmap Then Local $hHBITMAP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) _GDIPlus_BitmapDispose($hBitmap) Return $hHBITMAP EndIf Return $hBitmap EndFunc ;==>_GDIPlus_LinearBalls Func _GDIPlus_GraphicsFillCircle($hCtxt, $iXCenterPos, $iCenterYPos, $iRadius, $hBrush) _GDIPlus_GraphicsFillEllipse($hCtxt, $iXCenterPos - $iRadius, $iCenterYPos - $iRadius, $iRadius * 2, $iRadius * 2, $hBrush) EndFunc ;==>_GDIPlus_GraphicsFillCircle
    1 point
  9. More cleaning, better animation...perhaps Global Const $sExcelColor = "217346", $sWordColor = "2b579a", $sOutlookColor = "B7472A" Global Const $sThemeColor = $sWordColor Local Const $PI = 3.141592653589793 Global Const $hDwmApiDll = DllOpen("dwmapi.dll") Global $sChkAero = DllStructCreate("int;") DllCall($hDwmApiDll, "int", "DwmIsCompositionEnabled", "ptr", DllStructGetPtr($sChkAero)) Global $bAero = DllStructGetData($sChkAero, 1) Global $fStep = 0.02 If Not $bAero Then $fStep = 1.25 _GDIPlus_Startup() Global $iW = 300, $iH = 120 $hGUI = GUICreate("Office", 442, 252, @DesktopWidth / 2.95, @DesktopHeight / 3.2, $WS_POPUP) GUISetBkColor("0x" & $sThemeColor) ;GUISetBkColor(0xB7472A) ;GUISetBkColor(0x2b579a) ;Word Blue ;GUISetBkColor(0x217346) ;Excel Green $Label1 = GUICtrlCreateLabel("SciTE4AutoIt3", 8, 8, 102, 21) GUICtrlSetFont(-1, 10, 400, 0, "Segoe UI Light") GUICtrlSetColor(-1, 0xFFFFFF) $Label2 = GUICtrlCreateLabel("AutoIt 247", 64, 72, 314, 75, BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetFont(-1, 40, 400, 0, "Segoe UI Light") GUICtrlSetColor(-1, 0xFFFFFF) $Label3 = GUICtrlCreateLabel("Starting...", 10, 205, 54, 21) GUICtrlSetFont(-1, 10, 400, 0, "Segoe UI Light") GUICtrlSetColor(-1, 0xFFFFFF) $Label4 = GUICtrlCreateLabel("r", 410, 4, 20, 21) GUICtrlSetFont(-1, 12, 400, 0, "Webdings") GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlSetTip(-1, "Closes the splash screen.") $Label5 = GUICtrlCreateLabel("0", 385, 0, 20, 21) GUICtrlSetFont(-1, 12, 400, 0, "Webdings") GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlSetTip(-1, "Minimises the splash screen.") GUISetState(@SW_SHOW) Global Const $iPic = GUICtrlCreatePic("", 80, 150, $iW, $iH) GUICtrlSetState(-1, $GUI_DISABLE) WinSetTrans($hGUI, "", 0) GUISetState() Global $hHBmp_BG, $hB, $iSleep = 100 GUIRegisterMsg($WM_TIMER, "PlayAnim") DllCall("user32.dll", "int", "SetTimer", "hwnd", $hGUI, "int", 0, "int", $iSleep, "int", 0) Global $z, $iPerc For $z = 1 To 255 Step $fStep WinSetTrans($hGUI, "", $z) Next Do Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $Label4 ConsoleWrite("Exit") GUIRegisterMsg($WM_TIMER, "") _WinAPI_DeleteObject($hHBmp_BG) _GDIPlus_Shutdown() For $z = 255 To 1 Step -$fStep WinSetTrans($hGUI, "", $z) Next GUIDelete($hGUI) Exit EndSwitch Until False Func PlayAnim() Local $iballs = 3 $hHBmp_BG = _GDIPlus_ThreeBalls($iW, $iH, $iPerc, 5, $iballs) $hB = GUICtrlSendMsg($iPic, $STM_SETIMAGE, $IMAGE_BITMAP, $hHBmp_BG) If $hB Then _WinAPI_DeleteObject($hB) _WinAPI_DeleteObject($hHBmp_BG) ; Joue sur la vitesse d affichage $iPerc += 30 If $iPerc > (90 * ($iballs + 2)) Then $iPerc = 0 EndFunc ;==>PlayAnim Func _GDIPlus_ThreeBalls($iW, $iH, $iPerc, $iRadius = 5, $iballs = 3, $bHBitmap = True) Local Const $iDiameter = $iRadius * 2 Local $tPointF1 = DllStructCreate("float;float") Local $pPointF1 = DllStructGetPtr($tPointF1) Local $tPointF2 = DllStructCreate("float;float") Local $pPointF2 = DllStructGetPtr($tPointF2) DllStructSetData($tPointF1, 1, $iDiameter) DllStructSetData($tPointF1, 2, 0) DllStructSetData($tPointF2, 1, $iDiameter) DllStructSetData($tPointF2, 2, $iDiameter) Local $hBrushBall2 = DllCall($__g_hGDIPDll, "uint", "GdipCreateLineBrush", "ptr", $pPointF1, "ptr", $pPointF2, "uint", 0xFFcecbca, "uint", 0xFFf2eeed, "int", 1, "int*", 0) $hBrushBall2 = $hBrushBall2[6] Local $hBitmap = _GDIPlus_BitmapCreateFromScan0($iW, $iH) Local Const $hCtxt = _GDIPlus_ImageGetGraphicsContext($hBitmap) _GDIPlus_GraphicsSetSmoothingMode($hCtxt, 2) _GDIPlus_GraphicsSetPixelOffsetMode($hCtxt, $GDIP_PIXELOFFSETMODE_HIGHQUALITY) Local Const $hBrushBall1 = _GDIPlus_BrushCreateSolid("0xFF" & $sThemeColor) _GDIPlus_GraphicsFillRect($hCtxt, 0, 0, $iW, $iH, $hBrushBall1) Local $aPos[$iballs][3] Local Static $aCircle[$iballs + 1] For $i = 0 To $iballs - 1 $aPos[($iballs - 1) - $i][0] = ($iW / 2) - (($iDiameter * 3) * ($i + 1)) + (($iballs - 1) / 2 * ($iDiameter * 3)) + $iDiameter * 3 $aPos[($iballs - 1) - $i][1] = ($iH - $iRadius) / 2 _GDIPlus_GraphicsFillCircle($hCtxt, $aPos[($iballs - 1) - $i][0], $aPos[($iballs - 1) - $i][1], $iRadius, $hBrushBall1) Next Local $i, $fDH, $height For $i = 0 To $iballs - 1 Local $iBallValue = $iPerc - ($i * 90) If ($iBallValue < 0 Or $iBallValue > 180) Then $iBallValue = 0 $fDH = Sin($iBallValue * $PI / 180) / 2 $height = $iRadius * 10 ;~ _GDIPlus_GraphicsFillCircle($hCtxt, $aPos[$i][0], $aPos[$i][1] - ($height * abs($fDH)), $iRadius , $hBrushBall2) _GDIPlus_GraphicsFillCircle($hCtxt, $aPos[$i][0], $aPos[$i][1], $iRadius + $iRadius * $fDH, $hBrushBall2) Next _GDIPlus_GraphicsDispose($hCtxt) _GDIPlus_BrushDispose($hBrushBall1) _GDIPlus_BrushDispose($hBrushBall2) ;~ _GDIPlus_PenDispose($hPen) If $bHBitmap Then Local $hHBITMAP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) _GDIPlus_BitmapDispose($hBitmap) Return $hHBITMAP EndIf Return $hBitmap EndFunc ;==>_GDIPlus_ThreeBalls Func _GDIPlus_GraphicsFillCircle($hCtxt, $iXCenterPos, $iCenterYPos, $iRadius, $hBrush) _GDIPlus_GraphicsFillEllipse($hCtxt, $iXCenterPos - $iRadius, $iCenterYPos - $iRadius, $iRadius * 2, $iRadius * 2, $hBrush) EndFunc ;==>_GDIPlus_GraphicsFillCircle
    1 point
  10. You can replace the line _GDIPlus_GraphicsFillCircle($hCtxt, $aPos[$i][0], $aPos[$i][1], $iRadius * abs($fDH) , $hBrushBall2) by $height = 20 _GDIPlus_GraphicsFillCircle($hCtxt, $aPos[$i][0], $aPos[$i][1] + $height * abs($fDH), $iRadius , $hBrushBall2) to simply obtain an other animation.
    1 point
  11. A little bit cleaner, with color choice in one place : #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <Memory.au3> #include <GDIPlus.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <TrayConstants.au3> Global Const $sExcelColor = "217346", $sWordColor = "2b579a", $sOutlookColor = "B7472A" Global Const $sThemeColor = $sOutlookColor Global Const $hDwmApiDll = DllOpen("dwmapi.dll") Global $sChkAero = DllStructCreate("int;") DllCall($hDwmApiDll, "int", "DwmIsCompositionEnabled", "ptr", DllStructGetPtr($sChkAero)) Global $bAero = DllStructGetData($sChkAero, 1) Global $fStep = 0.02 If Not $bAero Then $fStep = 1.25 _GDIPlus_Startup() Global $iW = 300, $iH = 120 $hGUI = GUICreate("Office", 442, 252, @DesktopWidth /2.95, @DesktopHeight /3.2, $WS_POPUP) GUISetBkColor("0x" & $sThemeColor) ;~ GUISetBkColor(0xB7472A) ;GUISetBkColor(0x2b579a) ;Word Blue ;~ GUISetBkColor(0x217346) ;Excel Green $Label1 = GUICtrlCreateLabel("SciTE4AutoIt3", 8, 8, 102, 21) GUICtrlSetFont(-1, 10, 400, 0, "Segoe UI Light") GUICtrlSetColor(-1, 0xFFFFFF) $Label2 = GUICtrlCreateLabel("AutoIt 247", 64, 72, 314, 75, BitOR($SS_CENTER,$SS_CENTERIMAGE)) GUICtrlSetFont(-1, 40, 400, 0, "Segoe UI Light") GUICtrlSetColor(-1, 0xFFFFFF) $Label3 = GUICtrlCreateLabel("Starting...", 10, 205, 54, 21) GUICtrlSetFont(-1, 10, 400, 0, "Segoe UI Light") GUICtrlSetColor(-1, 0xFFFFFF) $Label4 = GUICtrlCreateLabel("r", 410, 4, 20, 21) GUICtrlSetFont(-1, 12, 400, 0, "Webdings") GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlSetTip(-1, "Closes the splash screen.") $Label5 = GUICtrlCreateLabel("0", 385, 0, 20, 21) GUICtrlSetFont(-1, 12, 400, 0, "Webdings") GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlSetTip(-1, "Minimises the splash screen.") GUISetState(@SW_SHOW) Global Const $iPic = GUICtrlCreatePic("", 80, 150, $iW, $iH) GUICtrlSetState(-1, $GUI_DISABLE) WinSetTrans($hGUI, "", 0) GUISetState() Global $hHBmp_BG, $hB, $iSleep = 100 GUIRegisterMsg($WM_TIMER, "PlayAnim") DllCall("user32.dll", "int", "SetTimer", "hwnd", $hGUI, "int", 0, "int", $iSleep, "int", 0) Global $z, $iPerc For $z = 1 To 255 Step $fStep WinSetTrans($hGUI, "", $z) Next Do Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $Label4 ConsoleWrite("Exit") GUIRegisterMsg($WM_TIMER, "") _WinAPI_DeleteObject($hHBmp_BG) _GDIPlus_Shutdown() For $z = 255 To 1 Step -$fStep WinSetTrans($hGUI, "", $z) Next GUIDelete($hGUI) Exit EndSwitch Until False Func PlayAnim() $hHBmp_BG = _GDIPlus_ThreeBalls($iW, $iH, $iPerc) $hB = GUICtrlSendMsg($iPic, $STM_SETIMAGE, $IMAGE_BITMAP, $hHBmp_BG) If $hB Then _WinAPI_DeleteObject($hB) _WinAPI_DeleteObject($hHBmp_BG) ; Joue sur la vitesse d affichage $iPerc += 1 If $iPerc > 110 Then $iPerc = 0 EndFunc ;==>PlayAnim Func _GDIPlus_ThreeBalls($iW, $iH, $iPerc, $sString = "Please wait...", $iRadius = 5, $iBalls = 3, $bHBitmap = True) Local Const $iDiameter = $iRadius * 2 Local $tPointF1 = DllStructCreate("float;float") Local $pPointF1 = DllStructGetPtr($tPointF1) Local $tPointF2 = DllStructCreate("float;float") Local $pPointF2 = DllStructGetPtr($tPointF2) DllStructSetData($tPointF1, 1, $iDiameter) DllStructSetData($tPointF1, 2, 0) DllStructSetData($tPointF2, 1, $iDiameter) DllStructSetData($tPointF2, 2, $iDiameter) Local $hBrushBall2 = DllCall($__g_hGDIPDll, "uint", "GdipCreateLineBrush", "ptr", $pPointF1, "ptr", $pPointF2, "uint", 0xFFcecbca, "uint", 0xFFf2eeed, "int", 1, "int*", 0) $hBrushBall2 = $hBrushBall2[6] Local $hBitmap = _GDIPlus_BitmapCreateFromScan0($iW, $iH) Local Const $hCtxt = _GDIPlus_ImageGetGraphicsContext($hBitmap) _GDIPlus_GraphicsSetSmoothingMode($hCtxt, 2) _GDIPlus_GraphicsSetPixelOffsetMode($hCtxt, $GDIP_PIXELOFFSETMODE_HIGHQUALITY) Local Const $hBrushBall1 = _GDIPlus_BrushCreateSolid("0xFF" & $sThemeColor) _GDIPlus_GraphicsFillRect($hCtxt, 0, 0, $iW, $iH, $hBrushBall1) Local $aPos[$iBalls + 2][4], $iArrayPos, $j = 1 Local Static $aCircle[$iBalls + 1] For $i = 0 To $iBalls - 1 $aPos[($iBalls - 1) - $i][0] = ($iW / 2) - (($iDiameter * 3) * ($i + 1)) + (($iBalls - 1) / 2 * ($iDiameter * 3)) + $iDiameter * 3 $aPos[($iBalls - 1) - $i][1] = ($iH - $iRadius) / 2 _GDIPlus_GraphicsFillCircle($hCtxt, $aPos[($iBalls - 1) - $i][0], $aPos[($iBalls - 1) - $i][1], $iRadius, $hBrushBall1) $aPos[($iBalls - 1) - $i][2] = 100 / $iBalls $iArrayPos = Int($iPerc / ($aPos[($iBalls - 1) - $i][2])) $aPos[$iArrayPos][3] = ($iPerc - ($iArrayPos * ($aPos[($iBalls - 1) - $i][2]))) / $aPos[($iBalls - 1) - $i][2] If $iArrayPos > 0 Then For $j = 0 To $iArrayPos - 1 $aPos[$j][3] = 1 Next EndIf Next ; Animation remplissage des balles Local $i, $fDH Local Static $s For $i = 0 To $iBalls - 1 $fDH = Sin($s + Cos($i )) $s += 0.1 _GDIPlus_GraphicsFillCircle($hCtxt, $aPos[$i][0], $aPos[$i][1], $iRadius * abs($fDH) , $hBrushBall2) Next _GDIPlus_GraphicsDispose($hCtxt) _GDIPlus_BrushDispose($hBrushBall1) _GDIPlus_BrushDispose($hBrushBall2) ;~ _GDIPlus_PenDispose($hPen) If $bHBitmap Then Local $hHBITMAP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) _GDIPlus_BitmapDispose($hBitmap) Return $hHBITMAP EndIf Return $hBitmap EndFunc func _GDIPlus_GraphicsFillCircle($hCtxt, $iXCenterPos, $iCenterYPos, $iRadius, $hBrush) _GDIPlus_GraphicsFillEllipse($hCtxt, $iXCenterPos - $iRadius, $iCenterYPos - $iRadius, $iRadius * 2, $iRadius * 2, $hBrush) endFunc
    1 point
  12. Thanks UEZ again for his work. I think this part of code should be improved For $i = 0 To $iBalls - 1 _GDIPlus_PenSetColor($hPen, 0xFF217346) $iHeight = $iRadius * 0.05 $fDH = Sin($s + Cos($i + $t)) * $iHeight * 0.66666 $s += 0.05 _GDIPlus_GraphicsFillEllipse($hCtxt, $iRadius + $aPos[$i][0] - $iRadius * $fDH, $iRadius + $aPos[$i][1] - $iRadius * $fDH, $iDiameter * $fDH, $iDiameter * $fDH, $hBrushBall2) Next
    1 point
  13. Thats really not that much code Nice Job, It'd be nice to have the X button work and a fade out Do Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $Label4 ConsoleWrite("Exit") GUIRegisterMsg($WM_TIMER, "") _WinAPI_DeleteObject($hHBmp_BG) _GDIPlus_Shutdown() For $z = 255 To 1 Step -$fStep WinSetTrans($hGUI, "", $z) Next GUIDelete($hGUI) Exit EndSwitch Until False
    1 point
  14. I tried to do a small animation. i took the code of this topic and some code from GDI+ animated loading screens build 2014-06-20 from UEZ GDI+ animated loading screens It's not perfect ... #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <Memory.au3> #include <GDIPlus.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <TrayConstants.au3> Global Const $hDwmApiDll = DllOpen("dwmapi.dll") Global $sChkAero = DllStructCreate("int;") DllCall($hDwmApiDll, "int", "DwmIsCompositionEnabled", "ptr", DllStructGetPtr($sChkAero)) Global $bAero = DllStructGetData($sChkAero, 1) Global $fStep = 0.02 If Not $bAero Then $fStep = 1.25 _GDIPlus_Startup() Global $iW = 300, $iH = 120 $hGUI = GUICreate("Office", 442, 252, @DesktopWidth /2.95, @DesktopHeight /3.2, $WS_POPUP) GUISetBkColor(0xB7472A) ;GUISetBkColor(0x2b579a) ;Word Blue GUISetBkColor(0x217346) ;Excel Green $Label1 = GUICtrlCreateLabel("SciTE4AutoIt3", 8, 8, 102, 21) GUICtrlSetFont(-1, 10, 400, 0, "Segoe UI Light") GUICtrlSetColor(-1, 0xFFFFFF) $Label2 = GUICtrlCreateLabel("AutoIt 247", 64, 72, 314, 75, BitOR($SS_CENTER,$SS_CENTERIMAGE)) GUICtrlSetFont(-1, 40, 400, 0, "Segoe UI Light") GUICtrlSetColor(-1, 0xFFFFFF) $Label3 = GUICtrlCreateLabel("Starting...", 10, 205, 54, 21) GUICtrlSetFont(-1, 10, 400, 0, "Segoe UI Light") GUICtrlSetColor(-1, 0xFFFFFF) $Label4 = GUICtrlCreateLabel("r", 410, 4, 20, 21) GUICtrlSetFont(-1, 12, 400, 0, "Webdings") GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlSetTip(-1, "Closes the splash screen.") $Label5 = GUICtrlCreateLabel("0", 385, 0, 20, 21) GUICtrlSetFont(-1, 12, 400, 0, "Webdings") GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlSetTip(-1, "Minimises the splash screen.") GUISetState(@SW_SHOW) Global Const $iPic = GUICtrlCreatePic("", 80, 150, $iW, $iH) GUICtrlSetState(-1, $GUI_DISABLE) WinSetTrans($hGUI, "", 0) GUISetState() Global $hHBmp_BG, $hB, $iSleep = 50 GUIRegisterMsg($WM_TIMER, "PlayAnim") DllCall("user32.dll", "int", "SetTimer", "hwnd", $hGUI, "int", 0, "int", $iSleep, "int", 0) Global $z, $iPerc For $z = 1 To 255 Step $fStep WinSetTrans($hGUI, "", $z) Next Do Switch GUIGetMsg() Case $GUI_EVENT_CLOSE GUIRegisterMsg($WM_TIMER, "") _WinAPI_DeleteObject($hHBmp_BG) _GDIPlus_Shutdown() GUIDelete() Exit EndSwitch Until False Func PlayAnim() $hHBmp_BG = _GDIPlus_ThreeBalls($iW, $iH, $iPerc) $hB = GUICtrlSendMsg($iPic, $STM_SETIMAGE, $IMAGE_BITMAP, $hHBmp_BG) If $hB Then _WinAPI_DeleteObject($hB) _WinAPI_DeleteObject($hHBmp_BG) ; Joue sur la vitesse d affichage $iPerc += 0.5 If $iPerc > 110 Then $iPerc = 0 EndFunc ;==>PlayAnim Func _GDIPlus_ThreeBalls($iW, $iH, $iPerc, $sString = "Please wait...", $iRadius = 12, $iBalls = 3, $bHBitmap = True) Local Const $iDiameter = $iRadius * 2 Local $tPointF1 = DllStructCreate("float;float") Local $pPointF1 = DllStructGetPtr($tPointF1) Local $tPointF2 = DllStructCreate("float;float") Local $pPointF2 = DllStructGetPtr($tPointF2) DllStructSetData($tPointF1, 1, $iDiameter) DllStructSetData($tPointF1, 2, 0) DllStructSetData($tPointF2, 1, $iDiameter) DllStructSetData($tPointF2, 2, $iDiameter) Local $hBrushBall2 = DllCall($__g_hGDIPDll, "uint", "GdipCreateLineBrush", "ptr", $pPointF1, "ptr", $pPointF2, "uint", 0xFFcecbca, "uint", 0xFFf2eeed, "int", 1, "int*", 0) $hBrushBall2 = $hBrushBall2[6] Local $hBitmap = _GDIPlus_BitmapCreateFromScan0($iW, $iH) Local Const $hCtxt = _GDIPlus_ImageGetGraphicsContext($hBitmap) _GDIPlus_GraphicsSetSmoothingMode($hCtxt, 2) _GDIPlus_GraphicsSetPixelOffsetMode($hCtxt, $GDIP_PIXELOFFSETMODE_HIGHQUALITY) Local Const $hBrushBall1 = _GDIPlus_BrushCreateSolid(0xFF217346) _GDIPlus_GraphicsFillRect($hCtxt, 0, 0, $iW, $iH, $hBrushBall1) Local $aPos[$iBalls + 2][4], $iArrayPos, $j = 1 Local Static $aCircle[$iBalls + 1] For $i = 0 To $iBalls - 1 $aPos[($iBalls - 1) - $i][0] = ($iW / 2) - (($iDiameter + $iRadius) * ($i + 1)) + (($iBalls - 1) / 2 * ($iDiameter + $iRadius)) + $iDiameter $aPos[($iBalls - 1) - $i][1] = ($iH - $iRadius) / 2 _GDIPlus_GraphicsFillEllipse($hCtxt, $aPos[($iBalls - 1) - $i][0], $aPos[($iBalls - 1) - $i][1], $iDiameter, $iDiameter, $hBrushBall1) ;draw background $aPos[($iBalls - 1) - $i][2] = 100 / $iBalls $iArrayPos = Int($iPerc / ($aPos[($iBalls - 1) - $i][2])) $aPos[$iArrayPos][3] = ($iPerc - ($iArrayPos * ($aPos[($iBalls - 1) - $i][2]))) / $aPos[($iBalls - 1) - $i][2] If $iArrayPos > 0 Then For $j = 0 To $iArrayPos - 1 $aPos[$j][3] = 1 Next EndIf Next ; Animation remplissage des balles Local $fMax = 2, $hPen = _GDIPlus_PenCreate(0x217346, 1) Local $i, $fDH Local Static $s, $t For $i = 0 To $iBalls - 1 _GDIPlus_PenSetColor($hPen, 0xFF217346) $iHeight = $iRadius * 0.05 $fDH = Sin($s + Cos($i + $t)) * $iHeight * 0.66666 $s += 0.05 _GDIPlus_GraphicsFillEllipse($hCtxt, $iRadius + $aPos[$i][0] - $iRadius * $fDH, $iRadius + $aPos[$i][1] - $iRadius * $fDH, $iDiameter * $fDH, $iDiameter * $fDH, $hBrushBall2) Next _GDIPlus_GraphicsDispose($hCtxt) _GDIPlus_BrushDispose($hBrushBall1) _GDIPlus_BrushDispose($hBrushBall2) _GDIPlus_PenDispose($hPen) If $bHBitmap Then Local $hHBITMAP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) _GDIPlus_BitmapDispose($hBitmap) Return $hHBITMAP EndIf Return $hBitmap EndFunc A lots of code only for three dots
    1 point
  15. Understanding this stuff at 12 isnt reward enough? my hobbies at 12 were lighting things on fire and watching things that were on fire.
    1 point
  16. Try WinSetState("WINDOW_NAME", "", @SW_RESTORE) WinSetState("WINDOW_NAME", "", @SW_MAXIMIZE)
    1 point
×
×
  • Create New...