5,927
社区成员




procedure TForm3.ApplicationEvents1Message(var Msg: tagMSG;
var Handled: Boolean);
var
Cell: TGridCoord;
MousePos: TPoint;
begin
if (Msg.hwnd = sg1.Handle) and (Msg.message = WM_RBUTTONUP) then
begin
MousePos.X := Msg.lParam and $0000FFFF;
MousePos.Y := Msg.lParam and $FFFF0000 shr 16;
Cell := sg1.MouseCoord(MousePos.X, MousePos.Y);
if (Cell.X <> -1) and (Cell.Y <> -1) then
begin
GetCursorPos(MousePos);
pm1.Popup(MousePos.X, MousePos.Y);
end;
end;
end;