Implements a Windows message.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Thetype exposes the following members.
|HWnd||Gets or sets the window handle of the message.|
|LParam||Specifies the LParam field of the message.|
|Msg||Gets or sets the ID number for the message.|
|Result||Specifies the value that is returned to Windows in response to handling the message.|
|WParam||Gets or sets the WParam field of the message.|
|Create||Creates a new .|
|Equals||Determines whether the specified object is equal to the current object. (Overrides ValueType.Equals(Object).)|
|GetHashCode||Returns the hash code for this instance. (Overrides ValueType.GetHashCode().)|
|GetLParam||Gets the LParam value and converts the value to an object.|
|GetType||Gets the Type of the current instance. (Inherited from Object.)|
|ToString||Infrastructure. Returns a String that represents the current . (Overrides ValueType.ToString().)|
The structure wraps messages that Windows sends. You can use this structure to wrap a message and assign it to the window procedure to be dispatched. You can also use this structure to get information about a message the system sends to your application or controls. For more information about Windows messages, see Messages and Message Queues.
You cannot create the directly. Instead, use the Create method. For the sake of efficiency, the uses its pool of existing s instead of instantiating a new one, if possible. However, if a is not available in the pool, a new one is instantiated.
The following code example demonstrates overriding the WndProc method to handle operating system messages identified in the . The WM_ACTIVATEAPP operating system message is handled in this example to know when another application is becoming active. For information about the available Message.Msg, Message.LParam, and Message.WParam values, see the MSG Structure documentation. For information about the actual constant values, see Message Constants.
Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.