Sign in to follow this  
Followers 0
AndreasVliegen

Check If Cursor Is In Inputbox

6 posts in this topic

#1 ·  Posted (edited)

Hello people,

I created this program that sends an Username and a Password from an INI-file to a Webpage

$user = IniRead($installdir & "\Files\Inloggen.ini","Account","User","")
    $pass = IniRead($installdir & "\Files\Inloggen.ini","Account","Pass","")
    
    $browser = RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\IEXPLORE.EXE", "")
    
    Run('"' & $browser & '"' & "http://teletop.bc-enschede.nl/02start.nsf?Login&lan=NL&RedirectTo=/02start.nsf")

    WinWaitActive("TeleTOP Login -")
    Send($user)
    Send("{TAB}")
    Send($pass)
    Send("{ENTER}")

Sort of an automatic login script, but sometimes the $user and the $pass are typed into the URL bar, so how can I check if the cursor is at the input box on the website?

Part of HTML code of the web page:

<input name="UsernameInput" value="" class="inp" maxlength=256>
<input name="Username" value="" type=hidden></td>        
<input name="Password" value="" type="password" class="inp" maxlength=256>

Cheers,

SteeloXP

Edited by AndreasVliegen

Share this post


Link to post
Share on other sites



Hello people,

I created this program that sends an Username and a Password from an INI-file to a Webpage

$user = IniRead($installdir & "\Files\Inloggen.ini","Account","User","")
    $pass = IniRead($installdir & "\Files\Inloggen.ini","Account","Pass","")
    
    $browser = RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\IEXPLORE.EXE", "")
    
    Run('"' & $browser & '"' & "http://teletop.bc-enschede.nl/02start.nsf?Login&lan=NL&RedirectTo=/02start.nsf")

    WinWaitActive("TeleTOP Login -")
    Send($user)
    Send("{TAB}")
    Send($pass)
    Send("{ENTER}")

Sort of an automatic login script, but sometimes the $user and the $pass are typed into the URL bar, so how can I check if the cursor is at the input box on the website?

Part of HTML code of the web page:

<input name="UsernameInput" value="" class="inp" maxlength=256>
<input name="Username" value="" type=hidden></td>        
<input name="Password" value="" type="password" class="inp" maxlength=256> 
<input name="RedirectTo" value="/02start.nsf" type=hidden></td>

Cheers,

SteeloXP

if you're using internet explorer, you should check out dale's IE.au3 it will allow you to set the text for the form elements exactly where they should go, just like using a controlsettext with a non browser window.

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

Sounds like the login window might be losing focus for some reason... try this:

WinWait("TeleTOP Login -")
Sleep(500)
WinActivate("TeleTOP Login -")
Send($user)
Send("{TAB}")
Send($pass)
Send("{ENTER}")

The sleep statement might not be necessary - I just added it there to give a buffer between the window appearing and beginning to input to it. You could instead use Opt("WinWaitDelay", 500) if you like this method better.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

if you're using internet explorer, you should check out dale's IE.au3 it will allow you to set the text for the form elements exactly where they should go, just like using a controlsettext with a non browser window.

Thanks, I think I found this *huge* script / program :)

http://www.autoitscript.com/forum/index.ph...13398&hl=IE.au3

I'm checking which function I need to use :mellow:

If I don't understand, I'll reply here

Thanks and cheers,

SteeloXP

Edited by AndreasVliegen

Share this post


Link to post
Share on other sites

It all works fine! :):o:mellow:

Thanks again! :)

Share this post


Link to post
Share on other sites

It all works fine! :):o:mellow:

Thanks again! :)

glad you figured it out. we're always happy to help.

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

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  
Followers 0