Sign in Join
FPDoc Onlineexperiment

TApplication class

In unit Forms

Application management and configuration for a GUI application.

Declaration

pascal
TApplication = class(TCustomApplication)

Inheritance

  1. TApplication
  2. TCustomApplication
  3. TComponent
  4. TPersistent
  5. TObject

Description

TApplication is a TCustomApplication descendant which provides facilities used to manage and configure a GUI application. Properties, methods, and event handlers are provided which allow a program to create, execute, monitor, maintain and destroy an application and its forms. Every GUI application contains an Application variable that represents the TApplication or descendent class instance.

TApplication provides a message processing loop that includes hooks for event handlers and exception handling, and supports dispatching messages for TCustomAction instances used in application forms. TApplication provides support for hints and content-sensitive help for forms and controls used in the application. Convenience methods, like MessageBox, are provided to simplify access to dialogs and error messages in the application.

For the macOS Carbon widgetset, an application is executed via the Application Bundle. As a result, command line parameters are not available to the application instance. The OnDropFiles event handler must be used to detected when associated files need to be opened.

See also

Properties

ActivepublicTrue if the application is focused.
ActiveFormHandlepublic
ApplicationTypepublicThe type of the application (i.e. the sort of device for which it is intended).
BidiModepublicThe bidirectional mode to use.
CaptureExceptionspublicEnables exception handling in the Application.
DoubleBufferedpublicIndicates if the application uses double buffering.
ExtendedKeysSupportpublicControls whether extended key codes are available in key down and key up messages.
ExceptionDialogpublicIndicates the dialog type used for an exception in the application.
FindGlobalComponentEnabledpublicEnables searching for global components by name.
FlagspublicContains state flags for the application.
GlyphDrawEffectsEnabledpublicIndicates whether drawing effects are enabled for mouse-over and mouse-down events for button glyphs in the application.
HandlepublicProvides access to the handle for the application instance.
HintpublicThe current Hint text active for the application.
HintColorpublicThe background color for a Hint window.
HintHidePausepublicIndicates how long a Hint remains visible after the mouse pointer is moved.
HintHidePausePerCharpublicIndicates how long a keystroke extends the time a Hint remains visible (added to HintHidePause).
HintPausepublicThe delay before a Hint is shown for a form or control.
HintShortCutspublicEnables or disables display of keyboard shortcuts (e. g. on menu items).
HintShortPausepublicThe pause before a different Hint is displayed.
IconpublicThe icon associated with this application.
LayoutAdjustmentPolicypublicIndicates the layout and sizing policy used for forms and controls in the application.
NavigationpublicAllows switching between controls using keyboard navigation.
MainFormpublicContains the main form for the application.
MainFormHandlepublicWindow handle for the MainForm in the application.
MainFormOnTaskBarpublicControls whether a button is displayed on the task bar for the main form in the application.
ModalLevelpublicThe number of modal forms shown.
MoveFormFocusToChildrenpublicIndicates if an active control is focused when a form receives focus.
MouseControlpublicContains the control currently under the mouse pointer.
TaskBarBehaviorpublicIndicates how forms are represented in the task bar.
UpdateFormatSettingspublicIndicates if application format settings are updated when changed in a widgetset class.
ShowButtonGlyphspublicAllows the platform defaults for glyphs on buttons to be overridden.
ShowMenuGlyphspublicSets the default policy for showing or hiding glyph images in menus.
ShowHintpublicIndicates if Hints are displayed for the application.
ShowMainFormpublicAllows the main form to be shown or hidden when an application is started.
TitlepublicContains the title for the application.
ScaledpublicIndicates if forms and controls in the application can be scaled to different display densities (Pixels per Inch).

Methods

