Sign in to follow this  
Followers 0
Country73

Looking for Improvement ideas

5 posts in this topic

I've been using a combination of script bits I've found/modified out here on the site, and now I'm looking at a way to improve it.

This is used whenever I've created an installation script to show a SplashScreen while the software is installed.

Everything looks fine, and functions correctly. I'm simply looking for any input as to changing it up a bit.

Portion of my <SplashScreen.au3> that I include in my scripts:

Global $SplashGui
Global $Label
Global $GuiSplashText
Global $sFontName = 'Times New Roman'
Global $WS_POPUP = 0x80000000
Global $WS_EX_TOPMOST = 0x00000008

Func _SplashScreen($sInstallName,$sInstallMessage,$sBackgroundBMP)
     If $sBackgroundBMP = "" Then
          ConsoleWrite("--> Warning from _SplashScreen, No Background BMP given.")
          Return SetError(3)
     EndIf
     SplashImageOn('',$sBackgroundBMP,@DesktopWidth,@DesktopHeight,'','',1)

     If $sInstallName = "" Then
          ConsoleWrite("--> Warning from _SplashScreen, No message given.")
          Return SetError(2)
     EndIf

     Local $StrLen    = StringLen($sInstallName)
     $SplashGui       = GUICreate('',500,230,20,20,$WS_POPUP,$WS_EX_TOPMOST)
     $Label           = GUICtrlCreateLabel($sInstallName,500 - ($Strlen*10),25,120 + ($Strlen*10),30)
     $GuiSplashText   = GUICtrlCreateLabel($sInstallMessage,20,190,510,-1)
     GUICtrlSetFont($Label,16,600,'',$sFontName)
     GUICtrlSetFont($GuiSplashText,14,400,'',$sFontName)
     GUISetState(@SW_SHOW)

     Return SetError(0)
EndFunc

Func _SplashUpdate($sUpdateName,$sUpdateMessage)
     If Not $sUpdateName = '' Then 
          GUICtrlSetData($Label,$sUpdateName)
          GUICtrlSetFont(-1,16,600,'',$sFontName)
     EndIf

     If Not $sUpdateMessage = '' Then 
          GUICtrlSetData($GuiSplashText,$sUpdateMessage)
          GUICtrlSetFont(-1,14,400,'',$sFontName)
     EndIf
EndFunc

Func _SplashClose()
     GUIDelete($SplashGui)
     SplashOff()
EndFunc

To use this, just to see what it looks like:

MyAppInstall:

#include <SplashScreen.au3>

Local $iApp  = "Adobe Reader 9.3.3"
Local $iPic  = "..\Red.bmp" ;path to the BMP file to use as background

_SplashScreen($iApp,'Now Installing...',$iPic)
;Here is where the installation would take place
;Using sleep just to keep the SplashScreen up to view
Sleep(4000)
;Installation has finished
_SplashUpdate($iApp,'Installation finished')
;This is where I handle any of my cleanup from the install
Sleep(4000)
_SplashClose()
Exit

Anyone have any ideas as to how I could improve this.

Give it a little more of a professional look?

Any input appreciated.

Thanks,


If you try to fail and succeed which have you done?AutoIt Forum Search

Share this post


Link to post
Share on other sites



Include red.bmp please so we can see it.

Share this post


Link to post
Share on other sites

It's basically any BMP file you wish to use.

Here are a couple for example...

VS_BR.bmp

BLB.bmp


If you try to fail and succeed which have you done?AutoIt Forum Search

Share this post


Link to post
Share on other sites

Anyone?

Any suggestions at all?


If you try to fail and succeed which have you done?AutoIt Forum Search

Share this post


Link to post
Share on other sites

Well, I came up with a way to add in a picture to the GUI that's displaying my messages.

Guess that will have to do unless anyone else has any ideas.


If you try to fail and succeed which have you done?AutoIt Forum Search

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
Sign in to follow this  
Followers 0