GetCursorPos(mousept);编译错误

tom20803862 2017-10-20 11:48:17
delphi 6 中
GetCursorPos(mousept);编译错误Statement expected, but expression of type 'LongBool' found
如何解决?
...全文
767 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
tom20803862 2017-10-26
  • 打赏
  • 举报
回复
var mousept: TPoint; //鼠标点击位置 lb : longbool; begin inherited; if message.LParam = wm_rbuttonup then begin lb:=GetCursorPos(mousept); 这样就能编译成功, 我他妈的真气晕了。
shadowpj 2017-10-24
  • 打赏
  • 举报
回复
应该是你变量申明类型问题。mousept: TPoint; 就没问题了!
lyhoo163 2017-10-21
  • 打赏
  • 举报
回复
// GetCursorPos 获取的是鼠标相对与屏幕的位置

var mousept: TPoint;   // 只要mousept声明为TPoint
begin
  GetCursorPos(ps);    // 执行不会出现问题 
end;
你检查一下变量mousept的声明。
jjpweb 2017-10-20
  • 打赏
  • 举报
回复
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;

1,183

社区成员

发帖
与我相关
我的任务
社区描述
Delphi Windows SDK/API
社区管理员
  • Windows SDK/API社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