对不起,上面少写了一个过程,在FORM1上放一个PopMenu,
procedure TForm1.OnNotifyIcon(var Message: TMessage);
Var MousePos:TPoint;
begin
if Message.LParam=WM_LBUTTONDBLCLK then
ShowMessage('呵呵')
else
if (Message.LParam=WM_RBUTTONDOWN) then
begin
GetCursorpos(MousePos);
SetforegroundWindow(Application.Handle);
Application.ProcessMessages;
PopMenu.Popup(MousePos.x,MousePos.y);
end;
end;