xxbrentonxx Posted March 25, 2009 Share Posted March 25, 2009 (edited) 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 March 25, 2009 by xxbrentonxx Link to comment Share on other sites More sharing options...
jvanegmond Posted March 25, 2009 Share Posted March 25, 2009 Search in help file GUIOnEventMode github.com/jvanegmond Link to comment Share on other sites More sharing options...
tannerli Posted March 25, 2009 Share Posted March 25, 2009 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 More sharing options...
xxbrentonxx Posted March 25, 2009 Author Share Posted March 25, 2009 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, tannerliAhh i see thanks, i played around a bit and got it working. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now