Sign in to follow this  
Followers 0
hirntot

HotKeySet Problem

4 posts in this topic

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.

Share this post


Link to post
Share on other sites



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)


NEWHeader1.png

Share this post


Link to post
Share on other sites

#3 ·  Posted (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_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.

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 by cameronsdad

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

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)

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 by hirntot

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