Jump to content

returning weird values?


 Share

Recommended Posts

#include <GUIConstants.au3>
Global $Paused = 0
$Input1 = ""
$Input2 = ""


Opt("sendkeydelay", 0)     ;1=absolute, 0=relative, 2=client

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("AForm1", 234, 98, 193, 115)
$Input1 = GUICtrlCreateInput("", 8, 8, 49, 21)
$Input2 = GUICtrlCreateInput("", 64, 8, 49, 21)
$Button1 = GUICtrlCreateButton("AButton1", 120, 8, 49, 25, 0)
$Button2 = GUICtrlCreateButton("AButton2", 176, 8, 49, 25, 0)
$Input3 = GUICtrlCreateInput("AInput3", 184, 40, 41, 21)
$Input4 = GUICtrlCreateInput("AInput4", 184, 64, 41, 21)
$Label1 = GUICtrlCreateLabel("SendKeyDelay-------------------------------", 8, 40, 167, 17)
$Label2 = GUICtrlCreateLabel("SendKeyDownDelay----------------------", 8, 64, 168, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###


While 1
    $nMsg = GUIGetMsg()
    opt("SendKeyDelay", $input3)
    opt("SendKeyDownDelay", $input4)
    tooltip($input1 & " " & $input2)
    if $nMsg = $GUI_EVENT_CLOSE then
        Exit
    EndIf
    if $nMsg = $Button1 Then
        Do
            $nMsg = GUIGetMsg()
            send($input1)
            send($input2)
        until $nMsg = $Button2
    EndIf

WEnd

If you run this, you notice it returns 3 and 4 for $input1 and $input2... why? what did i forget?

Link to comment
Share on other sites

Look in the helpfile for what's mentioned under "Return value" on the GUICtrlCreateInput-page.

There it says that what's return is something called controlID (and not the control's value), which

you can use when you need to work with the control.

$input = GUICtrlCreateInput("text", 10, 10, 200, 20); $input equals input's controlID

$value = GUICtrlRead($input) ; read the control and write it to the $value-variable
GUICtrlSetColor($input, 0xFF0000) ; changes the input's font-color to red
Edited by Helge
Link to comment
Share on other sites

Opt("sendkeydelay", 0)    ;1=absolute, 0=relative, 2=client
Hmm...that comment does not reflect with the Opt() ;)

It is not derived by Scite abbreviations.

;~ Opt('SendKeyDelay', 5)               ; ? = 5 milliseconds by default.
Link to comment
Share on other sites

Hmm...that comment does not reflect with the Opt() ;)

It is not derived by Scite abbreviations.

;~ Opt('SendKeyDelay', 5)               ; ? = 5 milliseconds by default.

lol ya im a copy/paster. i had copied a winmove or somthing of the like, and that comment was on it. I leave comments for myself, and quite often they dont make sense to anyone but me. Either way, it doesnt effect the workings of the script.

thanks Thatsgreat2345 that helped me figure it out :lmao:

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