| || |
How to prevent Windows from locking
The PC I am using has global policies, therefore it's not possible to turn Windows locking off for my machine.
This is a problem, because QTP needs to have the desktop exposed in order to work with my application. The application has the ReplayType set to 2 (use mouse events and not browser events), so locking will cause the mouse to click somewhere other than the AUT after it is locked. I also saw this solution, but it is not feasible since security will not let us run if we cannot see the code. So, I looked up the Windows API and found a function called SetThreadExecutionState in Kernel32.dll.
I got this far, but it is still locking:
For i=1 to 100
print i & " " & time
returnValue = Extern.Declare (micLong, "SetThreadExecutionState", "kernel32.dll", "SetThreadExecutionState", micULong)
print i & " " & returnValue
Any ideas on how to use that function properly? Or maybe an alternate way to avoid Windows from locking?
Re: How to prevent Windows from locking
Sorry, I did not see the below post for the solutions. I believe I can overcome it now...