怎样使鼠标象没有一样(不光是屏蔽,是不显示也不能按)

解决方案 »

  1.   

    你可以把鼠标限制在某个区域里(角落),以下是参考函数:
    procedure TForm1.Button1Click(Sender: TObject); 
    var 
    btButton2: TRect; 
    begin 
    btButton2 := Button2.BoundsRect; 
    MapWindowPoints(handle, 0, btButton2, 2); // 座标换算 
    ClipCursor(@btButton2); // 限制鼠标移动区域 
    end; // 还原 
    procedure TForm1.Button2Click(Sender: TObject); 
    var 
    btScreen: TRect; 
    begin 
    btScreen := Rect(0, 0, Screen.Width, Screen.Height); 
    ClipCursor(@btScreen); 
    end;
      

  2.   

    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls;type
      TForm1 = class(TForm)
        Button1: TButton;
        Button2: TButton;
        procedure Button1Click(Sender: TObject);
        procedure Button2Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;
      HookHandle: HHOOK = 0;implementation{$R *.dfm}function Mouse(code: Integer; wParam, lParam: Longint):Longint;stdcall;
    begin
      Result:=1;
    end;procedure TForm1.Button1Click(Sender: TObject);
    begin
      ShowCursor(False);
      HookHandle:=SetWindowsHookEx(WH_MOUSE,Mouse,HInstance,0);
    end;procedure TForm1.Button2Click(Sender: TObject);
    begin
      UnhookWindowsHookEx(HookHandle);
      ShowCursor(True);
    end;end.
      

  3.   

    真棒兄,经你的启发,这样应该更简单些:  ShowCursor(false);
      SetCursorPos(0,0);
      //Disable Mouse  ShowCursor(true);
      SetCursorPos(100,100);
      //Enable Mouse