RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCustomApplicationEvents.OnMinimize Event

Occurs when an application is minimized.

Pascal
property OnMinimize: TNotifyEvent;
C++
__property TNotifyEvent OnMinimize;

Write an OnMinimize event handler to perform special processing when the application is minimized. The application is minimized, either because the user minimizes the main window, or because of a call to the Minimize method. The application's Icon property determines the icon that represents the minimized application.

Note: Call the CancelDispatch method from an OnMinimize event handler to prevent the application from forwarding the event to any other application events objects.
 

C++ Examples: 

 

/*
This example requires a TApplicationEvents and a TListBox
in the form.  Select the TApplicationEvents, double click
on the OnMinimize event and add the following code to the
handler.  OnMinimize is triggered when the form is
minimized.
*/
void __fastcall TAppEventForm::ApplicationEventsMinimize(TObject *Sender)
{
  lbOther->Items->Add("Event OnMinimize");
}

 

Delphi Examples: 

{
This example requires a TApplicationEvents and a TListBox
in the form.  Select the TApplicationEvents, double click
on the OnMinimize event and add the following code to the
handler.  OnMinimize is triggered when the form is
minimized.
}
procedure TMainForm.ApplicationEventsMinimize(Sender: TObject);
begin
  lbOther.Items.Add('Event OnMinimize');
end;

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!