'API声明
Private Declare Function SetCursor Lib "user32" (ByVal hCursor As Long) As Long
Private Declare Function LoadCursorBynum& Lib "user32" Alias "LoadCursorA" (ByVal hInstance As Long, ByVal lpCursorName As Long)
Private Const IDC_HAND = 32649&
'Label1鼠标移动事件
Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Const IDC_HAND = 32649&
Static hCursor As Long
If hCursor = 0 Then hCursor = LoadCursorBynum&(0&, IDC_HAND)
SetCursor hCursor
End Sub{想把上面的使用鼠标手势来用在delphi上,不知道能不能用}
procedure TForm1.Label1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
beginend;
Private Declare Function SetCursor Lib "user32" (ByVal hCursor As Long) As Long
Private Declare Function LoadCursorBynum& Lib "user32" Alias "LoadCursorA" (ByVal hInstance As Long, ByVal lpCursorName As Long)
Private Const IDC_HAND = 32649&
'Label1鼠标移动事件
Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Const IDC_HAND = 32649&
Static hCursor As Long
If hCursor = 0 Then hCursor = LoadCursorBynum&(0&, IDC_HAND)
SetCursor hCursor
End Sub{想把上面的使用鼠标手势来用在delphi上,不知道能不能用}
procedure TForm1.Label1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
beginend;
const
IDC_HAND = 32649;procedure TForm1.Label1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
var
Cursor: THandle;
begin
Cursor := LoadCursor(0, IDC_HAND);
SetCursor(Cursor);
end;
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TForm1 = class(TForm)
Button1: TButton;
Label1: TLabel;
procedure Label1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
procedure Label1MouseLeave(Sender: TObject);
private
{ Private declarations }
h: HCURSOR;
procedure WMSetCursor(var Msg: TWMSetCursor); message WM_SETCURSOR;
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.WMSetCursor(var Msg: TWMSetCursor);
begin
if h <> 0 then
SetCursor(h)
else
Inherited;
end;procedure TForm1.Label1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
h := LoadCursor(0, IDC_CROSS);
end;procedure TForm1.Label1MouseLeave(Sender: TObject);
begin
h := LoadCursor(0, IDC_ARROW);
end;end.