1,183
社区成员
发帖
与我相关
我的任务
分享
// GetCursorPos 获取的是鼠标相对与屏幕的位置
var mousept: TPoint; // 只要mousept声明为TPoint
begin
GetCursorPos(ps); // 执行不会出现问题
end;
你检查一下变量mousept的声明。 procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
var p:TPoint;
begin
GetCursorPos(p);
label1.caption := IntToStr(p.X)+','+ IntToStr(p.y);
end;