Jump to content

Send() help


Recommended Posts

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

#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  

Link to comment
Share on other sites

#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....
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...