To lock the workstation, call the LockWorkStation function. The system displays the Lock Workstation dialog box. The dialog box text says that the workstation is in use and has been locked by the user. The workstation can be unlocked by the user or an administrator. To unlock the system, press Ctrl+Alt+Del and log in.
The LockWorkStation function is callable only by processes running on the interactive desktop. In addition, the user must be logged on, and the workstation cannot already be locked.