关闭显示器:<br>SendMessage(Application.Handle, WM_SYSCOMMAND, SC_MONITORPOWER, 0);<br>打开显示器:<br>SendMessage(Application.Handle, WM_SYSCOMMAND, SC_MONITORPOWER, -1);<br><br>锁定系统:<br>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; <br><br><br>响应热键简单,要是只响应热键就很难了,比如:ctrl+alt+del就很难屏蔽掉。