Name

Application

Synopsis

This class provides a variety of static methods to start message processing for a Windows Forms application, and to retrieve information about the execution environment of the current application, including such useful details as the shared and user data paths, registry keys, locale/culture settings, and others.

You can also get notifications of and some control over application startup and shutdown, although the exit notification is not signaled if you use the parameterless version of Run().

Finally, there is a facility to install and remove message filters for your application with AddMessageFilter() and RemoveMessageFilter(). See IMessageFilter for information on this feature.


public sealed class Application {

// Public Static Properties

   public static bool AllowQuit{get; }

   public static string CommonAppDataPath{get; }

   public static RegistryKey CommonAppDataRegistry{get; }

   public static string CompanyName{get; }

   public static CultureInfo CurrentCulture{set; get; }

   public static InputLanguage CurrentInputLanguage{set; get; }

   public static string ExecutablePath{get; }

   public static string LocalUserAppDataPath{get; }

   public static bool MessageLoop{get; }

   public static string ProductName{get; }

   public static string ProductVersion{get; }

   public static string SafeTopLevelCaptionFormat{set; get; }

   public static string StartupPath{get; }

   public static string UserAppDataPath{get; }

   public static RegistryKey UserAppDataRegistry{get; }

// Public Static Methods public ...

Get .NET Windows Forms in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.