Jump to content

SendMessage()


Recommended Posts

Hi - I'm am having some trouble working around an authentication popup. I am opening a website and a popup comes up where the username and password are saved, and all I need to do is hit Enter or the OK button. I can easily do this with a send() when the computer is unlocked, but I need for this script to run while the computer is locked. I have done some searching and seen that the windows sendmessage() may work when the computer is locked. Can anyone show me how to do this or have any other ideas? The code below is my script except I changed the website to something more general and the ControlClick line is the last thing I have tried to do to get past this popup. Thanks!

#include <IE.au3>

BlockInput(1)

$oIE = _IECreate ("www.yahoo.com",0,1,0,1 )

Sleep(500)

ControlClick("Microsoft Internet Explorer",'', "OK")

_IELoadWait ($oIE)

$IE.execWB(6,2)

_IEQUIT($oIE)

BlockInput(0)

Link to comment
Share on other sites

ControlClick() is correct, but "OK" is not a valid control ID. If OK is the default button then just specifying the window ID and leaving the control ID blank should work: ControlClick("YourTitleHere", "", "")

Examine the popup with AU3Info for better info on the window and the control to make it more specific/reliable.

: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
Link to comment
Share on other sites

OP says it's a popup from the web page, which is often an ordinary Windows dialog box with regular Windows API controls.

It could also be an IE dialog box, which requires _IEAttach() with "DialogBox" to get the document object for use with other _IE* functions.

AU3Info would verify one way or the other.

: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
Link to comment
Share on other sites

That's because a window title of "" is equivalent to "[ACTIVE]", and while the console is locked no window can be active. The invalid control ID was ignored.

Fill in the window specification with a proper value to ID the window and either leave the control ID empty or get a valid one.

I still don't hear you saying you check it out with AU3Info.exe...

:mellow:

Edited by PsaltyDS
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
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...