Partager via


Message.Create Method

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Creates a new Message structure.

Namespace:  Microsoft.WindowsCE.Forms
Assembly:  Microsoft.WindowsCE.Forms (in Microsoft.WindowsCE.Forms.dll)

Syntax

'Declaration
Public Shared Function Create ( _
    hwnd As IntPtr, _
    msg As Integer, _
    wparam As IntPtr, _
    lparam As IntPtr _
) As Message
'Usage
Dim hwnd As IntPtr
Dim msg As Integer
Dim wparam As IntPtr
Dim lparam As IntPtr
Dim returnValue As Message

returnValue = Message.Create(hwnd, msg, _
    wparam, lparam)
public static Message Create(
    IntPtr hwnd,
    int msg,
    IntPtr wparam,
    IntPtr lparam
)
public:
static Message Create(
    IntPtr hwnd, 
    int msg, 
    IntPtr wparam, 
    IntPtr lparam
)
static member Create : 
        hwnd:IntPtr * 
        msg:int * 
        wparam:IntPtr * 
        lparam:IntPtr -> Message 

Parameters

  • hwnd
    Type: System.IntPtr
    The window handle that the message is for.

Return Value

Type: Microsoft.WindowsCE.Forms.Message
A Message structure that represents the message that was created.

Remarks

Use the Create method to create a Message structure to wrap a message sent by Windows.

Examples

The following code example creates and sends a Windows 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.

[Visual Basic]

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

[C#]

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

.NET Framework Security

Platforms

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

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Version Information

.NET Compact Framework

Supported in: 3.5, 2.0, 1.0

See Also

Reference

Message Structure

Message Members

Microsoft.WindowsCE.Forms Namespace