 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Gary Gee Guest
|
Posted: Sat Nov 15, 2003 11:14 am Post subject: Minimizing An Application |
|
|
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
|
Posted: Sat Nov 15, 2003 12:20 pm Post subject: Re: Minimizing An Application |
|
|
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
|
Posted: Sat Nov 15, 2003 7:19 pm Post subject: Re: Minimizing An Application |
|
|
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
|
Posted: Sun Nov 16, 2003 11:27 am Post subject: Re: Minimizing An Application |
|
|
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
|
Posted: Sun Nov 16, 2003 7:13 pm Post subject: Re: Minimizing An Application |
|
|
"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 |
|
 |
|
|
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
|
|