Jump to content
Skeletor

MS Office Style Splash Screen

Recommended Posts

Skeletor

MS Splash Screens

The office 2016/17 office suite has made many people turn heads with its functions and especially their splash screen.

I now present to you, the MS Style Splash Screen. For Rookies, Novices and anyone who wants a ready made splash screen for your gui application.

You can now download it and also try it out yourself.
You have three colors to choose from:
Blue
Red
Green

All three colours are from the famous programs.
I also included the KODA form to you can have freedom with this splash screen.
Note: the KODA form does not have the three colours as well as the correct blue. 

Have fun and enjoy.

Note:
Thanks to kaz for updating the side scrolling dots.

 

 

Edited by Skeletor
  • Like 1

Kind Regards
Skeletor

"I need coffee to turn me back to a normal human"

Share this post


Link to post
Share on other sites
coffeeturtle

Nice work!

Looking forward to:

Note:
I will update the splash to add the automated 3 dots animation at a later stage. 

Thank you for sharing!

Share this post


Link to post
Share on other sites
coffeeturtle
On 10/16/2017 at 4:41 AM, Skeletor said:

Note:

 

I will update the splash to add the automated 3 dots animation at a later stage. 

 

@Skeletor Just wondering if the three dot animation was still something you were looking at?  Thanks!

 

Share this post


Link to post
Share on other sites
Skeletor

@coffeeturtle, this will be done soon. Just need to make time to do this project as now many projects have higher priority. 
Trust me, it will be done though... 


Kind Regards
Skeletor

"I need coffee to turn me back to a normal human"

Share this post


Link to post
Share on other sites
coffeeturtle

No worries @Skeletor  Thank you much!  I was just checking in. Pretty nice even without animation. Looking forward to your update in the future!

Share this post


Link to post
Share on other sites
kaz

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

  • Like 2

Share this post


Link to post
Share on other sites
Bilgus

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

 

  • Like 1

Share this post


Link to post
Share on other sites
kaz

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

 

  • Like 1

Share this post


Link to post
Share on other sites
kaz

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

 

  • Like 2

Share this post


Link to post
Share on other sites
kaz

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.

  • Like 1

Share this post


Link to post
Share on other sites
kaz

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

 

  • Like 1

Share this post


Link to post
Share on other sites
kaz

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

 

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
Skeletor

Great stuff there kaz.
Thanks for keeping this alive.

  • Thanks 1

Kind Regards
Skeletor

"I need coffee to turn me back to a normal human"

Share this post


Link to post
Share on other sites
argumentum

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)

 

