delphi版本5.0.5
目的:最小化窗口至系统栏,而非任务栏
问题:我该如何做,该用哪个API?
盼解答,谢谢。

解决方案 »

  1.   

    Const WM_ICONCALLBACKMESSAGE=WM_USER+0;
      tind:TNotifyIconData;
        procedure  WndProc (var Message:TMessage);message WM_iconcallbackMessage;   //上面都是定义//压缩到任务栏
    tind.cbSize:=SizeOf (TNotifyIconData);
      tind.Wnd:=form1.Handle;
      tind.hIcon:=Application.Icon.Handle;
      tind.uFlags:=NIF_TIP OR NIF_ICON OR NIF_MESSAGE;
      tind.uID:=0;
      tind.szTip:='测试';
      tind.uCallBackMessage:=WM_ICONCALLBACKMESSAGE;
    shell_NotifyIcon (NIM_ADD,@tind);
    shell_NotifyIcon (NIM_delete,@tind);
    //截获点击消息的函数
     procedure  WndProc (var Message:TMessage);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);
          PopupMenu1.Popup(p.x,p.y);
        end;