Programmatically moving the mouse when the computer is locked

I have a program that controls the presence of the user, controlling the movement of the mouse. I need to make this program think that the user is always present. Programming mouse movements every once in a while is very simple. However, I cannot do this job when the computer is locked.

I work in Windows XP and do not need a solution to support Vista or 7.

+4
source share
1 answer

I had a similar problem. Simulating a mouse click instead worked for me ... just get your screen position and keep clicking on it.

private const UInt32 MOUSEEVENTF_LEFTDOWN = 0x0002; [DllImport("user32.dll")] private static extern void mouse_event(uint dwFlags, uint dx, uint dy, uint dwData, uint dwExtraInf); // tap on a timer somewhere inside the app region mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0); 
0
source

Source: https://habr.com/ru/post/1342490/


All Articles