procedure TfrmMain.WndProc(var Msg: TMessage);
var
MousePos: TPoint;
begin
if Msg.Msg = MM_MyMsg then
begin
case Msg.LParam of
WM_LBUTTONDOWN: //鼠标左键按下
if GetCursorPos(MousePos) then
begin
PopupMenu1.PopupComponent := frmMain;
PopupMenu1.Popup(MousePos.x, MousePos.y);
end;
...........................//Do something
end;
inherited WndProc(Msg);
end;