Jump to content

Send key/command when windows is lock


x001z
 Share

Recommended Posts

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.

#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!!

Link to comment
Share on other sites

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

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. :)

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...