让程序最小化后图标隐藏到任务栏我已经实现,我现在想右键点击任务栏图标让它弹出一个菜单,请问该如何实现啊?
谢谢!!!!

解决方案 »

  1.   

    看看這裹:
    http://china.sina.com.tw/tech/c/2001-09-25/6083.html
      

  2.   

    你用的是什么控件?它应该有相关的PopupMenu属性,在窗体中新建你的菜单(TPopupMenu),然后跟这个属性关联应该就可以了
      

  3.   

    我的mail
    [email protected]发你个例子
      

  4.   

    procedure TForm1.FormCreate(Sender: TObject);
    begin
      with Tnd do
      begin
        cbSize := SizeOf(Tnd);
        szTip := '¼üÅ̹³×Ó';
        uFlags := NIF_ICON or NIF_MESSAGE or NIF_TIP;
        uID := Uint(Self);
        uCallbackMessage := DDGM_TRAYICON;
        Wnd := Form1.Handle;
        hIcon := Self.Icon.Handle;
      end;
      Shell_NotifyIcon(NIM_ADD, @tnd);
      ShowWindow(Application.Handle, SW_HIDE);
    end;procedure TForm1.WndProc(var Message: TMessage);
    var pt: TPoint;
    begin
      if Message.Msg = DDGM_TRAYICON then
      begin
        if Message.LParam = WM_RBUTTONUP then
        begin
          GetCursorPos(pt);//得到鼠标位置
          RPMenu.Popup(pt.X, pt.Y);
        end;
      end
      else inherited WndProc(Message);
    end;
    在处理窗口的消息处理事件中弹出菜单