On computers there is an obligatory screen lock, and I have heavy miscalculations on them, and so it’s rather difficult to get them out of the splash screen mode and log in. load of 100%. Bypassing the system I tried using the python to move the mouse once every 100 seconds, the mouse then moves, but the screen lock still works.

Is it possible to circumvent and deceive Locke?

import time import ctypes class POINT(ctypes.Structure): _fields_ = [("x", ctypes.c_ulong), ("y", ctypes.c_ulong)] def click(): def queryMousePosition_X(): pt = POINT() ctypes.windll.user32.GetCursorPos(ctypes.byref(pt)) return pt.x def queryMousePosition_Y(): pt = POINT() ctypes.windll.user32.GetCursorPos(ctypes.byref(pt)) return pt.y x = (queryMousePosition_X()- 50) y = (queryMousePosition_Y() - 50) ctypes.windll.user32.SetCursorPos(x, y) def check_time(): while True: click() time.sleep(100) check_time() 
  • Are you asking how to turn off the screensaver on your version of Windows? - jfs
  • I can’t turn it off, the point is, I try to deceive him - Oleksii
  • I did not know that you can not turn off the screen saver on Windows. And how do you watch a movie then? - jfs
  • This is me to the fact that I do not believe that on one of the main systems it is impossible to watch videos without twisting the mouse. - jfs
  • there are different protection systems, it will break and this does not happen, it’s not built-in functionality, the bottom line is that you need to tell the Windows that the mouse is moved not by the python script, but by the person :) - Oleksii

1 answer 1

Set settlement processes a lower priority - then they will not interfere with the normal operation of system processes.

Here is a way to lower the priority of the current process on Python:

Change process priority in Python, cross-platform

  • Explain, please, how lowering the process priority will prevent the system from blocking the workstation (win + L) when the user is inactive? - gil9red
  • The @ gil9red problem of the author is not in the blocking itself - but in the fact that the running process does not allow it to be unlocked back. A process with a lower priority will not interfere with system processes - and therefore there is no longer any need to bypass the lock. - Pavel Mayorov
  • This is true, but the question was still in the other “Is it possible to get around this and deceive Locke?” :) - gil9red
  • lowering priority is not a problem, the situation is such that all computers (clients) that fall into an idle state sooner or later fall off the server, the problem is still not solved, but as I was told by other experts, a lower level language is needed, C for example - Oleksii
  • since in the case of Python it will not be possible to imitate a command from the controller. - Oleksii