Jump to content

About GuiCreate


mrmacadamia
 Share

Recommended Posts

I want to create an installer for my program and I want to create installer like

ATI installer or NVIDIA installer which they create a full maximize background GUI and

the installer progress on top of it.

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GUIConstants.au3>

Global $iStyle = BitOR($WS_CAPTION, $WS_EX_TOPMOST)

Opt('MustDeclareVars', 1)

Example2()

Func Example2()
    Local $gui, $background, $pic, $basti_stay, $msg
    Local $sFile = @mydocuments & "\background.jpg"
    Local $resX = @DesktopWidth
    Local $resY = @DesktopHeight

    $gui = GUICreate("Background", $resX, $resY, -1, -1, $iStyle)
    ; background picture
    $background = GUICtrlCreatePic($sFile, -1, -1, $resX, $resY)
    GUISetState(@SW_SHOW)
    Do
        $msg = GUIGetMsg()

    Until $msg = $GUI_EVENT_CLOSE
EndFunc   ;==>Example2

Above is just the test code and I only managed to create the background GUI but my installer won't begin until I exit the GUI.

All I wanna do is that, when run my installer, a background GUI(like ATI&NVIDIA installer) came up and just a progress bar. And other installation stuff will run behind the background GUI.

thanks

Link to comment
Share on other sites

Like this??

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GUIConstants.au3>

Global $iStyle = BitOR($WS_CAPTION, $WS_EX_TOPMOST)

Opt('MustDeclareVars', 1)

Example2()

Func Example2()
    Local $gui, $ProgressBar, $iProgress, $background, $pic, $basti_stay, $msg
    Local $sFile = @MyDocumentsDir & "\background.jpg"
    Local $resX = @DesktopWidth
    Local $resY = @DesktopHeight


    $gui = GUICreate("Background", $resX, $resY, -1, -1, $iStyle)
    ; background picture
    $background = GUICtrlCreatePic($sFile, -1, -1, $resX, $resY)
    $ProgressBar = GUICtrlCreateProgress(64, 56, 729, 81)

    $iProgress=80 ;Progress Percentage
    GUICtrlSetData($ProgressBar,$iProgress)

    GUISetState(@SW_SHOW)
    Do
        $msg = GUIGetMsg()

    Until $msg = $GUI_EVENT_CLOSE
EndFunc   ;==>Example2

I only add the progress bar.

My Projects:Smart Icons

Link to comment
Share on other sites

Maybe something like this

#include <GUIConstantsEx.au3>#include <WindowsConstants.au3>


#include <GUIConstants.au3>

$iStyle = BitOR($WS_CAPTION, $WS_EX_TOPMOST)
$sFile = @MyDocumentsDir & "\background.jpg"
$resX = @DesktopWidth
$resY = @DesktopHeight

$gui = GUICreate("Background", $resX, $resY, -1, -1, $iStyle)
$background = GUICtrlCreatePic($sFile, -1, -1, $resX, $resY) ; background picture
$ProgressBar = GUICtrlCreateProgress(64, 56, 729, 81)
GUISetState(@SW_SHOW)

RunWait('some path to exe')
GUICtrlSetData($ProgressBar,50)

RunWait('some path to another exe')
GUICtrlSetData($ProgressBar,100)

; end of install
GUIDelete($gui)
Link to comment
Share on other sites

Maybe something like this

#include <GUIConstantsEx.au3>#include <WindowsConstants.au3>


#include <GUIConstants.au3>

$iStyle = BitOR($WS_CAPTION, $WS_EX_TOPMOST)
$sFile = @MyDocumentsDir & "\background.jpg"
$resX = @DesktopWidth
$resY = @DesktopHeight

$gui = GUICreate("Background", $resX, $resY, -1, -1, $iStyle)
$background = GUICtrlCreatePic($sFile, -1, -1, $resX, $resY) ; background picture
$ProgressBar = GUICtrlCreateProgress(64, 56, 729, 81)
GUISetState(@SW_SHOW)

RunWait('some path to exe')
GUICtrlSetData($ProgressBar,50)

RunWait('some path to another exe')
GUICtrlSetData($ProgressBar,100)

; end of install
GUIDelete($gui)

LOL!!

What a big progress bar there you've made for me!

Kind of exactly what I need but even I've set the gui with $WS_EX_TOPMOST,

it's not always on top because there's still program ran on top of it.

Anyway, thanks for the idea though and how can I show percentage progress in the bar?

Link to comment
Share on other sites

LOL!!

What a big progress bar there you've made for me!

Kind of exactly what I need but even I've set the gui with $WS_EX_TOPMOST,

it's not always on top because there's still program ran on top of it.

Try to run your programs using @SW_HIDE in RunWait()

Anyway, thanks for the idea though and how can I show percentage progress in the bar?

Did you look at my code?!?

GUICtrlSetData($ProgressBar,50)
Link to comment
Share on other sites

GUICtrlSetData($ProgressBar,50)

Yes, i've looked the code but it just show the progress bar, not with the text like

"50%, 100%".

Anyway, I haven't try runwait with @SW_HIDE. I'll reply later if it's work.

thanks.

I asked too much. I'll figure it out myself then.

Sorry and thanks! :)

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...