GetConsoleApplicationprotectedAlways returns False for a GUI application.
NotifyIdleHandlerprotectedSignals all idle handlers for the application.
NotifyIdleEndHandlerprotectedNotifies all Idle End handlers when a new message has arrived.
NotifyActivateHandlerprotectedNotifies all Activate handlers for the application.
NotifyDeactivateHandlerprotectedNotifies all Deactivate handlers for the application.
NotifyCustomFormsprotectedPerforms the specified message for all custom forms in the application.
IsHintMsgprotectedExists for Delphi compatibility only.
DoOnHelpprotectedSignals an OnHelp event handler.
DoOnMouseMoveprotectedOnMouseMove message handler, updates the Hint.
ShowHintWindowprotectedShows or hides the hint window for a control in the application.
OnHintTimerprotectedImplements an event handler signalled when the timer for a hint display has elapsed.
SetTitleprotectedSets the value for the Title property.
StartHintTimerprotectedStarts the timer for display of a hint message.
UpdateVisibleprotectedAsks the widgetset to update its task bar entries.
DoIdleActionsprotectedUpdates all Actions and hides splash screens.
MenuPopupHandlerprotectedImplements the OnMenuPopupHandler for the application.
HasAsyncCallQueuedprotectedIndicates whether there are unprocessed asynchronous calls pending in the application queue.
ProcessAsyncCallQueueprotectedCalls all methods queued in QueueAsyncCall.
DoDecLCLRefcountToZeroprotectedPerforms actions needed when the reference count for a TLCLComponent instance reaches 0 in the application.
FreeComponentprotectedDestroys all components marked for release.
ReleaseComponentsprotectedDestroys all components marked for release.
DoBeforeFinalizationprotectedDestroys all components.
GetParamsprotectedReturns the command line argument at the specified ordinal position.
DoLogprotectedPerforms actions needed to implement the Log method.
CreatepublicConstructor for the class instance.
DestroypublicDestructor for the class instance.
ActivateHintpublicConfigures a hint window for the specified mouse position.
GetControlAtMousepublicGets the control under the mouse pointer.
GetControlAtPospublicGets the control which contains the specified position, and optionally updates the internal tracking members for mouse capture when needed.
ControlDestroyedpublicClears all references to the destroyed control.
BigIconHandlepublicReturns the Handle for the large application Icon.
SmallIconHandlepublicReturns the Handle for the small application Icon.
BringToFrontpublicAsks the widgetset to bring the last form for the application in front of all other programs.
CreateFormpublicCreates a Form or component owned by the Application instance.
UpdateMainFormpublicMakes the specified form the MainForm in the Application.
QueueAsyncCallpublicInserts an asynchronous call into the queue.
RemoveAsyncCallspublicRemoves all calls added via QueueAsyncCall.
ReleaseComponentpublicSafely destroys a component used in the application.
ExecuteActionpublicSignals an OnActionExecute handler (when assigned).
UpdateActionpublicSignals an OnActionUpdate handler (when assigned).
HandleExceptionpublicHandleException method for handling an exception; attempts to maintain program execution if possible, otherwise exits gracefully.
HandleMessagepublicHandles pending messages, and enters the Idle state.
HelpCommandpublicShow help.
HelpContextpublicShows context-sensitive help for the application.
HelpKeywordpublicShows help for the specified keyword.
HelpShowTableOfContentspublicDisplays the Help Table of Contents using the Help Manager for the application.
ShowHelpForObjectpublicWhen Sender is a TControl, invoke its ShowHelp method.
RemoveStayOnToppublicRemoves the StayOnTop attribute from all visible forms in the application.
RestoreStayOnToppublicRestores StayOnTop for all forms changed by RemoveStayOnTop.
IsWaitingpublicTrue if the application is waiting for a message event.
CancelHintpublicCalled when the Hint timer has expired to stop showing the Hint.
HideHintpublicHides the Hint window.
HintMouseMessagepublicCalled when the mouse is over a control with a Hint.
InitializepublicInitializes the widgetset (and more).
MessageBoxpublicDisplay an message dialog with response buttons.
MinimizepublicAsks the widgetset to minimize the application.
ModalStartedpublicCalled when a modal form display is started.
ModalFinishedpublicCalled when a modal form is closed.
RestorepublicRestores a previously minimized application.
NotificationpublicPerforms actions when a component is added to or removed from the application.
ProcessMessagespublicCall this method during lengthy operations to ensure the GUI remains responsive.
IdlepublicCalled when the application enters the idle state.
RunpublicLoads the form and passes control to the event loop for the application.
ShowExceptionpublicShows the message for the specified exception and asks the user to abort or continue.
TerminatepublicThe application is terminated and the component engine is shutdown.
DisableIdleHandlerpublicDisables Idle handling.
EnableIdleHandlerpublicResumes Idle handling.
NotifyUserInputHandlerpublicNotifies all user input handlers of the specified message.
NotifyKeyDownBeforeHandlerpublicNotifies all ahtKeyDownBefore handlers.
NotifyKeyDownHandlerpublicNotifies all ahtKeyDownAfter handlers, and eventually reacts to F1 (Help).
ControlKeyDownpublicHandles KeyDown events in a Control, e.g. handles navigation keys.
ControlKeyUppublicHandles KeyUp events in a Control, e.g. handles Enter and Esc keys.
AddOnIdleHandlerpublicAdds an application Idle handler to the list of handlers for the type.
RemoveOnIdleHandlerpublicRemoves an application Idle handler for the list of handlers for the type.
AddOnIdleEndHandlerpublicAdds an application IdleEnd handler to the list of handlers for the type.
RemoveOnIdleEndHandlerpublicRemoves an application IdleEnd handler.
AddOnUserInputHandlerpublicAdds an application user input handler to the list of handlers for the type.
RemoveOnUserInputHandlerpublicRemoves an application user input handler from the list of handlers for the type.
AddOnKeyDownBeforeHandlerpublicAdds an application key down before interface handler.
RemoveOnKeyDownBeforeHandlerpublicRemoves an application key down before interface handler.
AddOnKeyDownHandlerpublicAdds an application key down handler to the list for the type.
RemoveOnKeyDownHandlerpublicRemoves an application key down after interface handler.
AddOnActivateHandlerpublicAdds an application activation handler.
RemoveOnActivateHandlerpublicRemoves an application activation handler.
AddOnDeactivateHandlerpublicAdds an application deactivation handler.
RemoveOnDeactivateHandlerpublicRemoves an application deactivation handler.
AddOnExceptionHandlerpublicAdds an application exception handler.
RemoveOnExceptionHandlerpublicRemoves an application exception handler.
AddOnEndSessionHandlerpublicAdds an application logoff handler.
RemoveOnEndSessionHandlerpublicRemoves an application logoff handler.
AddOnQueryEndSessionHandlerpublicAdds an application logoff query handler.
RemoveOnQueryEndSessionHandlerpublicRemoves an application logoff query handler.
AddOnMinimizeHandlerpublicAdds an application minimizing handler.
RemoveOnMinimizeHandlerpublicRemoves an application minimizing handler.
AddOnModalBeginHandlerpublicAdds an application becoming modal handler.
RemoveOnModalBeginHandlerpublicRemoves an application becoming modal handler.
AddOnModalEndHandlerpublicAdds an application exiting modal state handler.
RemoveOnModalEndHandlerpublicRemoves an application exiting modal state handler.
AddOnRestoreHandlerpublicAdds an application exiting minimized state handler.
RemoveOnRestoreHandlerpublicRemoves an application exiting minimized state handler.
AddOnDropFilesHandlerpublicAdds an application dropped files handler.
RemoveOnDropFilesHandlerpublicRemoves an application dropped files handler.
AddOnHelpHandlerpublicAdds an application Help handler.
RemoveOnHelpHandlerpublicRemoves an application Help handler.
AddOnHintHandlerpublicAdds an application Hint handler.
RemoveOnHintHandlerpublicRemoves an application Hint handler.
AddOnShowHintHandlerpublicAdds an application Hint show handler to the list for the handler type.
RemoveOnShowHintHandlerpublicRemoves an application Hint show handler from the list for the handler type.
AddOnGetMainFormHandleHandlerpublicAdds a handler signalled when the application MainForm handle is retrieved.
RemoveOnGetMainFormHandleHandlerpublicRemoves a handler used to get the handle for the main form in the application.
AddOnActionExecuteHandlerpublicAdds the specified routine to the list of ahtActionExecute handlers for the application.
RemoveOnActionExecuteHandlerpublicRemoves the specified routine from the list of ahtActionExecute handlers for the application.
AddOnActionUpdateHandlerpublicAdds the specified routine to the list of ahtActionUpdate handlers for the application.
RemoveOnActionUpdateHandlerpublicRemoves the specified routine from the list of ahtActionUpdate handlers for the application.
RemoveAllHandlersOfObjectpublicRemoves all handlers implemented for the specified object.
DoBeforeMouseMessagepublicPerforms actions needed before a mouse message is processed in the application.
IsShortcutpublicChecks whether a handler is available for the shortcut key in the message.
IntfQueryEndSessionpublicCalled by the interface to confirm the end of a session.
IntfEndSessionpublicCalled by the interface when the session ends.
IntfAppActivatepublicCalled by the interface on application activation.
IntfAppDeactivatepublicCalled by the interface on application deactivation.
IntfAppMinimizepublicCalled by the interface when the application is minimized.
IntfAppRestorepublicCalled by the interface when the application is restored.
IntfDropFilespublicCalled by the interface when files have been dropped.
IntfSettingsChangepublicCalled when the WM_SETTINGCHANGE message is handled for the application.
IntfThemeOptionChangepublicCalled by the interface when a theme option has changed.
IsRightToLeftpublicIndicates if BiDiMode contains a value other than bdLeftToRight.
IsRTLLangpublicChecks the given language name for use of right-to-left reading.
DirectionpublicGets the TBidiMode value with the direction for the specified language name.
DoArrowKeypublicUses arrow keys for navigation, if enabled.
DoTabKeypublicUses the Tab key for navigation, if enabled.
DoEscapeKeypublicInterprets Esc as Cancel action, if applicable.
DoReturnKeypublicInterprets Enter as the default action, if applicable.

