http://topic.csdn.net/t/20051006/17/4309385.html
procedure TForm1.Button1Click(Sender: TObject);
begin
LockWorkStation;
end;
function LockWS: Boolean;
type
TLockWorkStation = function: Boolean;
var
hUser32: HMODULE;
LockWorkStation: TLockWorkStation;
begin
hUser32 := GetModuleHandle('USER32.DLL');
if hUser32 <> 0 then
begin
@LockWorkStation := GetProcAddress(hUser32, 'LockWorkStation');
if @LockWorkStation <> nil then
begin
LockWorkStation;
Result := True;
end;
end;
end;
评论