Notice Of Closure

Please note that this website is due to close down on 15th June 2020.

In the interim I will try to move as much content as possible over to my GitHub account. Thanks to everyone who has supported the site over the years.

» Help

How to have a form that never activates

   

Things like the start menu, on screen keyboard etc. seem to float on top of everything, but never get focused. Use CreateParams to make the form non focusable.

type
  TForm1 = class(TForm)
  private
    { Private declarations }
  protected
    procedure CreateParams(var Params: TCreateParams); override;
  public
    { Public declarations }
  end;

procedure TForm1.CreateParams(var Params: TCreateParams);
const
  WS_EX_NOACTIVATE = $8000000;
begin
  inherited;
  Params.ExStyle := Params.ExStyle + WS_EX_NOACTIVATE;
end;
Author: logman0u812
Added: 2007-06-02
Last updated: 2007-06-02

« Return to contents »