Reposting from prev blog
Idle mind is Devils Workshop!!
Today didnt have much tasks to work on as had already finished the task expected to go on till today evening ,hence had loads of free time to try out stuff
Found this link Lockworkstation Function and thouht of implementing it in .NET since I hated the idea of
CTRL + ALT + DEL and ENTER / Win + L to lock my workstation.
Anyways here it is the code
You will need to include the Namespace
Copy the following in the Code behind
public static extern void LockWorkStation();
And in the form load event give a call to the LockWorkStation Method we declared above.
private void LockStation_Load(object sender, System.EventArgs e)
Thats it you are done !! Copy the Assembly from the bin folder onto your desktop and click on it whenever you want to Lock your workstation!!