thewingrider Posted January 22, 2008 Share Posted January 22, 2008 Hi, I have written a small script,converted to exe. The idea of the script is to check for a window and click the button on the window. But it does NOT click the button when Windows is Locked. It works fine when Windows is NOT locked. Thanks in advance for the help. Regards, NHKR Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 22, 2008 Share Posted January 22, 2008 Hi,I have written a small script,converted to exe. The idea of the script is to check for a window and click the button on the window. But it does NOT click the button when Windows is Locked. It works fine when Windows is NOT locked.Thanks in advance for the help. Regards,NHKRLocked? What "locks" the window? 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...
thewingrider Posted January 22, 2008 Author Share Posted January 22, 2008 Locked? What "locks" the window? Sorry, i forgot to add the code::While 1 = 1 WinWaitActive(" Client") Send("{ENTER}")WEndLocking happens when u lock the Windows Screen by Pressing the "Windows Key" on ur Keyboard and "L" simultaneously (without quotes) For more information on locking please see LockingRegards,NHKR Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 22, 2008 Share Posted January 22, 2008 (edited) Sorry, i forgot to add the code::While 1 = 1 WinWaitActive(" Client") Send("{ENTER}")WEndLocking happens when u lock the Windows Screen by Pressing the "Windows Key" on ur Keyboard and "L" simultaneously (without quotes) For more information on locking please see LockingRegards,NHKRI misread that as "a window" being locked, vice "Windows".While the console is locked, there are no windows available to AutoIt. If your script makes no window references (like WinWaitActive) then it will continue to run, but any calls to Win* functions, or attempt to access desktop graphical interfaces (i.e. Pixel* fucntions) will hang until the console is unlocked. P.S. Correction from MHz below: The windows exist, but cannot become ACTIVE, so ControlSend() and some things that can operate on a window that is not active might work. Your WinWaitActive() however will never work while the console is locked. Edited January 22, 2008 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...
thewingrider Posted January 22, 2008 Author Share Posted January 22, 2008 I misread that as "a window" being locked, vice "Windows".While the console is locked, there are no windows available to AutoIt. If your script makes no window references (like WinWaitActive) then it will continue to run, but any calls to Win* functions, or attempt to access desktop graphical interfaces (i.e. Pixel* fucntions) will hang until the console is unlocked. Thank you for the reply!!!Is there any solution or workaround other than UNLOCKING Microsoft WindowsRegards,NHKR Link to comment Share on other sites More sharing options...
erezlevi Posted January 22, 2008 Share Posted January 22, 2008 Thank you for the reply!!!Is there any solution or workaround other than UNLOCKING Microsoft WindowsRegards,NHKRI am sorry to tell you but there isn't. Link to comment Share on other sites More sharing options...
MHz Posted January 22, 2008 Share Posted January 22, 2008 ... Locking happens when u lock the Windows Screen by Pressing the "Windows Key" on ur Keyboard and "L" simultaneously (without quotes) ...The locked screen remains the active window so you need to use Win* functions and Control* functions that do not require an active window to work with. This example works with a locked Windows session. Send('#l') ; Start the locked screen Sleep(3000) Run('notepad.exe') WinWait('Untitled') ControlSend('Untitled', '', 'Edit1', 'sample text sent to an inactive window{ENTER}') MsgBox(0x40030, '', 'Script Finished') ; Unlock the screen manually now to see the result. replaygeorge 1 Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 22, 2008 Share Posted January 22, 2008 Test script to PROVE that MHz was right and I was wrong... (not that anybody doubted that): HotKeySet("{ESC}", "_Quit") $PID = Run("notepad.exe") WinWait("Untitled - Notepad") $hWin = WinGetHandle("Untitled - Notepad") WinSetState($hWin, "", @SW_MINIMIZE) SplashTextOn("AutoIt Locked Console Test", "You may lock the console to test operations...", 500, 100, @DesktopWidth - 600, 100) While 1 ControlSend($hWin, "", "Edit1", "Time = " & @HOUR & ":" & @MIN & ":" & @SEC & @CRLF) Sleep(1000) WEnd Func _Quit() SplashOff() WinSetState($hWin, "", @SW_RESTORE) Exit EndFunc Live and learn... 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...
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