[Lazarus] fsStayOnTop under windows

John vd Waeter john at jvdw.nl
Wed Jan 28 19:52:08 CET 2009


> <Quote>
> "How do I create a window that is never covered by any other windows,
> not even other topmost windows?"
> Imagine if this were possible and imagine if two programs did this.
> Program A creates a window that is "super-topmost" and so does Program
> B. Now the user drags the two windows so that they overlap. What
> happens? You've created yourself a logical impossibility. One of those
> two windows must be above the other, contradicting the imaginary
> "super-topmost" feature.
> </Quote>

That is what Vista is for... see a window through another... so far only 
the borders shine through, but maybe in Windows 7 MS manages to create 
fully transparent forms and you can see both super-topmost forms at the 
same time on the same place.....

But aside the kidding... From my Delphi7 application my customers 
complained about modal forms not being modal. They dissapeared behind 
the mainform and the user had the impression the application got frozen.
This happened for example with my modal login dialog... it just wasn't 
visible...
Someone gave me this solution:

1. Make sure you set the dialogs formstyle to fsStayOnTop

In the declaration of the dialog, just above the 'private'section:

   procedure  CreateParams(var Params: TCreateParams); override;

which has:
procedure TdlgLogIn.CreateParams(var Params: TCreateParams);
begin
   inherited;
   Params.WndParent := TWinControl(Owner).handle;
end;

Don't know what it does exactly, but it sure helped!
It survives all other applications! ;-) Well, that said, the 
taskmanager-form seems to use the same strong stayontop...

fwiw!

kind regards,
John




More information about the Lazarus mailing list