Message Structure

Implements a Windows-based message.

Namespace: Microsoft.WindowsCE.Forms
Assembly: Microsoft.WindowsCE.Forms (in microsoft.windowsce.forms.dll)

Syntax

'Declaration
Public Structure Message
'Usage
Dim instance As Message
public struct Message
public value class Message
public final class Message extends ValueType
Not applicable.

Remarks

The Message 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 cannot directly create the Message structure. To create a Message structure, use the Create method. For efficiency, the Message structure uses any existing structures from its pool instead of creating an instance of a new one.

Example

The following code example creates and sends a Windows-based message with the identifier of WM_CUSTOMMSG. The message is given the handle of a message window, named MsgWin, to which it sends the messages. The message contains values for the WParam and LParam parameters, which in this example are current x and y mouse coordinates as obtained from MouseEventArgs, e, in an OnMouseMove method.

This code example is part of a larger example provided for the MessageWindow component.

Dim msg As Message = Message.Create(MsgWin.Hwnd, MsgWindow.WM_CUSTOMMSG, New IntPtr(e.X), New IntPtr(e.Y))     MessageWindow.SendMessage(msg)

Message msg = Message.Create(MsgWin.Hwnd,     MsgWindow.WM_CUSTOMMSG,     (IntPtr)e.X,     (IntPtr)e.Y);     MessageWindow.SendMessage(ref msg); 

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Windows CE, Windows Mobile for Pocket PC, Windows Mobile for Smartphone

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

Version Information

.NET Compact Framework

Supported in: 2.0, 1.0

See Also

Reference

Message Members
Microsoft.WindowsCE.Forms Namespace
MessageWindow