关于系统托盘有这种控件,所以这点我就不说了。关于最小话,这个问题要截断系统消息,
 procedure TWMSysCommand(var Msg:TMessage ); message wm_SysCommand;
procedure TfrmSrvMain.TWMSysCommand(var Msg:TMessage );
begin
   case Msg.WParam of
     SC_MINIMIZE:
        begin
          if (Self.Visible=true)and(not isClose) then
            begin
              btnMid.SetFocus;
              Self.Hide;
              FillDataStructure;
              Shell_NotifyIcon(NIM_Add,@IconData);
            end
          else
             inherited;
        end
     else
       inherited;
   end;
end;

解决方案 »

  1.   

    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:= 'taxi';
      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;
      

  2.   

    下载一个rx275d6  控件,  里头有一个TryICON控件,  设置里头的属性就要以
      

  3.   

    1、用VCL吧,简单!我有,可留下依妹儿。
    2、可以用winexec or ShellExecute 来条用外部程序
    如:
    winexec('http://www.microsoft.com',SW_SHOWNORMAL)
      

  4.   

    1. 参考下面代码:
    type
      TForm1 = class(TForm)
      private
        procedure WMSysCommand(var Message: TMessage); message WM_SYSCOMMAND;
        procedure WMBarIcon(var Message:TMessage);message WM_BARICON;procedure TForm1.WMSysCommand(var Message:TMessage);
    var
      lpData:PNotifyIconData;
    begin
      if Message.WParam = SC_ICON then
      begin    //如果用户最小化窗口则将窗口    隐藏并在任务栏上添加图标
        lpData := new(PNotifyIconDataA);
        lpData.cbSize := 88;      //SizeOf(PNotifyIconDataA);
        lpData.Wnd := Form1.Handle;
        lpData.hIcon := Form1.Icon.Handle;
        lpData.uCallbackMessage := WM_BARICON;
        lpData.uID :=0;
        lpData.szTip := 'Samples';
        lpData.uFlags := NIF_ICON or NIF_MESSAGE or NIF_TIP;
        Shell_NotifyIcon(NIM_ADD,lpData);
        dispose(lpData);
        Form1.Visible := False;
      end
      else
      begin    //如果是其它的SystemCommand消息则调用系统缺省处理函数处理之。
        DefWindowProc(Form1.Handle,Message.Msg,Message.WParam,Message.LParam);
      end;
    end;procedure TForm1.WMBarIcon(var Message:TMessage);
    var
      lpData:PNotifyIconData;
    begin
      if (Message.LParam = WM_LBUTTONDOWN) then
      begin    //如果用户点击任务栏图标则将图标删除并回复窗口。
        lpData := new(PNotifyIconDataA);
        lpData.cbSize := 88;//SizeOf(PNotifyIconDataA);
        lpData.Wnd := Form1.Handle;
        lpData.hIcon := Form1.Icon.Handle;
        lpData.uCallbackMessage := WM_BARICON;
        lpData.uID :=0;
        lpData.szTip := 'Samples';
        lpData.uFlags := NIF_ICON or NIF_MESSAGE or NIF_TIP;
        Shell_NotifyIcon(NIM_DELETE,lpData);
        dispose(lpData);
        Form1.Visible := True;
      end;
    end;
    能完成你所要求的功能 2. 用ShellExecute(Handle,'open',PChar('http://www.microsoft.com'),nil,nil,SW_SHOWNORMAL);
    要在uses中加上ShellAPI
      

  5.   

    首先谢谢上面各位的代码。可是我看了一下好像大家都用到一个类TNotifyIconData,不是delphi自带的吧?请问是哪个控件?在哪里下载?
      

  6.   

    有控件呀,如果你要自己写的话我给你一段代码吧,我一直用的很现成的procedure TForm1.FormActivate(Sender: TObject);
    var
      IconData: TNotifyIconData;
    begin
      TestIcon := TIcon.Create;
      TestIcon.LoadFromFile('Snow.ico');
      iconData.cbSize := sizeof(icondata);
      iconData.Wnd := Handle;
      IconData.uID := 1;
      IconData.uFlags := NIF_ICON or NIF_MESSAGE or NIF_TIP;
      IconData.uCallBackMessage :=  WM_USER + 1;
      IconData.hIcon := Testicon.Handle;
      IconData.szTip := '这是一个任务栏测试!';
      Shell_NotifyIcon( NIM_ADD, @IconData );
    end;那个'Snow.ico'你自己改一下吧