BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Stay on top forms problem

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi VCL Components Using
View previous topic :: View next topic  
Author Message
John
Guest





PostPosted: Sun Jul 27, 2003 4:49 pm    Post subject: Stay on top forms problem Reply with quote




My app periodically needs to show a pop-up form, which needs to stay on top when the app is in the foreground. So the pop-up form has fsStayOnTop set and when my app wants to display the form it just Shows it. This works fine with my app in the foreground.

If my app is minimised, then the pop up pops up over the top of whatever app is in the foreground. This is definitely not what's wanted!

Any ideas how to stop the pop-up form from popping up on top of other apps?

Thanks, John.


Back to top
Jari Kettunen
Guest





PostPosted: Sun Jul 27, 2003 5:30 pm    Post subject: Re: Stay on top forms problem Reply with quote



How about this catch the min/max-event and set state-variable and look it
state before showing form.

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls;

type
TForm1 = class(TForm)
Timer1: TTimer;
procedure MinimizeApp(Sender: TObject);
procedure RestoreApp(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
AppState:TWindowState;
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}


procedure TForm1.MinimizeApp(Sender: TObject);
begin
AppState:=wsMinimized;
end;
procedure TForm1.RestoreApp(Sender: TObject);
begin
AppState:=wsNormal;
end;

procedure TForm1.Timer1Timer(Sender: TObject);

begin
if AppState<>wsMinimized then ShowMessage('ok');

end;


procedure TForm1.FormCreate(Sender: TObject);
begin
Application.OnMinimize := MinimizeApp;
Application.OnRestore := RestoreApp;
end;

end.



"John" <john (AT) g3wgv (DOT) com> kirjoitti viestissä
news:3f240286$1 (AT) newsgroups (DOT) borland.com...
Quote:

My app periodically needs to show a pop-up form, which needs to stay on
top when the app is in the foreground. So the pop-up form has fsStayOnTop

set and when my app wants to display the form it just Shows it. This works
fine with my app in the foreground.
Quote:

If my app is minimised, then the pop up pops up over the top of whatever
app is in the foreground. This is definitely not what's wanted!

Any ideas how to stop the pop-up form from popping up on top of other
apps?

Thanks, John.





Back to top
Achim Berg
Guest





PostPosted: Sun Jul 27, 2003 9:59 pm    Post subject: Re: Stay on top forms problem Reply with quote



Wrong parent, I assume.

This works for me with Delphi 7:
create a new application (Form1)
add a Form (Form2), use unit2 in unit 1.
place a button on form1, which sets form2.style to fsStayOnTop and
Form2.visible:= True

Achim

John wrote:
Quote:
My app periodically needs to show a pop-up form, which needs to stay
on top when the app is in the foreground. So the pop-up form has
fsStayOnTop set and when my app wants to display the form it just
Shows it. This works fine with my app in the foreground.

If my app is minimised, then the pop up pops up over the top of
whatever app is in the foreground. This is definitely not what's
wanted!

Any ideas how to stop the pop-up form from popping up on top of other
apps?

Thanks, John.



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi VCL Components Using All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.