hirntot Posted October 17, 2005 Share Posted October 17, 2005 HotKeySet ("!s" , "sendok") Func sendok() $ok = $msg EndFunc $ok = GUICtrlCreatebutton ("Send",312,10,183,20) Do $msg = GUIGetMsg() if $msg = $ok then _FileCreate ("C:\WINDOWS\Temp\send.bat") endif Until $msg = $GUI_EVENT_CLOSE I want to run the Do part if you press the Hotkey, i'ver tried it several ways but everytime it fails or runs the script twice or something else . But it works with the Control. Link to comment Share on other sites More sharing options...
Valuater Posted October 17, 2005 Share Posted October 17, 2005 how about this HotKeySet ("!s" , "sendok") Func sendok() _FileCreate ("C:\WINDOWS\Temp\send.bat") EndFunc $ok = GUICtrlCreatebutton ("Send",312,10,183,20) Do $msg = GUIGetMsg() if $msg = $ok then sendok() endif Until $msg = $GUI_EVENT_CLOSE i did not test your code 8) Link to comment Share on other sites More sharing options...
seandisanti Posted October 17, 2005 Share Posted October 17, 2005 (edited) HotKeySet ("!s" , "sendok") Func sendok() $ok = $msg EndFunc $ok = GUICtrlCreatebutton ("Send",312,10,183,20) Do $msg = GUIGetMsg() if $msg = $ok then _FileCreate ("C:\WINDOWS\Temp\send.bat") endif Until $msg = $GUI_EVENT_CLOSEI want to run the Do part if you press the Hotkey, i'ver tried it several ways but everytime it fails or runs the script twice or something else .But it works with the Control.looks like you just have a simple scope problem. have you tried:Global $ok Func sendok() $ok = $msg EndFunc $ok = GUICtrlCreatebutton ("Send",312,10,183,20) Do $msg = GUIGetMsg() if $msg = $ok then _FileCreate ("C:\WINDOWS\Temp\send.bat") endif Until $msg = $GUI_EVENT_CLOSE***edit*** forgot my Edited October 17, 2005 by cameronsdad Link to comment Share on other sites More sharing options...
hirntot Posted October 17, 2005 Author Share Posted October 17, 2005 (edited) how about thisHotKeySet ("!s" , "sendok") Func sendok() _FileCreate ("C:\WINDOWS\Temp\send.bat") EndFunc $ok = GUICtrlCreatebutton ("Send",312,10,183,20) Do $msg = GUIGetMsg() if $msg = $ok then sendok() endif Until $msg = $GUI_EVENT_CLOSEi did not test your code8)works perfect, thx.I think my code was rubish @cameronsdad:I've already used Valuaters code before you wrote this and my old Code seems not to work correctly even if i add Global.@admins: Thread can be closed Edited October 17, 2005 by hirntot 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