可以先在Form1上放一个Popupmenu1,然后加入以下代码:<br>Procedure Form1.OnNotifyIcon(var Message:TMessage);<br>var MousePos:TPoint;<br>begin<br> if Message.LParam=WM_RBUTTONDOWN then<br> begin<br> GetCursorPos(MousePos);//当鼠标置于图标上时,获取鼠标位置<br> SetForegroundWindow(Application.Handle);//将程序调入前台<br> Application.ProcessMessage;<br> PopupMenu1.Popup(MousePos.x,MousePos.y);//在鼠标位置弹出菜单<br> end;<br>end;