shell_notifyIcon()我也知道,但是我不知道在哪里

解决方案 »

  1.   

    const MyIcoMes=WM_USER+78;procedure MyIcoMesDo(var Msg : TMessage);Message MyIcoMes; 
    procedure Tf_main.MyIcoMesDo(var Msg:TMessage);
    Var Mouse_Point : TPoint;  //当前鼠标位置
    begin
      if (Msg.LParam=WM_LBUTTONDBLCLK) and f_main.Enabled then
         f_main.Visible:=not f_main.Visible;  //双击图标,显示(隐藏)窗口  if (Msg.LParam=WM_RBUTTONUP) and f_main.Enabled then
      begin  //右键单击,显示菜单
           GetCursorPos(Mouse_Point);
           main_pop.Popup(Mouse_Point.x,Mouse_Point.y);
      end;
    end;
      

  2.   

    const MyIcoMes=WM_USER+78;procedure Tf_main.FormCreate(Sender: TObject);
    begin
      //建立“托盘”图标
      New(PNotify);
      PNotify^.Wnd:=f_main.Handle;
      PNotify^.uID:=0;
      PNotify^.uFlags:=NIF_ICON+NIF_MESSAGE+NIF_TIP;
      PNotify^.hIcon:=f_main.Icon.Handle;
      PNotify^.uCallbackMessage:=MyIcoMes;
      PNotify^.szTip:='电子小说';
      Shell_NotifyIcon(NIM_ADD,PNotify);
    end;
    procedure MyIcoMesDo(var Msg : TMessage);Message MyIcoMes; 
    procedure Tf_main.MyIcoMesDo(var Msg:TMessage);
    Var Mouse_Point : TPoint;  //当前鼠标位置
    begin
      if (Msg.LParam=WM_LBUTTONDBLCLK) and f_main.Enabled then
         f_main.Visible:=not f_main.Visible;  //双击图标,显示(隐藏)窗口  if (Msg.LParam=WM_RBUTTONUP) and f_main.Enabled then
      begin  //右键单击,显示菜单
           GetCursorPos(Mouse_Point);
           main_pop.Popup(Mouse_Point.x,Mouse_Point.y);
      end;
    end;
      

  3.   

    Sample 工具栏里好像有个TrayIcon控件。
      

  4.   

    SQL_MAN(祝你快乐):
        上面代码:PNotify在什么地方声明,是不是在USES中漏了什么??
    求救啦。
      

  5.   

    var
      PNotify : PNotifyIconDataA;