The quickest way to lock your computer screen is to just use the
Win+L keyboard shortcut. Some people prefer to use the mouse to lock the
workstation, however, or would just like to have both options.
Here's how to easily create a shortcut to lock Windows Vista, although this
should work on Windows XP as well.
Right-click wherever you want to create the shortcut, choose New, and then
Enter the following text into the shortcut textbox. Note that the
screen will look different on Windows XP, but the same text should work.
rundll32.exe user32.dll, LockWorkStation
Enter a name for the shortcut, and then click Finish. That's all there is to it.