Edited by argumentum
  • Like 2

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • XinYoung
      By XinYoung
      For fun, I'm building an app that opens a webpage and refreshes it every 30 seconds.
      But once the script performs _IEAction($oIE, "refresh"), the GUI closes.
      Any help is appreciated.
       

      #include <ButtonConstants.au3>
      #include <EditConstants.au3>
      #include <GUIConstantsEx.au3>
      #include <StaticConstants.au3>
      #include <WindowsConstants.au3>
      #include <WinAPIFiles.au3>
      #include <Array.au3>
      #include <File.au3>
      #include <Excel.au3>
      #include <DateTimeConstants.au3>
      #include <MsgBoxConstants.au3>
      #include <WinAPIShellEx.au3>
      #include <MsgBoxConstants.au3>
      #include <Date.au3>
      #include <ComboConstants.au3>
      #include <guimenu.au3>
      #include <IE.au3>
      HotKeySet("{F4}", "_Exit")
      ;Open the file(s) in the selected folder
      $extension = ".txt"
      $app2openWith = @SystemDir & "\notepad.exe"
      Func Begin()
          Global $loopTrick = 0
          #Region ### START Koda GUI section ### Form=c:\users\mchu\downloads\autoit\my code\form1.kxf
          Global $UI = GUICreate("Hit Em Up!", 256, 113, -1, -1)
          GUISetBkColor(0x000000)
          $menu = _GUICtrlMenu_GetSystemMenu($UI)
          _GUICtrlMenu_EnableMenuItem($menu, $SC_CLOSE, 1, False)
          Global $url = GUICtrlCreateInput("https://www.youtube.com/watch?v=dQw4w9WgXcQ", 81, 8, 160, 21)
          $Label1 = GUICtrlCreateLabel("Target:", 16, 8, 55, 17)
          GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
          GUICtrlSetColor(-1, 0x00FF00)
          Global $StartBut = GUICtrlCreateButton("Start", 16, 40, 67, 25)
          GUICtrlSetFont(-1, 13, 800, 0, "MS Sans Serif")
          GUICtrlSetBkColor(-1, 0x008000)
          $Label2 = GUICtrlCreateLabel("(Press F4 to Exit)", 96, 40, 8000, 17)
          GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
          GUICtrlSetColor(-1, 0x00FF00)
          GUISetState(@SW_SHOW)
          #EndRegion ### END Koda GUI section ###
          While 1
              $UIfunc = GUIGetMsg()
              Select
                  Case $UIfunc = $GUI_EVENT_CLOSE
                      _Exit()
                  Case $UIfunc = $StartBut
                      If GUICtrlRead($url) = "" Then
                          MsgBox(48, "Um...", "Give me a target you idiot.")
                      Else
                          GUICtrlSetState($url, $GUI_DISABLE)
                          GUICtrlSetState($StartBut, $GUI_DISABLE)
                          Start()
                      EndIf
              EndSelect
          WEnd
      EndFunc   ;==>Begin
      Func Start()
          If $loopTrick = 0 Then
              Global $oIE = _IECreate(GUICtrlRead($url))
              _IELoadWait($oIE)
              Again()
          ElseIf $loopTrick = 1 Then
              Sleep(3000)
              _IEAction($oIE, "refresh")
              Sleep(3000)
              Start()
          EndIf
      EndFunc   ;==>Start
      Func Again()
          $loopTrick = 1
          Start()
      EndFunc   ;==>Again
      Func _Exit()
          Exit
      EndFunc   ;==>_Exit
    • kcvinu
      By kcvinu
      Hi all,
      I have a button created with _GUICtrlButton_Create function. I know that this function returns a handle of button instead of an ID. So i have obtain control ID by calling _WinAPI_GetDlgCtrlID function. After that i have tried the GUICtrlSetBkColor function. But it didnt worked. Any suggestions will be appreciated. Thanks in advance. 
      Note : - The window which carries this button is not created with native gui create function. Instead, it is created with CreateWindowEx api function.
    • kcvinu
      By kcvinu
      Hi all,
      I am playing with _GUICtrlButton_Create function. How can i change this button's (or the entire form's) font ?. The in-built GUICtrlSetFont function is not working even when i convert the control handle to control ID with _WinAPI_GetDlgCtrlID ( ) function.  Do i need to use CreateFont api finction and send WM_SETFONT message ? Or is there any other easy and safe ways to do this ?. Thanks in advance.
      Note : This window is created by CreateWindowEx function, not by GUICreate function. 
    • Jake_s
      By Jake_s
      Hi All, 
       
      I am a begginer in auto it. I am trying to build simple gui that will show me if for example notepad.exe process is currently running on the system. I have built something like this, but when I execute it shows me message boxes, but I want the results to show in gui. If you can help me start with this.
       
      Thanks
       
        #include <MsgBoxConstants.au3>
      #include <GUIConstantsEx.au3>

      ActiveProcess()

      Func ActiveProcess()
      GUICreate("Act")
               ProcessExists("wuauclt.exe")

             If ProcessExists("wuauclt.exe") Then
       MsgBox($MB_SYSTEMMODAL, "", "Windows Upates are running")
           Else
       MsgBox($MB_SYSTEMMODAL, "", "Windows Updates are not running")
       EndIf
         ;Notepad

               ProcessExists("notepad.exe")

               If ProcessExists("notepad.exe") Then
      MsgBox($MB_SYSTEMMODAL, "", "Notepad is running")
              Else
      MsgBox($MB_SYSTEMMODAL, "", "Notepad is not running")
      EndIf  
       
×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.