下载一个cooltrayicon就有了,
http://delphi.icm.edu.pl/ftp/d20free/cooltray.zip

解决方案 »

  1.   

    去www.google.com
    搜索 托盘控件  这个关键字,保证你大有收获记得以后多去www.google.com搜索
      

  2.   

    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
      ShellAPI, Menus, StdCtrls;const
      WM_TRAYICON = WM_APP + 0;
    type
      TForm1 = class(TForm)
        PopupMenu: TPopupMenu;
        Hello1: TMenuItem;
        Exit1: TMenuItem;
        N1: TMenuItem;
        There1: TMenuItem;
        Label1: TLabel;
        procedure FormClose(Sender: TObject; var Action: TCloseAction);
        procedure FormCreate(Sender: TObject);
        procedure Exit1Click(Sender: TObject);
      private
        procedure WMTrayIcon(var message: TMessage); message WM_TRAYICON;
        procedure ModifyTrayIcon(Action: DWORD);
      public
      end;
      
    var
      Form1: TForm1;
      
    implementation{$R *.DFM}procedure TForm1.ModifyTrayIcon(Action: DWORD);
    var
      NIData: TNotifyIconData;
    begin
      with NIData do
      begin
        cbSize := sizeof(TNotifyIconData);
        UID := 0;
        uFlags := NIF_MESSAGE or NIF_ICON or NIF_TIP;
        Wnd := Handle;
        uCallBackMessage := WM_TRAYICON;
        HICON := Application.Icon.Handle;
        StrPCopy(szTip, Application.Title);
      end;
      Shell_NotifyIcon(Action, @NIData);
    end;procedure TForm1.WMTrayIcon(var message: TMessage);
    var
      MousePos: TPoint;
    begin
      if message.LPARAM = WM_RBUTTONDOWN then
      begin
        SetActiveWindow(Handle);
        GetCursorPos(MousePos);
        PopupMenu.Popup(MousePos.X, MousePos.Y);
      end;
    end;procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
    begin
      ModifyTrayIcon(NIM_DELETE);
    end;procedure TForm1.FormCreate(Sender: TObject);
    begin
      ModifyTrayIcon(NIM_ADD);
    end;procedure TForm1.Exit1Click(Sender: TObject);
    begin
      Close;
    end;end.