Jump to content
Sign in to follow this  
mrmacadamia

About GuiCreate

Recommended Posts

mrmacadamia

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

Share this post


Link to post
Share on other sites
rliiack

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

Share this post


Link to post
Share on other sites
Zedna

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)

Share this post


Link to post
Share on other sites
mrmacadamia

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?

Share this post


Link to post
Share on other sites
Zedna

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)

Share this post


Link to post
Share on other sites
mrmacadamia

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.

Share this post


Link to post
Share on other sites
mrmacadamia

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! :)

Share this post


Link to post
Share on other sites
mrmacadamia

Use label control and GUICtrlSetData() for updating its text.

Thanks! I've already figure it out.

I just add like this.

$LabelInstall = GUICtrlCreateLabel('0%', $resX , $resY, 500, 30, $SS_CENTER)

GUICtrlSetData($LabelInstall, '30%')

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  

×

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.