把98的任务条隐藏掉。
ShowWindow(FindWindow('Shell_TrayWnd',nil), SW_HIDE);
程序推出别忘了将任务条显示:
ShowWindow(FindWindow('Shell_TrayWnd',nil), SW_SHOW);

解决方案 »

  1.   

    但是如果程序有问题,没有将任务条显示的话,不是就麻烦吗?
    我看到有一个电子图书界面的窗体可能做到,但我不知是其中哪条代码起到作用.我将它帖上来,帮忙看看.
    unit NeoForm;interfaceuses
      Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
      ExtCtrls, StdCtrls, ImgList, ToolWin, ComCtrls, MenuBar, Menus, Buttons;type
      TWhichBorder=(wbTop,wbLeft,wbRight,wbBottom,wbLeftTop,wbLeftBottom,wbRightTop,
        wbRightBottom,wbNone);
      TzypNeoBorderIcons=Array [1..3] of Boolean;
      TzypNeoForm = class(TForm)
        ImageTop: TImage;
        ImageLeft: TImage;
        ImageLeftTop: TImage;
        ImageRightTop: TImage;
        ImageRight: TImage;
        ImageBottom: TImage;
        LabelCaption: TLabel;
        ImageIcon: TImage;
        PanelBkGnd: TPanel;
        ImageMax: TImage;
        ImageMin: TImage;
        ImageNormal: TImage;
        ImageClose: TImage;
        ImageDeactiveLeftTop: TImage;
        ImageDeactiveTop: TImage;
        ImageDeactiveRightTop: TImage;
        ImageActiveTop: TImage;
        ImageActiveLeftTop: TImage;
        ImageActiveRightTop: TImage;
        ImageLeftBottom: TImage;
        ImageRightBottom: TImage;
        procedure FormCreate(Sender: TObject);
        procedure FormResize(Sender: TObject);
        procedure SetCanResize(value:Boolean);
        function  GetcanResize:Boolean;
        procedure SetBorderIcons;
        procedure ImageTopMouseDown(Sender: TObject; Button: TMouseButton;
          Shift: TShiftState; X, Y: Integer);
        procedure ImageTopMouseUp(Sender: TObject; Button: TMouseButton;
          Shift: TShiftState; X, Y: Integer);
        procedure ImageTopMouseMove(Sender: TObject; Shift: TShiftState;
      X, Y: Integer);
        procedure FormCanResize(Sender: TObject; var NewWidth,
          NewHeight: Integer; var Resize: Boolean);
      private
        { Private declarations }
        FCanResize,FisDown:Boolean;
        FDetax,FDetaY:Integer;
        FP,FOldP:TPoint;
        FzypNeoBorderIcons:TZypNeoBorderIcons;
      public
        { Public declarations }
      protected
        procedure WndProc(var Msg:TMessage);override;
        procedure WMNCHitTest(var Msg:TWMNCHitTest);message WM_NCHITTEST;
      end;var
      zypNeoForm: TzypNeoForm;implementation{$R *.DFM}
    const
      cTopHeight=50;
      cRightTopWidth=97;
      cLeftWidth=10;
      cRightWidth=10;
      cBottomHeight=12;
      cMaxWidth=800;
      cMaxHeight=600;
      cMinWidth=300;
      cMinHeight=200;
      cPenWidth=3;
      cIconTop=6;
    procedure TzypNeoForm.WMNCHitTest(var Msg:TWMNCHitTest);
    var
      pt:TPoint;
    begin
    if (GetCanReSize=False) or (WindowState<>wsNormal) then
      begin
      inherited;
      exit;
      end;
    pt:=Point(Msg.xPos,Msg.yPos);
    pt:=ScreenToClient(pt);
    if (pt.x<5) and (pt.y<5) then Msg.Result:=htTopLeft
    else if (pt.x>width-5) and (pt.y<5) then Msg.Result:=htTopRight
    else if (pt.x>width-5) and (pt.y>height-5) then Msg.Result:=htBottomRight
    else if (pt.x<5) and (pt.y>height-5) then Msg.Result:=htBottomLeft
    else if (pt.x<5) then Msg.Result:=htLeft
    else if (pt.y<5) then Msg.Result:=htTop
    else if (pt.x>width-5) then Msg.Result:=htRight
    else if (pt.y>height-5) then Msg.Result:=htBottom
    else inherited;
    end;procedure TzypNeoForm.SetBorderIcons;
    begin
    case BorderStyle of
      bsToolWindow,
      bsSizeToolWin,
      bsDialog:
        begin
        FzypNeoBorderIcons[1]:=True;
        FzypNeoBorderIcons[2]:=False;
        FzypNeoBorderIcons[3]:=False;
        ImageIcon.Visible:=False;
        ImageIcon.Enabled:=False;
        end;
      bsNone:     //虽然设为bsNone,但是仍然有Caption栏,如果连Caption栏都不想要的话,
        begin     //老兄,我劝你还是不要用我的这个Form了。
        FzypNeoBorderIcons[1]:=False;
        FzypNeoBorderIcons[2]:=False;
        FzypNeoBorderIcons[3]:=False;
        ImageIcon.Visible:=False;
        ImageIcon.Enabled:=False;
        end;
    else
        FzypNeoBorderIcons[1]:=True;
        FzypNeoBorderIcons[2]:=True;
        FzypNeoBorderIcons[3]:=True;
        ImageIcon.Visible:=True;
        ImageIcon.Enabled:=True;
        end;
    if biSystemMenu in BorderIcons then
      begin
      FzypNeoBorderIcons[1]:=FzypNeoBorderIcons[1] and True;
      FzypNeoBorderIcons[2]:=FzypNeoBorderIcons[2] and True;
      FzypNeoBorderIcons[3]:=FzypNeoBorderIcons[3] and True;
      ImageIcon.Visible:=ImageIcon.Visible and True;
      ImageIcon.Enabled:=ImageIcon.Enabled and True;
      end
    else
      begin
      FzypNeoBorderIcons[1]:=FzypNeoBorderIcons[1] and False;
      FzypNeoBorderIcons[2]:=FzypNeoBorderIcons[2] and False;
      FzypNeoBorderIcons[3]:=FzypNeoBorderIcons[3] and False;
      ImageIcon.Visible:=ImageIcon.Visible and False;
      ImageIcon.Enabled:=ImageIcon.Enabled and False;
      end;
    if biMinimize in BorderIcons then
      begin
      FzypNeoBorderIcons[3]:=FzypNeoBorderIcons[3] and True;
      end
    else
      begin
      FzypNeoBorderIcons[3]:=FzypNeoBorderIcons[3] and False;
      end;
    if biMaximize in BorderIcons then
      begin
      FzypNeoBorderIcons[2]:=FzypNeoBorderIcons[2] and True;
      end
    else
      begin
      FzypNeoBorderIcons[2]:=FzypNeoBorderIcons[2] and False;
      end;
    ImageClose.Visible:=FzypNeoBorderIcons[1];
    ImageClose.Enabled:=FzypNeoBorderIcons[1];
    ImageMax.Visible:=FzypNeoBorderIcons[2];
    ImageMax.Enabled:=FzypNeoBorderIcons[2];
    ImageMin.Visible:=FzypNeoBorderIcons[3];
    ImageMin.Enabled:=FzypNeoBorderIcons[3];
    end;procedure TzypNeoForm.SetCanResize(value:Boolean);
    begin
    if FCanResize<>value then FCanResize:=value;
    end;function TzypNeoForm.GetcanResize;
    begin
    Result:=FCanResize;
    end;procedure TzypNeoForm.WndProc(var Msg:TMessage);
    begin
    inherited WndProc(Msg);
    if Msg.Msg=WM_ACTIVATE then
      begin
      case Msg.WParamLo of
        WA_ACTIVE,WA_CLICKACTIVE:
          begin
          ImageTop.Picture:=ImageActiveTop.Picture;
          ImageLeftTop.Picture:=ImageActiveLeftTop.Picture;
          ImageRightTop.Picture:=ImageActiveRightTop.Picture;
          end;
        WA_INACTIVE:
          begin
          ImageLeftTop.Picture:=ImageDeactiveLeftTop.Picture;
          ImageTop.Picture:=ImageDeactiveTop.Picture;
          ImageRightTop.Picture:=ImageDeactiveRightTop.Picture;
          end;
        end;
      end;
    end;procedure TzypNeoForm.FormCreate(Sender: TObject);
    begin
    PanelBKGND.Color:=TColor($00CFCFCF);
    Width:=PanelBKGND.Width+cLeftWidth+cRightWidth;
    Height:=PanelBKGND.Height+cTopHeight+cBottomHeight-2;
    LabelCaption.Caption:=Caption;
    SetBorderIcons;
    SetCanResize(False);
    BorderStyle:=bsNone;
    FormResize(Sender);
    end;procedure TzypNeoForm.FormResize(Sender: TObject);
    var
      i:Integer;
    begin
    ImageTop.Left:=0;
    ImageTop.Top:=0;
    ImageTop.Width:=ClientWidth;
    ImageBottom.Width:=ClientWidth;
    ImageBottom.Top:=ClientHeight-cBottomHeight;
    ImageLeft.Height:=ClientHeight;
    ImageRight.Height:=ClientHeight;
    ImageRight.Left:=ClientWidth-cRightWidth;
    ImageLeftBottom.left:=0;
    ImageLeftBottom.Top:=ClientHeight-cBottomHeight;
    ImageRightBottom.Top:=ClientHeight-cBottomHeight;
    ImageRightBottom.Left:=ClientWidth-cRightWidth;
    ImageRightTop.Left:=ClientWidth-cRightTopWidth;
    ImageRightTop.top:=0;
    ImageLeftTop.Left:=0;
    ImageLeftTop.Top:=0;
    PanelBKGND.Left:=cLeftWidth;
    PanelBKGND.Top:=cTopHeight;
    PanelBKGND.Width:=ClientWidth-cLeftWidth-cRightWidth;
    PanelBKGND.Height:=ClientHeight-cTopHeight-cBottomHeight+2;
    ImageMin.top:=cIconTop;
    ImageMax.top:=cIconTop;
    ImageNormal.Top:=cIconTop;
    ImageClose.top:=cIconTop;
    i:=1;
    if FzypNeoBorderIcons[1] then
      begin
      ImageClose.Left:=Width-3-i*17-2;
      Inc(i);
      end;
    if FzypNeoBorderIcons[2] then
      begin
      ImageMax.Left:=Width-3-i*17-2;
      ImageNormal.Left:=ImageMax.Left;
      Inc(i);
      end;
    if FzypNeoBorderIcons[3] then
      begin
      ImageMin.Left:=Width-3-i*17-2;
      end;
    LabelCaption.Left:=ImageLeftTop.Left;
    LabelCaption.Width:=PanelBKGND.Width;
    if FzypNeoBorderIcons[2] then
     if WindowState=wsMaximized then
      begin
      ImageNormal.Enabled:=True;
      ImageNormal.Visible:=True;
      ImageMax.Enabled:=False;
      ImageMax.Visible:=False;
      end
     else
      begin
      ImageNormal.Enabled:=False;
      ImageNormal.Visible:=False;
      ImageMax.Enabled:=True;
      Imagemax.Visible:=True;
      end;
    end;procedure TzypNeoForm.ImageTopMouseDown(Sender: TObject;
      Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
    begin
    FisDown:=True;
    GetCursorPos(FOldP);
    end;procedure TzypNeoForm.ImageTopMouseMove(Sender: TObject; Shift: TShiftState;
      X, Y: Integer);
    begin
    if not FisDown then exit;
    GetCursorPos(Fp);
    FDetaX:=Fp.x-Foldp.x;
    FDetaY:=FP.y-FOldP.y;
    SetBounds(Left+FDetaX,Top+FDetaY,Width,Height);
    GetCursorPos(FOldP);
    end;procedure TzypNeoForm.ImageTopMouseUp(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    begin
    FisDown:=false;
    end;procedure TzypNeoForm.FormCanResize(Sender: TObject; var NewWidth,
      NewHeight: Integer; var Resize: Boolean);
    begin
    if NewWidth>=cMaxWidth then NewWidth:=cMaxWidth;
    if NewWidth<=cMinWidth then NewWidth:=cMinWidth;
    if NewHeight>=cMaxHeight then NewHeight:=cMaxHeight;
    if NewHeight<=cMinHeight then NewHeight:=cMinHeight;
    end;end.
      

  2.   

    将窗体设置为StayonTop 不行啊.
      

  3.   

    不会不行吧,我正在做得也是这样一个程序,StayonTop就可以啊,而且百试百灵