Delphi 任务栏中不显示窗口

示例:

type
  TAppWndBrowser = class( TForm )
    published
      procedure CreateParams( var Params: TCreateParams ); override;
      procedure WndProc(var Message: TMessage); override;
  end;

implementation

{$R *.dfm}


{ TAppWndBrowser }
procedure TAppWndBrowser.CreateParams( var Params: TCreateParams );
begin
  inherited CreateParams( Params );
  Params.Style:=WS_CHILD;
end;

procedure TAppWndBrowser.WndProc(var Message: TMessage);
begin
  inherited WndProc(Message);
  if (not Application.MainFormOnTaskBar) and (Message.Msg = WM_SHOWWINDOW) then
  begin
    ShowWindow(Application.Handle, SW_HIDE);
    SetWindowLong(Application.Handle, GWL_EXSTYLE, WS_EX_TOOLWINDOW);
  end;
end;

猜你喜欢

转载自www.cnblogs.com/it89/p/12029526.html