Jump to content

Progressbar inside a splashtext screen?


Recommended Posts

Hello from Barcelona.

Not sure if it can done... is it possible to insert a progressbar inside of a SplashTextOn window?

This is a countdown showed on a splashtext, and I also want to put a progress bar in it. (this bar was alredy showed in the program on a gui before)

$X = 0
    $y = GUICtrlRead($input) * 60
    $message = ""
    $message1 = "Waiting Time " & $message
    SplashTextOn("Please wait!", $message, 600, 530, -1, -1, 1, "", 110)

    While $y > $X
        $message = StringFormat("%02d:%02d:%02d\n", Floor($y / 3600), Mod(Floor($y / 60), 60), Mod($y, 60))
        ControlSetText("Please wait!", "", "Static1", $message1 & $message)
        Sleep(1000)
        $y = $y - 1

I've been looking on the help and googling in vain :mellow:

I've tried to put the progress bar inside the control text

While $y > $X
        $message = StringFormat("%02d:%02d:%02d\n", Floor($y / 3600), Mod(Floor($y / 60), 60), Mod($y, 60))
        ControlSetText("Please wait!", "", "Static1", $message1 & $message & $progress)

(yes, pathetic, I know...)

and also tried that:

SplashTextOn("Please wait!", $message, 600, 530, -1, -1, 1, "", 110)
    $ProgressBar = GUICtrlCreateProgress (40,320,200,20, $PBS_SMOOTH)

Could you please point me in any direction? Is it possible to add something to a splashtext? jpgs, , etc...?

Link to comment
Share on other sites

I think it is not possible to add a progress bar to SplashTextOn function.

You have to create a GUI which looks like the SplashTextOn function and add a progress bar into it.

BR,

UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

Here is an example of a function for a splash screen with progress GUI that I use in many of my scripts. You can customize it to your needs. This uses a marquess progress bar, but you can use a different style.

#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#include <SendMessage.au3> ;Needed for _SendMessage function.
#include <ProgressConstants.au3>

$hProgressSplash = _SplashTextProgress("This is a test.")

Sleep(5000)

Func _SplashTextProgress($sText) ;Creates a Splash Text Screen with a progress bar.
    SplashOff() ;Turn previous splash text screens off.
    $hSplash = GUICreate("", 500, 400, -1, -1, BitOR($WS_POPUP, $WS_BORDER), BitOR($WS_EX_TOPMOST, $WS_EX_WINDOWEDGE, $WS_EX_TOOLWINDOW))
;~  $iProgressBar = GUICtrlCreateProgress(100, 325, 305, 25, $PBS_SMOOTH)
    $iProgressBar = GUICtrlCreateProgress(100, 325, 305, 25, $PBS_MARQUEE) ;A Marquee progress bar.
    _SendMessage(GUICtrlGetHandle(-1), $PBM_SETMARQUEE, True, 80) ;last parameter is update time in ms. Sends message to run the Marquee progress bar.
    $iMessage = GUICtrlCreateLabel($sText, 0, 100, 500, 200, $SS_CENTER)
    GUICtrlSetFont(-1, 24, 700, 0, "Courier New")

    GUISetState(@SW_SHOW)

    Return SetExtended($iProgressBar, $hSplash)
EndFunc   ;==>_SplashTextProgress

Adam

Link to comment
Share on other sites

Here is an example of a function for a splash screen with progress GUI that I use in many of my scripts. You can customize it to your needs. This uses a marquess progress bar, but you can use a different style.

#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#include <SendMessage.au3> ;Needed for _SendMessage function.
#include <ProgressConstants.au3>

$hProgressSplash = _SplashTextProgress("This is a test.")

Sleep(5000)

Func _SplashTextProgress($sText) ;Creates a Splash Text Screen with a progress bar.
    SplashOff() ;Turn previous splash text screens off.
    $hSplash = GUICreate("", 500, 400, -1, -1, BitOR($WS_POPUP, $WS_BORDER), BitOR($WS_EX_TOPMOST, $WS_EX_WINDOWEDGE, $WS_EX_TOOLWINDOW))
;~  $iProgressBar = GUICtrlCreateProgress(100, 325, 305, 25, $PBS_SMOOTH)
    $iProgressBar = GUICtrlCreateProgress(100, 325, 305, 25, $PBS_MARQUEE) ;A Marquee progress bar.
    _SendMessage(GUICtrlGetHandle(-1), $PBM_SETMARQUEE, True, 80) ;last parameter is update time in ms. Sends message to run the Marquee progress bar.
    $iMessage = GUICtrlCreateLabel($sText, 0, 100, 500, 200, $SS_CENTER)
    GUICtrlSetFont(-1, 24, 700, 0, "Courier New")

    GUISetState(@SW_SHOW)

    Return SetExtended($iProgressBar, $hSplash)
EndFunc   ;==>_SplashTextProgress

Adam

Thankyou very much, I'll try that.
Link to comment
Share on other sites

  • 2 years later...

Thanks RBrown, glad it helped. Here is an updated version that does not require the "SendMessage.au3" for the marquee progress bar.

#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#include <ProgressConstants.au3>

$hProgressSplash = _SplashTextProgress("This is a test.")

Sleep(5000)

Func _SplashTextProgress($sText) ;Creates a Splash Text Screen with a progress bar.
    SplashOff() ;Turn previous splash text screens off.
    $hSplash = GUICreate("", 500, 400, -1, -1, BitOR($WS_POPUP, $WS_BORDER), BitOR($WS_EX_TOPMOST, $WS_EX_WINDOWEDGE, $WS_EX_TOOLWINDOW))
;~  $iProgressBar = GUICtrlCreateProgress(100, 325, 305, 25, $PBS_SMOOTH) ;A standard progress bar.
    $iProgressBar = GUICtrlCreateProgress(100, 325, 305, 25, $PBS_MARQUEE) ;A marquee progress bar.
    GUICtrlSendMsg(-1, $PBM_SETMARQUEE, True, 80) ;last parameter is update time in ms. Sends message to run the marquee progress bar.
    $iMessage = GUICtrlCreateLabel($sText, 0, 100, 500, 200, $SS_CENTER)
    GUICtrlSetFont(-1, 24, 700, 0, "Courier New")

    GUISetState(@SW_SHOW)

    Return SetExtended($iProgressBar, $hSplash)
EndFunc   ;==>_SplashTextProgress

Adam

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...