function LockWS: Boolean;<br>type<br> TLockWorkStation = function: Boolean;<br>var<br> hUser32: HMODULE;<br> LockWorkStation: TLockWorkStation;<br>begin<br> hUser32 := GetModuleHandle('USER32.DLL');<br> if hUser32 <> 0 then<br> begin<br> @LockWorkStation := GetProcAddress(hUser32, 'LockWorkStation');<br> if @LockWorkStation <> nil then<br> begin<br> LockWorkStation;<br> Result := True;<br> end;<br> end;<br>end;<br>-----------------------------------------------------------------------------<br><br>procedure TForm1.Button1Click(Sender: TObject);<br>begin<br>LockWS;<br>end;