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;
View Code

 

posted on 2018-11-29 20:01  疯狂delphi  阅读(942)  评论(0编辑  收藏  举报

导航