Preventing your system from getting auto locked
Within most of the organization, there is a default setting that after a few minutes have escaped, the system gets locked itself, if system is left unattended. Well to prevent this i have written a small utility (windows application) which periodically sends user input to the system, making it to believe that some mouse movement has been made and thus stopping the system from getting locked.
Here we would be calling SendInput function within user32.dll
The SendInput function synthesizes keystrokes, mouse motions, and button clicks and that is what we need.
This is useful in case we are giving presentation or else reading some documents …
Following is the code for the same
1) Create a new windows application in C#
2) Add a button named btn_Unlock to it and a timer control named timer1.
3) Set enabled to false and interval to 120000 for timer control.
4) Put the following code to your form class
frmKU()
nInputs, ref INPUT
pInputs, int cbSize);
int type;
MOUSEINPUT mi;
int dx;
int dy;
int mouseData;
int dwFlags;
int time;
int dwExtraInfo;
API
resSendInput;
void btnUnlock_Click(object
sender, EventArgs e)
input = new INPUT();
void timer1_Tick(object
sender, EventArgs e)
input = new INPUT();
Posted in Windows Application Tagged: Windows Application
This was originally posted here.

Like
Report
*This post is locked for comments