用这个看看:
var 
  KHK: HHook;
  tmp: integer;function HookProc(ICode: integer;WP:WParam;LP:LParam):LResult;
begin
  Result:=CallNextHookEx(KHK,0,0,0);
end;
//用下面的语句锁定
KHK:=SetWindowsHookex(WH_JOURNALPLAYBACK,@HookProc,HInstance,0);

解决方案 »

  1.   

    要不要没治的锁定法下面是代码(在哪台上运行,哪台就没治了):
    var
    lockrect:TRect;
    begin
    SystemParametersInfo(SPI_SCREENSAVERRUNNING,1,0,0);//屏蔽系统功能键
    lockrect.right:=0;
    lockrect.left:=0;
    lockrect.top:=0;
    lockrect.bottom:=0;
    MapWindowPoints(handle,0,lockrect,2);
    ClipCursor(@lockrect);//限定鼠标的活动
    end;
    解除代码如下
    SystemParametersInfo(SPI_SCREENSAVERRUNNING,0,0,0);
    ClipCursor(0);
      

  2.   

    c++Builder程序如下,改一点点就可以用于delphi了!
    void __fastcall TFormMain::HideDeskTop()
      {
        HANDLE hDesktop ;
        hDesktop= FindWindow("Progman", NULL);
        ShowWindow(hDesktop, SW_HIDE);
      }
    //---------------------------------------------------------------------------
     void __fastcall TFormMain::ShowDeskTop()
       {
        HANDLE hDesktop ;
        hDesktop= FindWindow("Progman", NULL);
        ShowWindow(hDesktop, SW_SHOW);
       }
    //---------------------------------------------------------------------------
     void __fastcall TFormMain::HideStarBtn()
       {
    HANDLE handle1,handle2;
    handle1=FindWindow("shell_traywnd",NULL);
    handle2=GetWindow(handle1,GW_CHILD);
    GetClassName(handle2,"button",255);
    ShowWindow(handle2,SW_HIDE);
       }
    //---------------------------------------------------------------------------
     void __fastcall TFormMain::ShowStarBtn()
       {
    HANDLE handle1,handle2;
    handle1=FindWindow("shell_traywnd",NULL);
    handle2=GetWindow(handle1,GW_CHILD);
    GetClassName(handle2,"button",255);
    ShowWindow(handle2,SW_SHOW);
       }
    //---------------------------------------------------------------------------
     void __fastcall TFormMain::LockKeyBoard()
       {
        int temp;
        SystemParametersInfo(SPI_SCREENSAVERRUNNING, 1, &temp, 0);
       }
    //---------------------------------------------------------------------------
     void __fastcall TFormMain::UnLockKeyBoard()
      {
       int temp;
       SystemParametersInfo(SPI_SCREENSAVERRUNNING, 0, &temp, 0);
      }