Sign in to follow this  
Followers 0
Kickassjoe

Sending "Clicked" message to GUI?

3 posts in this topic

is there a way that I could make the GUI think that a button is clicked, when another button is pressed using GUISetOnEvent mode? (I know i could just make it go to the same function, or use a hotkeyset / send combination, but is there any function that does it automagically?)

Opt("GuiOnEventMode", 1)

GUICreate("Test")

Global $B1 = GUICtrlCreateButton("Exit!", 10, 10)
GUICtrlSetOnEvent($B1, "transferclick")

Global $B2 = GUICtrlCreateButton("NOW!", 10, 40)
GUICtrlSetOnEvent($B2, "exitnow")

GUISetOnEvent(-3, "exitnow")
GUISetState()

While 1
    
    Sleep(100000)
    
WEnd

Func transferclick()
;@GUI_CtrlId = $B2; doesn't work :(
EndFunc

Func exitnow()
    Exit
EndFunc

What goes around comes around... Payback's a bitch.

Share this post


Link to post
Share on other sites



Hi,

Opt("GuiOnEventMode", 1)

GUICreate("Test")

$B1 = GUICtrlCreateButton("Exit!", 10, 10)
GUICtrlSetOnEvent(-1, "Event")
$B2 = GUICtrlCreateButton("NOW!", 10, 40)
GUICtrlSetOnEvent(-1, "Event")

GUISetOnEvent(-3, "Event")
GUISetState()

While 1
    Sleep(100)
WEnd

Func Event()
    $msg = @GUI_CtrlId
    Switch $msg
        Case $B1, $B2, -3
            Exit
        Case Else
            ;;;
    EndSwitch
EndFunc

Cheers

Share this post


Link to post
Share on other sites

Hmm... Not what I was looking for, but I think I discovered what I need to do, thanks.


What goes around comes around... Payback's a bitch.

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