Solved

Form ONMinimize Event, how?

Posted on 1998-06-10
8
2,117 Views
Last Modified: 2008-02-01
How to get informed when main form is minimized,
(or maximized again)
0
Comment
Question by:bor061297
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

726 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