Jump to content
Sign in to follow this  
Kyme

Send() help

Recommended Posts

Kyme

what it's wrong in my script???

i wanna press F1,F2,F3,F4

when i press But1 nothing happen:(

why???

#include <GUIConstants.au3>


$Menu1 = GUICreate("Silkroad Skill Presser", 246, 463, 193, 115)
$Fs = GUICtrlCreateCombo("", 128, 56, 41, 21)
GUICtrlSetData($Fs, "F1|F2|F3|F4")
$But1 = GUICtrlCreateButton("Start", 72, 416, 105, 33)

GUISetState(@SW_SHOW)

$Fsread=GUICtrlRead($Fs)

While 1
     $Msg = GUIGetMsg()
    Switch $Msg
        Case $GUI_EVENT_CLOSE
            Exit
        case $Button1
            WinActivate("Untitled - Notepad")
                Send($Fsread)
    EndSwitch
WEnd

Share this post


Link to post
Share on other sites
Kiti

Try this:

#include <GUIConstants.au3>


$Menu1 = GUICreate("Silkroad Skill Presser", 246, 463, 193, 115)
$Fs = GUICtrlCreateCombo("", 128, 56, 41, 21)
$a = GUICtrlSetData($Fs, "F1|F2|F3|F4")
$Button1 = GUICtrlCreateButton("Start", 72, 416, 105, 33)

GUISetState(@SW_SHOW)

$Fsread=GUICtrlRead($a)

While 1
     $Msg = GUIGetMsg()
    Switch $Msg
        Case $GUI_EVENT_CLOSE
            Exit
        case $Button1
            Run("notepad.exe")
            WinWaitActive("Untitled - Notepad")
                Send($Fsread)
    EndSwitch
WEnd
Edited by Kiti

Share this post


Link to post
Share on other sites
Kyme

Try this:

#include <GUIConstants.au3>


$Menu1 = GUICreate("Silkroad Skill Presser", 246, 463, 193, 115)
$Fs = GUICtrlCreateCombo("", 128, 56, 41, 21)
$a = GUICtrlSetData($Fs, "F1|F2|F3|F4")
$Button1 = GUICtrlCreateButton("Start", 72, 416, 105, 33)

GUISetState(@SW_SHOW)

$Fsread=GUICtrlRead($a)

While 1
     $Msg = GUIGetMsg()
    Switch $Msg
        Case $GUI_EVENT_CLOSE
            Exit
        case $Button1
            Run("notepad.exe")
            WinWaitActive("Untitled - Notepad")
                Send($Fsread)
    EndSwitch
WEnd
now send me "0"

how i can make it to send {F1}???

like Send("{F1}")

tnx

Edited by Kyme

Share this post


Link to post
Share on other sites
BugFix

#include <GUIConstants.au3>

$Menu1 = GUICreate("Silkroad Skill Presser", 246, 463, 193, 115)
$Fs = GUICtrlCreateCombo("", 128, 56, 41, 21)
GUICtrlSetData($Fs, "F1|F2|F3|F4")
$Button1 = GUICtrlCreateButton("Start", 72, 416, 105, 33)

GUISetState(@SW_SHOW)

While 1
     $Msg = GUIGetMsg()
    Switch $Msg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            Run("notepad.exe")
            WinWaitActive("Untitled - Notepad")
            Send("{" & GUICtrlRead($Fs) & "}") ; sends the Fn-key, not Char "F" & Number "n"
    EndSwitch
WEnd


Best Regards BugFix  

Share this post


Link to post
Share on other sites
Kyme

#include <GUIConstants.au3>

$Menu1 = GUICreate("Silkroad Skill Presser", 246, 463, 193, 115)
$Fs = GUICtrlCreateCombo("", 128, 56, 41, 21)
GUICtrlSetData($Fs, "F1|F2|F3|F4")
$Button1 = GUICtrlCreateButton("Start", 72, 416, 105, 33)

GUISetState(@SW_SHOW)

While 1
     $Msg = GUIGetMsg()
    Switch $Msg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            Run("notepad.exe")
            WinWaitActive("Untitled - Notepad")
            Send("{" & GUICtrlRead($Fs) & "}") ; sends the Fn-key, not Char "F" & Number "n"
    EndSwitch
WEnd
awesome....tnx alot....

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.