Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Lock WorkStation the MFC way

0.00/5 (No votes)
1 Aug 2004 1  
Allows the user to lock the workstation during lunch or meeting hours

Introduction

This is a very small application that demonstrates the use of fullscreen dialog based applications. When the application is executed it goes and sits inside the systray with a key as a tray icon.

Using the application

  • To lock the screen, the user has to press a key combination of Ctrl+Alt+Minus sign on the numpad.
  • To unlock the screen user is asked to enter a password.
  • During lock mode, mouse cursor and caret are hidden as it happens in a normal booting screen, also Alt+Tab, Ctrl+Alt+Del keys are disabled.

But the user still can press Ctrl+Esc to activate the Start menu, In order to disable the Taskbar/StartButton, FindWindowEx API has been used and after taking the handle successfully the Taskbar is disabled, so that the user is not able to clcik on the TaskBar also. Currently the password has been hardcoded inside the application as "vkpassword". But developers can easily modify the application to store the password in registry or some encrypted file in the system. Use of Hotkeys have been implemented. To lock the screen user needs to press Ctrl+Alt+Minus sign on the numpad. A special thanks to Chris Maunder for his CSystemTray icon class used in the application.

How to get it installed?

  • Unzip the demo exe file
  • Double click on the exe file
  • The application goes and sits inside the SystemTray (thanx Chris!!)

Press Ctrl+Alt+Minus sign on Numpad. The system is locked now, to unlock enter password as "vkpassword" of course without the double quotes.

Notes

The application makes some changes in the registry, as to run during the computer start up, disabling the task manager using a registry hack. Hope you all will like the same and also don't forget to send me ur comments, suggestions to make it better. Thanks.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here