If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!
I used to work for a with a guy who was paranoid about keeping his laptop secure - even amongst friends. He was also a heavy smoker so was forever needing to run out of internal meetings for a quick smoke, and every time he went, he’d lock his laptop (Ctrl-Alt-Del, then click on “Lock Computer”).
Now, one day, he’d been running a session that had over-run making him wait longer than normal for his cigarette. When we did finally break, he hit Ctrl-Alt-Del and went out - leaving the menu visible to be canceled and the PC unlocked! Our boss spotted this and found it quite amusing, so he went into the guys email and sent a message declaring love to one of our other colleagues! :) He also had the presence of mind to clean up the deleted items, then to lock the PC (as the guy thought he’d locked it). When he came back in and quickly checked his email, it was very amusing to see how he reacted to the response to his email from someone who was clearly happy to play along!
We could debate the merits of playing this kind of joke on people but in this case, we were a tight-knit team and we were all confident that this joke wouldn’t be taken badly, but it does raise a valid point. We should ALL learn to lock our laptops if we have to walk away from them in any open/public environment. In my current role, for example, I spend most of my time at client’s sites and my laptop contains information that other clients may consider confidential, so I make it a rule to always lock the system even just to go and get a coffee.
Locking Windows XP is not a particularly onerous task. As I mentioned earlier, you hit Ctrl-Alt-Del then click the “Lock Computer” button. Sometimes though, I’m trying to lock the computer whilst answering my phone and grabbing something to write with whilst disappearing to take the call. Under these circumstances, the quicker I can lock the system, the better - especially if I can do so in a manner that removes any doubt (”did I remember to click the ‘Lock Computer’ button….?”)
As a developer, I understand DLL’s pretty well. DLL’s (Dynamic Link Libraries) are essentially a collection of related functions that are called as needed by various other applications. One of the common DLL’s is user32.dll which is responsible for much of the user interaction on your PC, such as creating new windows, drawing menus and moving windows around the screen. The method of particular interest today though, is ‘LockWorkStation’. As the name suggests, this is the specific function that is called in order to lock the computer in the same way that the ‘Lock Computer’ button works (the button almost certainly calls this method).
The next thing we need to look at is ‘rundll32.exe’. This application is used to call specific methods from within DLL’s from the command line. To use this, start out with all aplications minimised and follow this procedure:
- Right-click on the desktop and select New->Shortcut
- This brings up a window allowing us to type the specific command that we need into the text box, as shown below:
- Hit Next, then give the shortcut a meaningful title:
- Click Finish.
- This is the first step, which creates a shortcut on the desktop. The first thing I’d recommend doing (although very much optional) is to give the shortcut an icon that makes it recognizable. To do this, right-click on the new shortcut and select properties. From the window that opens, click on ‘Change Icon’:
From here, you can choose any icon file or any file that contains icons. One legacy file that’s been available on Windows for many years is ‘moricons.dll’ which is in the WINDOWS\System32 directory, which contains quite a collection of icons that are probably not used on anything on your current system:
- The final step is to create a shortcut, so that you can lock the computer one-handed, if need be. To do this, you need to be back in the properties window, where you’ll see a box for the shortcut key:

Click into this field and hit the key combination that you’d like to use for your shortcut. I chose Ctrl-Alt-L because I can hit these one-handed in a hurry, if I need to. - Finally, click OK to close the properties window, and you’re done!
Don’t test this immediately, as Windows needs some time to cache this shortcut. Being the techie that I am, I created it then hit Ctrl-Alt-L and my PC simply stopped responding (which is still effective…!) whilst it searched for an application that could process the shortcut! Of course, whilst waiting, I hit it again (still nothing) then double clicked on the icon. Double-clicking caused an immediate lock, so I unlocked it, by which time Windows had figured out the key combination and locked my computer again! Remember though, I’d hit it TWICE, so you can guess what happened when I unlocked it again….!
Anyway, now that it’s happily cached, I can lock my computer with a single keypress as I’m walking away from it.
Enjoy!










