WIN锁屏+鼠标移动事件
winexec('rundll32.exe user32.dll, LockWorkStation', sw_hide);
1.shutdown.bat(关机)
rundll32.Exe shell32.dll SHExitWindowsEx 1
2.logoff.bat(注销)
rundll32.Exe shell32.dll SHExitWindowsEx 0
3.reboot.bat(重启)
rundll32.Exe shell32.dll SHExitWindowsEx 2
4.lock.bat(锁定桌面)
rundll32.Exe user32.dll LockWorkStation
1 procedure TForm1.WndProc(var nMsg: TMessage); 2 var s:string; 3 procedure setShow(AShow: Integer); 4 begin 5 case AShow of 6 0: Memo1.Lines.Add('无'); 7 1: Memo1.Lines.Add('右'); 8 2: Memo1.Lines.Add('左'); 9 3: Memo1.Lines.Add('下'); 10 4: Memo1.Lines.Add('上'); 11 end; 12 end; 13 begin 14 inherited; 15 if (nMsg.Msg = WM_MOUSEMOVE) then 16 begin 17 if (nX < nMsg.LParamLo) then 18 setShow(1) 19 else if (nX > nMsg.LParamLo) then 20 setShow(2) 21 else if (nY < nMsg.LParamHi) then 22 setShow(3) 23 else if (nY > nMsg.LParamHi) then 24 setShow(4) 25 else 26 setShow(0); 27 nX := nMsg.LParamLo; 28 nY := nMsg.LParamHi; 29 Label1.Caption := '...'; 30 end; 31 end;
作者:疯狂Delphi
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利.
欢迎关注我,一起进步!扫描下方二维码即可加我