Jump to content
Sign in to follow this  
Bam

Login with out clicking login

Recommended Posts

Bam

what i want to do is have an edit box and 2 buttons (later im going to add another edit box) and after typing in ur username into the edit box i like being able to hit enter instead of clicking login cause its faster :( so is thier any way to type in like a user name in an edit box and then press enter with out having to go up and click login? i found ways to do it with out an edit box but i will need 2 edit boxs later on. if u want i can post the code kinda my first real script with auto it so its kinda messy :mellow:

Share this post


Link to post
Share on other sites
Bert

Could you tab from the text box to the button? Take a look at this example. You can tab from one control to the next. It would be simply a keystroke.

#include <GUIConstants.au3>

$Form1 = GUICreate("test", 364, 212, 192, 125)
$Input1 = GUICtrlCreateInput("", 64, 24, 225, 21, -1, $WS_EX_CLIENTEDGE)
GUICtrlSetTip(-1, "Enter name here")
$Input2 = GUICtrlCreateInput("", 64, 64, 225, 21, $ES_PASSWORD, $WS_EX_CLIENTEDGE)
GUICtrlSetTip(-1, "Password")
$Button1 = GUICtrlCreateButton("Ok", 64, 120, 81, 25)
$Button2 = GUICtrlCreateButton("Cancel", 184, 120, 105, 25)
GUISetState(@SW_SHOW)
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE or $msg = $Button2
        ExitLoop
    Case $msg = $Button1
        $name = GUICtrlRead($Input1)
        $Pass = GUICtrlRead($Input2)
        MsgBox(0, "OK Pressed", "You pressed OK" & @CRLF _
                               &""& @CRLF _
                               &"Name:       "&$name& @CRLF _
                               &"Password: "&$pass)
        Exit
    Case Else
        ;;;;;;;
    EndSelect
WEnd
Exit

Share this post


Link to post
Share on other sites
Bam

i got this error when i tried to run it.

(4) : ==> Variable used without being declared.:

$Input1 = GUICtrlCreateInput("", 64, 24, 225, 21, -1, $WS_EX_CLIENTEDGE)

$Input1 = GUICtrlCreateInput("", 64, 24, 225, 21, -1, ^ ERROR

with the script i have right now i can tab to the login button but i was trying to find an easier way sense ill probly be using it alot.

Share this post


Link to post
Share on other sites
PsaltyDS

i got this error when i tried to run it.

(4) : ==> Variable used without being declared.:

$Input1 = GUICtrlCreateInput("", 64, 24, 225, 21, -1, $WS_EX_CLIENTEDGE)

$Input1 = GUICtrlCreateInput("", 64, 24, 225, 21, -1, ^ ERROR

Add this to the top of your script:
#include <WindowsConstants.au3>

:mellow:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
Bam

ty PsaltyDS

but now i get this :mellow:

and how do u know what things to #include?

(7) : ==> Variable used without being declared.:

$Input2 = GUICtrlCreateInput("", 64, 64, 225, 21, $ES_PASSWORD, $WS_EX_CLIENTEDGE)

$Input2 = GUICtrlCreateInput("", 64, 64, 225, 21, ^ ERROR

Share this post


Link to post
Share on other sites
rasim

Bam

Use a search in the c:\Program Files\AutoIt3\Include\ folder :mellow:

Posted ImagePosted Image

Share this post


Link to post
Share on other sites
Bam

@Volly

ya thats almost like the script i have now and i just dont like having to hit the tab key a second time :mellow:

Share this post


Link to post
Share on other sites
PsaltyDS

ty PsaltyDS

but now i get this :mellow:

and how do u know what things to #include?

(7) : ==> Variable used without being declared.:

$Input2 = GUICtrlCreateInput("", 64, 64, 225, 21, $ES_PASSWORD, $WS_EX_CLIENTEDGE)

$Input2 = GUICtrlCreateInput("", 64, 64, 225, 21, ^ ERROR

You are using the style with GuiCtrlCreateInput(), so go to that function in the help file and click on the link in the description there for the Styles in the appendix. At the top of every section of style and extended parameters in the appendix is the include file that contains them.

:(


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
Bam

i dont see a style that will, when i press enter act like i just click login

edit*

like when u go into notepad (on xp) and u click save as, u have a box where u tpye the file name and if u press enter it clicks save for you. thats what i wana do

Edited by Bam

Share this post


Link to post
Share on other sites
PsaltyDS

i dont see a style that will, when i press enter act like i just click login

edit*

like when u go into notepad (on xp) and u click save as, u have a box where u tpye the file name and if u press enter it clicks save for you. thats what i wana do

Enter triggers the button that has $BS_DEFPUSHBUTTON style on it (from #include <ButtonConstants.au3>, by the way) as though you clicked on it.

:mellow:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
Bam

@PsaltyDS

TY ! :mellow:

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  

×