const
    WM_TrayMessage=WM_User+100;  protected
      procedure AppMinimized(Sender: TObject);
      procedure WMTrayMessage(var msg:TMessage);message WM_TrayMessage;uses ShellApivar
  NID:TNotifyIconData{点击了任务栏的图标}
procedure TMainForm.WMTrayMessage(var msg:TMessage);
var
  p:TPoint;
begin
  if msg.LParam=WM_LButtonDown then
  begin
    ShowWindow(Application.Handle,SW_Show);
    Application.Restore;
  end
  else if msg.LParam=WM_RButtonDown then
  begin
    GetCursorPos(p);
    pmTray.Popup(p.x,p.y);
  end;
end;{应用程序最小化时图标显示在任务栏}
procedure TMainForm.AppMinimized(Sender:TObject);
begin
  NID.cbSize:=SizeOf(TNotifyIconData);
  NID.hIcon:=Application.Icon.Handle;
  NID.szTip:= '彩虹2.0 Beta ';
  NID.uCallbackMessage:=WM_TrayMessage;
  NID.uFlags:=NIF_ICON or NIF_MESSAGE or NIF_TIP;
  NID.uID:=0;
  NID.Wnd:=Handle;
  Shell_NotifyIcon(NIM_ADD,@NID);
  ShowWindow(Application.Handle,SW_Hide);
end;procedure TMainForm.FormCreate(Sender: TObject);
begin
  Application.OnMinimize:=AppMinimized;
  AppMinimized(nil);
end;procedure TMainForm.FormDestroy(Sender: TObject);
begin
  Shell_NotifyIcon(NIM_DELETE,@NID);
end;

解决方案 »

  1.   

    装一个RXLib试试看,一定有你想要的东西,你可以通过短消息给我一个E-Mail,我有一个例子可以给你,但使用了RXLib,是Delphi 6的!
    RxLib可以到www.51delphi.com下载!
      

  2.   

    对不起,我不想用第三方控件!
    我写的是corba应用伺服器,我在服务器上注册时,它可以自动起动,我只是想在右下角时间旁边放一个ICON,看我的服务有没有起动,请提出详解!
      

  3.   

    同意 lincanwen(海) 
    你可以使用TNotifyIconData类来实现,
    主要就是这一部分,很简单的,
    begin
      NID.cbSize:=SizeOf(TNotifyIconData);
      NID.hIcon:=Application.Icon.Handle;
      NID.szTip:= '彩虹2.0 Beta ';
      NID.uCallbackMessage:=WM_TrayMessage;
      NID.uFlags:=NIF_ICON or NIF_MESSAGE or NIF_TIP;
      NID.uID:=0;
      NID.Wnd:=Handle;
      Shell_NotifyIcon(NIM_ADD,@NID);
      ShowWindow(Application.Handle,SW_Hide);
    end
      

  4.   

    http://www.csdn.net/Expert/forum.asp?typenum=8&searchKeys=%C8%CE%CE%F1%C0%B8&roomid=3&author=&tabletype=now
    这里真的有N多,慢慢看吧