Sign in to follow this  
Followers 0
vatobeto

Non-functional GUI Ctrl Buttons

4 posts in this topic

I've looked around for help on this, but to no avail. (maybe I looked in the wrong places, doh.) In the following code from an installer, the pushbuttons won't function. I'm not real great at the GUI stuff yet. If anyone has a moment?

CODE
#RequireAdmin

#include <Array.au3>

#include <GUIConstants.au3>

$Office2007RegKey = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\12.0\Common\ProductVersion"

$Office2007RegValue = "LastProduct"

$var = RegRead($Office2007RegKey,$Office2007RegValue)

If $var <> "" Then

$theGUI = GUICreate("Already Installed",350,320,-1,-1)

$background = GUICtrlCreatePic ("Install or Remove.jpg",0,0,350,320)

$cancelButton = GUICtrlCreateButton("Cancel",10,260,150,30)

$removeButton = GUICtrlCreateButton("Remove",190,260,150,30)

GUISetState()

While 1

$msg = GUIGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE

MsgBox(0,"Leaving","Bye")

ExitLoop

Case $msg = $cancelButton

MsgBox(0,"Leaving","Bye")

ExitLoop

Case $msg = $removeButton

MsgBox(0,"Leaving","Bye")

ExitLoop

EndSelect

WEnd

GUIDelete($theGUI)

EndIf

Exit

THX, vatobeto.

Share this post


Link to post
Share on other sites



I haven't tried this but try adding a GUICtrlSetState(-1, $GUI_DISABLE) after your background pic.

Wow, worked perfectly. I wasn't familiar with that function, obviously. Great job. Now I have time to bandage my bloody forehead from the headbanging against the wall.

Share this post


Link to post
Share on other sites

Wow, worked perfectly. I wasn't familiar with that function, obviously. Great job. Now I have time to bandage my bloody forehead from the headbanging against the wall.

:P That's a mistake it took me for a while to figure out too, but that was forever ago, or so it seems.

My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]

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