int (__stdcall *MyLockWorkStation)();
void LockComputer()
{
HINSTANCE hInst;
hInst = LoadLibrary("user32.dll");
if (hInst)
{
MyLockWorkStation = (int(__stdcall *)())GetProcAddress(hInst,"LockWorkStation");
if (MyLockWorkStation!=NULL)
{
(MyLockWorkStation)();
}
}
FreeLibrary(hInst);
}