Jump to content
Sign in to follow this  
Derto

problem with textbox GUICtrlCreateInput

Recommended Posts

Derto

Hey.

I got an GUICreateInpute function but when i put something on the textbox i cant get it back.

when i enter the variable by myself with $pw="blabla" it works

then, when i try to get it back from the text bow, it doesnt work, so there is a problem with it but i dont know where :''(

ty

CODE

#include <GUIConstantsEx.au3>

$gogo = 1

GUICreate("Test", 400, 400)

Opt("GUIOnEventMode", 1)

GUICtrlCreateLabel("Password :", 20, 105)

$pwLine = GUICtrlCreateInput("", 107, 105, 273, 20)

$pw = GUICtrlRead($pwLine)

$go = GUICtrlCreateButton("Start", 10, 360, 90)

GUICtrlSetOnEvent ($go, "go")

GUISetState(@SW_SHOW)

do

until $gogo = 0

run("notepad.exe")

sleep(1000)

send($pw & "{enter}")

Func go()

$gogo = 0

EndFunc

Share this post


Link to post
Share on other sites
pete1234

So you want the value to be typed into Notepad?

#include <GUIConstantsEx.au3>

$gogo = 1

GUICreate("Test", 400, 400)
Opt("GUIOnEventMode", 1)

GUICtrlCreateLabel("Password :", 20, 105)
$pwLine = GUICtrlCreateInput("", 107, 105, 273, 20)

$go = GUICtrlCreateButton("Start", 10, 360, 90)
GUICtrlSetOnEvent ($go, "go")

GUISetState(@SW_SHOW)

do
$pw = GUICtrlRead($pwLine)
until $gogo = 0

run("notepad.exe")
sleep(1000)
send($pw & "{enter}")

Func go()
$gogo = 0
EndFunc

You were reading the value before you could enter a value into the input box

Share this post


Link to post
Share on other sites
Cha0sBG

Yeah You Have To Include a Local in the function like so :

Local $PwLine = GuiCtrlRead($pw)oÝ÷ Ø    ÝN§   ©e:ëSâèq©KG+ºÚ"µÍÙ[
    ÌÍÔÓ[H  [È ][ÝÞÑ[I][ÝÊ
Edited by Cha0sBG

Have Questions About GUI (Graphical User Interface) ? Post Them Here :GUI Help And Support ForumHave Questions About General AutoIt ? Post Them Here : General Help And Support ForumNew To AutoIt ? Be Shure To Check Out The FaQ's (Frequently Asked Questions) Or FaQ ¹ There You May Find Great Help That Will Guide You True The Wonderful Programming Language AutoItOthere Good Place To Get Some Knolage Of AutoIt Is The Example Script ForumNotice A Bug ? Please Go And Report it At Bug Report Section And Help The Devolepers Of AutoIt Update And Fix The Programming LanguageWant To Thank The People For This Great Forum And Programming Language ? Then DonateWhen You Found The Answer Your Looking For Please Add [Resolved] To The Thread's Name That Will Show Otheres That You Have Found What Your Looking For And They Whount Have To Enter The Thread.

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  

×