Events

OnActionExecutepublicDefault handler for unhandled Actions.
OnActionUpdatepublicEvent handler signalled to update actions used in the application.
OnActivatepublicEvent handler signalled when an Activate message is handled in the application.
OnDeactivatepublicEvent handler signalled when a Deactivate message is handled in the application.
OnGetMainFormHandlepublicEvent handler used to provide a value for the MainFormHandle property.
OnIdlepublicEvent handler signalled when the application enters the idle state.
OnIdleEndpublicEvent handler signalled when the application leaves the Idle state.
OnEndSessionpublicEvent handler signalled when a session is ended in the application.
OnQueryEndSessionpublicEvent handler signalled to determine if the current session be be ended, and the application can be closed.
OnMinimizepublicEvent handler signalled when the application is minimized.
OnMessageDialogFinishedpublicEvent handler signalled when a message dialog in the application has been completed.
OnModalBeginpublicEvent handler signalled when a form in the application is displayed as a modal form.
OnModalEndpublicEvent handler signalled when the last modal form for the application has been exited.
OnRestorepublicEvent handler signalled when the application is restored from a minimized / maximized state.
OnDropFilespublicEvent handler signalled when file(s) are dropped into the application.
OnHelppublicEvent handler signalled when help is requested in the application.
OnHintpublicEvent handler signalled when a hint is requested in the application.
OnShortcutpublicEvent handler signalled to determine if a keystroke message is a shortcut key in the application.
OnShowHintpublicEvent handler signalled prior to displaying a hint window.
OnUserInputpublicEvent handler signalled to handle user input messages.
OnLogpublicEvent handler signalled for log messages written by the application.
OnDestroypublicEvent handler signalled when the application is freed.
OnCircularExceptionpublicEvent handler signalled when a circular exception occurs before the application is halted.

