Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

Send key/command when windows is lock


  • Please log in to reply
2 replies to this topic

#1 x001z

x001z

    Seeker

  • Active Members
  • 22 posts

Posted 28 January 2011 - 10:39 PM

Hi All!!

Well here is my problem. I'm trying to download a file from the IE8, but this file is generated by a java script, so there is no a direct link to the file(can't use inetget). Using the <IE.au3> click the "export" button that generated the file and then appear the "File Download" window to save the file, what I'm trying to do is to click the "save" button when the computer is locked,

So far I'm been playing with ControlFocus, ControlSend, ControlClick, that works when the windows is active but not when the computer is locked, or the window is not active.


AutoIt         
#include <IE.au3> _IELoadWait($oIE) _IELoadWait($oFrameF3) _IELoadWait($oForm) $oIE = _IEAttach("***") _IELoadWait($oIE) $oFrameF3 = _IEFrameGetObjByName($oIE, "f3") $oForm = _IEFormGetObjByName($oFrameF3,"statusForm") $oTableF3 = _IETableGetCollection($oForm,1) $oBtnExport = _IEGetObjByName ($oTableF3, "button_text_export") _IEAction($oBtnExport,"focus") $oBtnExport.click WinWait("File Download") ;~ ControlFocus("File Download","","[CLASS:Button; INSTANCE:2]") ;~ ControlSend("File Download","","[CLASS:Button; INSTANCE:2]","{space}") ;~ ControlFocus("File Download","","[CLASS:Button; INSTANCE:2]") ;~ ControlSend("File Download","","[CLASS:Button; INSTANCE:2]","{Enter}") ;~ ControlFocus("File Download","","Button2") ;~ ControlSend("File Download","","Button2","{Enter}") ;~ ControlClick("File Download","","[CLASS:Button; INSTANCE:2]") ;~ ControlClick("File Download","","Button2") ;~ ControlSend("File Download","","[CLASS:Button; INSTANCE:2]","{LEFT}") ;~ ControlSend("File Download","","[CLASS:Button; INSTANCE:2]","{SPACE}")


The commented lines are the lines I'm have been playing with but none of that works.

Is there any way to send a key/command when WindowsXP is lock??.

Thanks in Advance!!







#2 Zedna

Zedna

    AutoIt rulez!

  • MVPs
  • 8,786 posts

Posted 30 January 2011 - 08:12 PM

There is FAQ about scripts & locked stations
http://www.autoitscript.com/wiki/FAQ#Why...y_script_work_on_a_locked_work

But I see no logical mistake in your script so that's strange it's not working.

This should work

ControlFocus("File Download","","Button2")
ControlClick("File Download","","Button2")


Note: In fact ControlFocus has no meaning here because it can't have focus on locked station

Edited by Zedna, 30 January 2011 - 08:14 PM.


#3 x001z

x001z

    Seeker

  • Active Members
  • 22 posts

Posted 31 January 2011 - 10:30 PM

There is FAQ about scripts & locked stations
http://www.autoitscript.com/wiki/FAQ#Why...y_script_work_on_a_locked_work

But I see no logical mistake in your script so that's strange it's not working.

This should work


Note: In fact ControlFocus has no meaning here because it can't have focus on locked station


Thanks for the reply, I've read that FAQ before, that's way I use the "Control...", but the response it's really appreciated, the weird thing it's that is working on other windows, but not in this particularly.

If you come up with something else, it will be nice to hear about it.

Thanks for the Help.

PS
Sorry about my bad English, I'm doing my best. jeje. :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users