我使用了,系统托盘,但最小化时,不能完全最小化到任务蓝,着面的状态蓝还有

解决方案 »

  1.   

    http://expert.csdn.net/Expert/FAQ/FAQ_Index.asp?id=634
      

  2.   

    formcreate()中用SetWindowLong(allpication.handle,gwl_ex_toolwindow)
      

  3.   

    给你贴个我写的:
    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs,shellapi, Menus;type
      TForm1 = class(TForm)
        PopupMenu1: TPopupMenu;
        N111111111: TMenuItem;
        N222221: TMenuItem;
        N33331: TMenuItem;
        procedure FormDestroy(Sender: TObject);
      private
        { Private declarations }
        procedure wmsyscommand(var msg:Tmessage);message wm_syscommand;
      public
        { Public declarations }
        procedure instell;
        procedure WndProc(var Msg: TMessage); override;
      end;const msg_tray=wm_user+1105;
    var
      Form1: TForm1;
      myicon: NotifyIconData;implementation{$R *.dfm}
    procedure Tform1.instell;
    begin
      with myicon do
        begin
           cbSize:=SizeOf(TNotifyIconData);
           Wnd:=Handle;   //指向当前窗体Form1的句柄
           uID:=0;
           uFlags:=NIF_ICON or NIF_MESSAGE or NIF_TIP;
           ucallBackMessage:=msg_tray;
           hIcon:=Application.Icon.Handle;
           szTip:='大家好.....';
        end;
        Shell_NotifyIcon(NIM_ADD,@myicon);
    end;procedure Tform1.wmsyscommand(var msg:Tmessage);
    begin
    case msg.WParam of
      sc_minimize : begin   //最小化
                   Application.Minimize;
                   form1.Hide;
                   instell;
                   inherited;
                   end;
      else
      inherited;
      end;
    end;procedure TForm1.FormDestroy(Sender: TObject);
    begin
    Shell_NotifyIcon(NIM_DELETE, @myicon);
    end;procedure TForm1.WndProc(var Msg: TMessage);
    var
     pt:TPoint;
    begin
     with Msg do
     begin
       if Msg = msg_tray then
       begin
         case lParam of
           WM_RBUTTONDOWN: begin
                           GetCursorPos(pt);
                           PopupMenu1.Popup(Pt.X, Pt.Y);
                           end;
           WM_LBUTTONDOWN: begin
                           form1.Visible:=not form1.Visible;
                           Shell_NotifyIcon(NIM_DELETE, @myicon);
                           end;      end;
       end;
     end;
     inherited;
    end;end.