ArcObjects Library Reference (Framework)  

IApplication Interface

Provides access to members that query or modify the application.

Product Availability

Available with ArcGIS Desktop.

Description

The Application object is the core object in the ArcMap and ArcCatalog applications. This object represents the application itself and acts as the central point where access is gained to other objects in the system. The Application object's primary interface is IApplication. This interface provides access to the Document object, the extensions, the StatusBar object, the Templates object, the currently selected tool, and the Visual Basic Editor. There are several methods that allow you to open, save, and print documents, lock and unlock the application from user customizations, display dialogs, and exit the application.


Members

Description
Read/write property Caption The caption of this application.
Read/write property CurrentTool The currently selected tool.
Read-only property Document The document that is currently loaded in the application.
Method FindExtensionByCLSID Finds an extension by its CLSID.
Method FindExtensionByName Finds an extension by its name.
Read-only property hWnd The handle of the application's window.
Method IsDialogVisible Indicates if the specified dialog is visible in the application.
Method LockCustomization Locks the application's user interface against any customizations.
Read-only property Name The name of this application.
Method NewDocument Creates a new document in this application.
Method OpenDocument Opens a document in this application.
Method PrintDocument Displays the Print dialog.
Method PrintPreview Displays how the document will look like when it is printed.
Method RefreshWindow Redraws the application window.
Method SaveAsDocument Saves the document that is currently open in this application to a different file.
Method SaveDocument Saves the document that is currently open in this application.
Method ShowDialog Displays the specified dialog in the application.
Method Shutdown Terminates the application.
Read-only property StatusBar The statusbar of this application.
Read-only property Templates The templates collection.
Method UnlockCustomization Unlocks previous user interface customization lock.
Read-only property VBE The Visual Basic Environment.
Read/write property Visible Indicates if the application window is visible.

CoClasses that implement IApplication

CoClasses and Classes Description
Application (esriArcCatalog) ESRI ArcCatalog Application.
Application (esriArcGlobe) ESRI ArcGlobe Application.
Application (esriArcMap) ESRI ArcMap Application
Application (esriArcScene) The 3D Modeling Application.
AppRef A reference to the currently running application.

See Also

IMxApplication Interface | IDocument.Parent Property | ICommand.OnCreate Method

.NET Snippets

Get MxApplication from ArcMap | Get hWnd from ArcGIS Desktop | Animation Progressor | Statements - Get Network Analyst Extension | Get Dockable Window | Get Extension | Get Command on Toolbar by Names | Statements - Get hWnd from ArcGIS Desktop | Get Map from ArcMap | Flip Line Direction | Minimize Application Window | Assign Shortcut Key to Command | Get Editor from ArcMap | Open MxDialog | Get PageLayout from ArcMap | Find Command and Execute | Statements - Use a Tool in a Windows Form | Get Toolbar by Name | Show Progress Dialog | Get ActiveView from ArcMap | Get Document Path | Get Globe from Application | Open StyleManagerDialog | Create Context Menu | Get Network Analyst Extension | Get Contents View from ArcMap | Get MxDocument from ArcMap | Use Custom Tool on Windows Form | Display Template Information in MessageBox | Open GxDialog | Set Tool Active in ToolBar | TimeControl Playback | Get Command by Name | List ArcMap Visible Toolbars | Open StyleReferencesDialog | Display Extension State on Status Bar | Move Application Window to Center |

.NET Samples

Add a custom menu created in .NET to ArcGIS Desktop (Code Files: AddShapefile) | Angle Angle shape constructor (Code Files: AngleAngleCmd) | Applying user interface customizations at startup (Code Files: AcmeExt) | Automate ArcGIS Desktop applications (Code Files: Form1) | Convert part to feature command (Code Files: ConvertPart) | Create a command by inheriting from BaseCommand (Code Files: ZoomToLayer) | Create a custom selection extension by extending ArcObjects (Code Files: SelectByLineTool SelectionCountDockWin SelectionExtension SelectionTargetComboBox SelectionToolPalette ToggleDockWinBtn ZoomToLayerMultiItem) | Create a custom tool (Code Files: DrawGraphicLine) | Custom feedback tool and font drop-down list tool control (Code Files: FontToolControl ToolSample) | Custom subtyped command and tool (Code Files: PolyFeedbackTools ZoomInCommands) | Export any network analysis class to a text file (Code Files: NAClassToTextfileCmd) | Extension implementation (Code Files: ArcEditorOnlyExtension ArcInfoOnlyExtension ArcViewOnlyExtension SimpleExtension) | Extension to listen to document open and save events (Code Files: LogExtension) | Implementing a schematic digitizing tool (Code Files: DigitTool DockableDigit) | Layer filtering TOC view (Code Files: TOCLayerFilter) | Layer property page and property sheet (Code Files: SimpleLayerPropertiesCmd) | Migrating from VB6 to VB .NET for ArcGIS 10 (Code Files: clscopy_table_sel clsCopyTableSelection) | Move a graphic along a path in ArcMap (Code Files: cmdMoveGraphicAlongPath) | Network Analyst barrier location editor (Code Files: EditorForm NABarrierLocationEditor) | Points along line construction tool (Code Files: PointsAlongLineTool) | Recently used filesCommand, MultiItem, and ComboBox (Code Files: CommandRecentFiles RecentFilesCombo RecentFilesRegistryHelper) | Schematic diagram auto refresh (Code Files: Autorefresh FormAutorefresh) | Selection restriction evaluator (Code Files: SelectionRestrictionEvaluator) | Simple logging dockable window with a custom context menu (Code Files: ClearLoggingCommand LoggingDockableWindow LoggingDockableWindowCommand LogLineMultiItemCmd) | StreetMap routing (Code Files: RoutingForm) | Subset network evaluators (Code Files: AddSubsetAttributesCommand AutoUpdateNetworkElementArrayParametersCommand RemoveSubsetAttributesCommand SubsetHelperUI) | Tabbed feature inspector (Code Files: AddEXTCLSID) | ViperPin tool (Code Files: ViperPinTool) | Web browser dockable window (Code Files: ESRIWebsitesWindow ESRIWebsitesWindowCommand) |

.NET Related Topics

Accessing application and document objects | Animation | ArcMapUI | Automating the ArcGIS Desktop applications | Building a context menu with dynamic command items | CatalogUI | Create a command by inheriting from BaseCommand | Create a custom tool | Editor framework customizations | GlobeCore | How to create AOIs and bookmarks | How to create multiple commands or tools in a single class subtyped command | How to find an extension | How to listen to document events | How to load data into a network analysis problem | How to pass the ArcGIS Desktop application from a command or tool | How to use symbol level drawing | How to wire custom events using IActiveViewEvents | Interacting with singleton objects | LocationUI | Migrating VB6 to VB.NET for ArcGIS 10 | NetworkAnalystUI | Performing basic map functions | Publisher | Writing .NET code using properties |