Inherited

From TCustomApplication (31)

AbortRun CaseSensitiveLongOptions CaseSensitiveOptions CaseSensitiveShortOptions CheckOptions ConsoleApplication DoRun EnvironmentVariable EventLogFilter ExceptionExitCode ExeName FindOptionIndex GetEnvironmentList GetNonOptions GetOptionAtIndex GetOptionValue GetOptionValues GetParamCount HasOption HelpFile Location Log OnException OptionChar ParamCount Params SingleInstance SingleInstanceClass SingleInstanceEnabled StopOnException Terminated

From TComponent (71)

_AddRef _Release BeforeDestruction CanObserve ChangeName ComObject ComponentCount ComponentIndex Components ComponentState ComponentStyle DefineProperties DesignInfo DestroyComponents Destroying FindComponent FreeNotification FreeOnRelease GetChildOwner GetChildParent GetChildren GetDeltaStreams GetEnumerator GetIDsOfNames GetNamePath GetObservers GetOwner GetParentComponent GetTypeInfo GetTypeInfoCount HasParent iicrGetComponent InsertComponent Invoke IsImplementorOf Loaded Loading Name ObserverAdded Observers OnGetDeltaStreams Owner PaletteCreated QueryInterface ReadDeltaState ReadDeltaStream ReadState ReferenceInterface RemoveComponent RemoveFreeNotification RemoveFreeNotifications SafeCallException SetAncestor SetChildOrder SetDesigning SetDesignInstance SetInline SetName SetParentComponent SetSubComponent Tag ToString TToStringNameMode Updated UpdateRegistry Updating ValidateContainer ValidateInsert ValidateRename VCLComObject WriteState

From TPersistent (5)

Assign AssignTo FPOAttachObserver FPODetachObserver FPONotifyObservers

From TObject (37)

AfterConstruction CheckDisposed ClassInfo ClassName ClassNameIs ClassParent ClassType CleanupInstance DefaultHandler DefaultHandlerStr Dispatch DispatchStr Disposed DisposeOf Equals FieldAddress Free FreeInstance GetDisposed GetHashCode GetInterface GetInterfaceByStr GetInterfaceEntry GetInterfaceEntryByStr GetInterfaceTable GetInterfaceWeak GetLastCastErrorInfo InheritsFrom InitInstance InstanceSize MethodAddress MethodName newinstance QualifiedClassName StringMessageTable SystemHasExtendedRTTI UnitName

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.