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 

Minimizing An Application

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.misc
View previous topic :: View next topic  
Author Message
Gary Gee
Guest





PostPosted: Sat Nov 15, 2003 11:14 am    Post subject: Minimizing An Application Reply with quote



I have an application that has a main form and several other forms. When the
user minimizes one of the other forms (not the main form), I want to call
Application.Minimize to minimize the whole application. How do I detect in a
form that it's been minimized?

Gary


Back to top
J French
Guest





PostPosted: Sat Nov 15, 2003 12:20 pm    Post subject: Re: Minimizing An Application Reply with quote



On Sat, 15 Nov 2003 11:14:54 GMT, "Gary Gee" <ggee (AT) socal (DOT) rr.com>
wrote:

Quote:
I have an application that has a main form and several other forms. When the
user minimizes one of the other forms (not the main form), I want to call
Application.Minimize to minimize the whole application. How do I detect in a
form that it's been minimized?

Try this :-

procedure TForm1.Timer1Timer(Sender: TObject);
begin
If IsIconic(Application.Handle) Then
Self.Caption := 'Minimized'
Else
Self.Caption := 'Normal';

Application.Title := Self.Caption;

end;


Back to top
Rob Kennedy
Guest





PostPosted: Sat Nov 15, 2003 7:19 pm    Post subject: Re: Minimizing An Application Reply with quote



Gary Gee wrote:
Quote:
I have an application that has a main form and several other forms.
When the user minimizes one of the other forms (not the main form), I
want to call Application.Minimize to minimize the whole application.
How do I detect in a form that it's been minimized?

Take a look at TCustomeForm.WMSysCommand. It checks the message code for
sc_Minimize and forwards the message to Application instead of letting
the default handler minimize the form.

--
Rob


Back to top
J French
Guest





PostPosted: Sun Nov 16, 2003 11:27 am    Post subject: Re: Minimizing An Application Reply with quote

On Sat, 15 Nov 2003 12:20:37 +0000 (UTC), [email]erewhon (AT) nowhere (DOT) com[/email] (J
French) wrote:

Quote:
On Sat, 15 Nov 2003 11:14:54 GMT, "Gary Gee" wrote:

I have an application that has a main form and several other forms. When the
user minimizes one of the other forms (not the main form), I want to call
Application.Minimize to minimize the whole application. How do I detect in a
form that it's been minimized?

I should read the post more carefully


This is a cludge - but it seems to work

procedure TForm2.FormDeactivate(Sender: TObject);
begin
If Self.WindowState = wsMinimized Then
Application.Minimize ;
end;


Back to top
Maarten Wiltink
Guest





PostPosted: Sun Nov 16, 2003 7:13 pm    Post subject: Re: Minimizing An Application Reply with quote

"Rob Kennedy" <.> wrote

Quote:
Gary Gee wrote:

I have an application that has a main form and several other forms.
When the user minimizes one of the other forms (not the main form), I
want to call Application.Minimize to minimize the whole application.
How do I detect in a form that it's been minimized?

Take a look at TCustomeForm.WMSysCommand. It checks the message code for
sc_Minimize and forwards the message to Application instead of letting
the default handler minimize the form.

ENOSUCHMETHOD. You must have a different Delphi version than I (that
is, D>5).

From the form of the method name, I infer that you mean the message
handler for WM_SYSCOMMAND. Be careful, message handlers are indexed
on message, not on name. There is only a _convention_ for the name.

Groetjes,
Maarten Wiltink



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.misc 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.