NeedSomeHelp1 Posted June 15, 2010 Share Posted June 15, 2010 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 More sharing options...
Bert Posted June 15, 2010 Share Posted June 15, 2010 Look at IEAction to perform the click. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
NeedSomeHelp1 Posted June 15, 2010 Author Share Posted June 15, 2010 If I do _IEACTION($oIE, "click") nothing happens. I think it may be because I want to click on the popup window, not the original IE object Link to comment Share on other sites More sharing options...
PsaltyDS Posted June 15, 2010 Share Posted June 15, 2010 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. 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 More sharing options...
Bert Posted June 15, 2010 Share Posted June 15, 2010 I believe he is trying to click on a control in a web page. If that is the case then controlclick won't work. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
PsaltyDS Posted June 15, 2010 Share Posted June 15, 2010 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. 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 More sharing options...
NeedSomeHelp1 Posted June 15, 2010 Author Share Posted June 15, 2010 I got ControlClick("", "", "OK") to work just fine when the computer is unlocked. This does not work when it is locked. Link to comment Share on other sites More sharing options...
PsaltyDS Posted June 15, 2010 Share Posted June 15, 2010 (edited) 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... Edited June 15, 2010 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 More sharing options...
NeedSomeHelp1 Posted June 15, 2010 Author Share Posted June 15, 2010 I didn't know about the AutoIt window info, and thats why I wasn't using it. But after finding the name of the popup window, it worked while the computer is locked. Thanks for all the help. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now