Solved

Form ONMinimize Event, how?

Posted on 1998-06-10
8
2,066 Views
Last Modified: 2008-02-01
How to get informed when main form is minimized,
(or maximized again)
0
Comment
Question by:bor061297
8 Comments
 
LVL 5

Expert Comment

by:inter
ID: 1352096
Hi,
When you main form is minimized the Application objects OnMinimize is called. Respectively when you press the application icon on the taskbar Application's OnRestore event is triggered. Seek TApplication from Delphi Help and find OnMinimize event example.
Regards, Igor
0
 
LVL 4

Expert Comment

by:BoRiS
ID: 1352097
bor

Inter is a hundered percent right, here is a code snippit to show a message when the form is minimized and maximized...

first add this to the type section (looks like this)
type
  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
    procedure AppMinMessage(Sender: TObject);//here is first
    procedure AppMaxMessage(Sender: TObject);//here is secound

then pass the procedures like so...

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

procedure TForm1.AppMinMessage(Sender: TObject);
begin
 ShowMessage('Minimize');
end;

procedure TForm1.AppMaxMessage(Sender: TObject);
begin
 ShowMessage('Maximize');
end;

Hope this helps...

Later
BoRiS
0
 
LVL 1

Accepted Solution

by:
michaue earned 50 total points
ID: 1352098

     type
       TForm1 = class(TForm)
         procedure FormCreate(Sender: TObject);
         procedure AppMinMessage(Sender: TObject);//here is first
         procedure AppMaxMessage(Sender: TObject);//here is secound

     then pass the procedures like so...

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

     procedure TForm1.AppMinMessage(Sender: TObject);
     begin
      ShowMessage('Minimize');
     end;

     procedure TForm1.AppMaxMessage(Sender: TObject);
     begin
      ShowMessage('Maximize');
     end;
0
 
LVL 4

Expert Comment

by:BoRiS
ID: 1352099
michaue

Good cutting and pasting there, how about using your own code to answer this question or don't answer it at all...(Orginal, but un-called for...)

Bor

Read the comments first before grading this answer...

Later
BoRiS
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 1

Expert Comment

by:michaue
ID: 1352100
Can't blame someone for trying ....

And when you have an answer DON'T use the comment option ....
0
 
LVL 5

Expert Comment

by:JimBob091197
ID: 1352101
michaue, wake up!  I think BoRiS added a comment instead of an answer because he didn't want to step on Inter's toes!  (Unlike some people...)

JB
0
 
LVL 4

Expert Comment

by:BoRiS
ID: 1352102
michaue

Good cutting and pasting there, how about using your own code to answer this question or don't answer it at all...(Orginal, but un-called for...)

Bor

Read the comments first before grading this answer...

Later
BoRiS
0
 
LVL 1

Expert Comment

by:michaue
ID: 1352103
OK OK, but still then this question just lies there and gets historic or should I say pre-historic.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
delphi exception 7 61
FMX StringGrid1->Canvas->FillRect Problem 3 127
Need Help Delphi 2010 CheckBox1 Stored value in memo 13 56
Graphics32 under Delphi 10.1 Berlin 2 34
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now