Delphi 任務欄中不顯示窗口


目的:

1. 窗口不在任務欄顯示。

2. 窗口不顯示在Alt+Tab的切換列表中。

3. 在任務管理器的應用程序列表中不顯示。

示例:

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.ExStyle := WS_EX_TOOLWINDOW;
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;

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM