@sabarirajanm we solved this problem by using an action which uses a code stage to call a function defined in a global code segment.
This segment uses this code snippet:
public static class LockscreenManager {
private enum EXECUTION_STATE: uint {
ES_SYSTEM_REQUIRED = 0x00000001,
ES_DISPLAY_REQUIRED = 0x00000002,
ES_CONTINUOUS = 0x80000000
}
[DllImport("kernel32.dll")]
static extern EXECUTION_STATE SetThreadExecutionState(EXECUTION_STATE flags);
public static void PreventLockscreen() {
SetThreadExecutionState(EXECUTION_STATE.ES_SYSTEM_REQUIRED | EXECUTION_STATE.ES_DISPLAY_REQUIRED | EXECUTION_STATE.ES_CONTINUOUS);
}
}
Don't forget to load "System.Runtime.InteropServices.dll" and import the namespace "System.Runtime.InteropServices" in Code Options.
To prevent the lockscreen you have to call the action constantly in long running loops.