Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bring to front... 1

Status
Not open for further replies.

chunkyman

IS-IT--Management
Aug 10, 2007
10
MT
Hi,
I am trying to get my app to appear in front of all the other windows when executed.
I tried some methods that I found on the net.
To try it out I ran Task Manager and left it open.
My app never made it in front of Task manager, why???

Thanks
 
that's because Taskmanager has a topmost window.

here's a trick to make your form topmost :

Code:
type
  TForm1 = class(TForm)
  private
   ...
  protected
    procedure CreateParams(var Params: TCreateParams); override;
 public
   ...
  end;
.....
procedure TForm1.CreateParams(var Params: TCreateParams);
begin
 inherited CreateParams(Params);
  with Params do begin
   WndParent := GetDesktopwindow;
   ExStyle := ExStyle or WS_EX_TOPMOST;
 end;
end;

-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
 
Thanks for your input but how would you call this procedure please??
 
well, you don't call it.
createparams is called when the form is created.

just add the
'procedure CreateParams(var Params: TCreateParams); override;
' line in the type definition of your form (interface section) and add the complete procedure in the implementation section...

-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top