0

I have an app which is supposed to be hidden. To hide it from the Taskbar I use:

procedure TForm1.CreateParams(var Params: TCreateParams);
begin
  inherited;
  Params.ExStyle := Params.ExStyle and not WS_EX_APPWINDOW;
  Params.WndParent := Application.Handle;
end;

But that does not remove it from the ALT + TAB menu. How do I remove it from that menu?

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
Codex
  • 101
  • 1
  • 11
  • 2
    Does this answer your question? [Best way to hide a window from the Alt-Tab program switcher?](https://stackoverflow.com/questions/357076/best-way-to-hide-a-window-from-the-alt-tab-program-switcher) – Sasha Dec 19 '21 at 16:34
  • 1
    @Sasha That's for .NET. I use a Delphi Win32 Application – Codex Dec 19 '21 at 16:43
  • 2
    @Codex: But the Win32 solution is given in the accepted answer, isn't it? – Andreas Rejbrand Dec 19 '21 at 16:47
  • It is going to be similar for Delphi since it's a Win32 API. Take a look at this one: http://www.delphigroups.info/2/64/494157.html – Sasha Dec 19 '21 at 16:48
  • 1
    The best way is to not have a [top level window](https://learn.microsoft.com/en-us/windows/win32/winmsg/about-windows#parent-or-owner-window-handle). See also [What exactly is a top-level window in win32 programming?](https://stackoverflow.com/q/18244379/4299358) – AmigoJack Dec 19 '21 at 16:49
  • `Params.ExStyle := Params.ExStyle and (not WS_EX_APPWINDOW) or WS_EX_TOOLWINDOW;` Or, simply set the Form's `BorderStyle` to `bsToolWindow` – Remy Lebeau Dec 19 '21 at 20:11

0 Answers0