Jump to content

Running a func?


Recommended Posts

I need to make it so my script will run a function similiar to HotKeySet but when a gui button is pressed (eg Case $go)? How do i do this. If there is no way is there anything bad/foolish about making case $go just press a HotKeySet button?

Wait lol, do i do it/could i do it with AdLibEnable?

Edited by xxbrentonxx
Link to comment
Share on other sites

if I understood you correctly, you are looking for something like this:

#include<GuiConstants.au3>

guicreate("some gui...", 80, 100)

$go = GUICtrlCreateButton("GO!", 3, 3)
GUISetState()

While 1
    $msg = GUIGetMsg()
    
    Select
        Case $msg = $GUI_EVENT_CLOSE
            Exit
        Case $msg = $go
            _MyOwnFunc()
    EndSelect
    Sleep(10)
WEnd

Func _MyOwnFunc()
    MsgBox(0, "message:", "you pressed the GO!-button")
    
    ;Do whatever you want to do down here
    ;.
    ;.  
EndFunc

Cheers,

tannerli

Link to comment
Share on other sites

if I understood you correctly, you are looking for something like this:

#include<GuiConstants.au3>

guicreate("some gui...", 80, 100)

$go = GUICtrlCreateButton("GO!", 3, 3)
GUISetState()

While 1
    $msg = GUIGetMsg()
    
    Select
        Case $msg = $GUI_EVENT_CLOSE
            Exit
        Case $msg = $go
            _MyOwnFunc()
    EndSelect
    Sleep(10)
WEnd

Func _MyOwnFunc()
    MsgBox(0, "message:", "you pressed the GO!-button")
    
    ;Do whatever you want to do down here
    ;.
    ;.  
EndFunc

Cheers,

tannerli

Ahh i see thanks, i played around a bit and got it working.
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...