Click here to Skip to main content
Licence 
First Posted 25 Jul 2004
Views 49,317
Bookmarked 27 times

Lock WorkStation the MFC way

By | 1 Aug 2004 | Article
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

About the Author

Vikram Kashyap

Technical Lead

India India

Member

Hi I am Vikram, did my computers from NIIT with excellent score. Passion for VC++/MFC and developing my own utilities. Loves to do a lot of R&D on registry. Working in VC++/MFC from the last 6 years with SQL and MS-Access database. Currently working as a Project Lead with an MNC in Gurgaon.
 
Got my articles posted on Codeguru.com
1. Open Six Sites in one Browser
2. Customized icon in Message Box
 
Articles On CodeProject
1. Lock WorkStation the MFC Way
2. Gradient Dialog with a Colored ProgressBar
3. Move Start Button

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralMy vote of 5 PinmemberMember 671616017:50 28 Dec '10  
GeneralCrappy Trojan - and here is why PinmemberSB200322:07 1 Oct '09  
GeneralCrappy Trojan Part II PinmemberSB200322:31 1 Oct '09  
GeneralRe: Crappy Trojan Part II PinmemberVikram Kashyap23:47 1 Oct '09  
GeneralRe: Crappy Trojan Part II PinmemberSB20036:24 2 Oct '09  
GeneralLock the PC PinmemberpHRO gHO8:05 8 May '08  
GeneralNo Source Pinmemberkoenjoeks0:34 20 Nov '07  
Hello,
I can't seem to find the total source, only the Locking Part.
You wrote a perfect program in my opinion, but i'd really like to look at the Source of the total program (including the Visual Parts)
Can you e-mail me with some more details?
koenjoeks@gmail.com
 
Thanks
 
Joekie is the Poekiepoekiepoekiewoekie!:->
GeneralBypass startup. Pinmemberantsays22:32 2 Jul '06  
GeneralUndo changes PinmemberMyszka21:47 16 Dec '04  
Generalitz just for fun? try Ctrl + ESC... Pinmembertony_w200018:46 3 Aug '04  
GeneralI tell you gus it is a trash for you are unlikely to use a topmost window to lock ... PinsussAnonymous6:43 3 Aug '04  
GeneralTo be more annoying :) PinmemberLars [Large] Werner1:50 3 Aug '04  
GeneralTrash Pinmembergoklll6:47 2 Aug '04  
GeneralRe: Trash PinsussAnonymous22:30 2 Aug '04  
QuestionWhere's the beef? PinmemberNGS 5496725:47 26 Jul '04  
AnswerIt is in yr lunch sandwich PinmemberWoodFire329:35 26 Jul '04  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web04 | 2.5.120529.1 | Last Updated 2 Aug 2004
Article Copyright 2004 by Vikram Kashyap
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid