Accessing a Running Application in Visual Basic

This section contains topics that cover how to use the Visual Basic Application model to control the application's run-time behavior, and topics that cover how to get run-time information about the application.

The My.Application object provides properties, methods, and events related to the current application. It allows you to get information about the application, such as the current culture, how the application was deployed, and the environment variables. The Visual Basic Application model exposed by the My.Application object allows an application to run code when the application starts up and shuts down. Similarly, the My.Application.Deployment property provides the current application's ClickOnce deployment object.

Tasks

To

See

Allow your application to handle other events that might be raised while your code runs

DoEvents

Determine the application's command-line arguments

How to: Access Command-Line Arguments (Visual Basic)

Check if the application started with the string "/batch" as an argument

How to: Enable a Batch Mode for Window Forms Applications (Visual Basic)

Handle any uncaught exception in your application

UnhandledException

Use the events provided by the Visual Basic Application model to run code when the application starts or ends

How to: Run Code When the Application Starts or Ends (Visual Basic)

Check the command-line arguments of subsequent attempts to start a single-instance application

StartupNextInstance

Download and install the latest version of a ClickOnce application

How to: Download ClickOnce Application Updates (Visual Basic)

See Also

Tasks

How to: Specify Assembly Information (Visual Basic, C#)

Reference

ApplicationBase

Microsoft.VisualBasic.Logging.Log

Info

Concepts

Overview of the Visual Basic Application Model

Logging Information from the Application (Visual Basic)