Tuesday, February 3, 2009

[VC++] Programmatically locking your machine

For locking your machine programmatically you can use the API LockWorkStation(). See the below code for locking a system.

if( !LockWorkStation())
{
// Failed to lock the machine
}

Please note that _WIN32_WINNT should be defined >= 0x0500


No comments: