Jump to content
Sign in to follow this  
The_Noob

returning weird values?

Recommended Posts

The_Noob

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

Share this post


Link to post
Share on other sites
Thatsgreat2345

take a look at GuiCtrlRead()

Share this post


Link to post
Share on other sites
Helge

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

Share this post


Link to post
Share on other sites
MHz

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.

Share this post


Link to post
Share on other sites
The_Noob

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:

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.