Share via


MessageWindow.WndProc Method

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

Process Windows-based messages.

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

Syntax

'Declaration
Protected Overridable Sub WndProc ( _
    ByRef m As Message _
)
'Usage
Dim m As Message

Me.WndProc(m)
protected virtual void WndProc(
    ref Message m
)
protected:
virtual void WndProc(
    Message% m
)
abstract WndProc : 
        m:Message byref -> unit 
override WndProc : 
        m:Message byref -> unit 

Parameters

Remarks

The WndProc method corresponds to the native Windows WindowProc function.

Examples

vb#c#

The following code example is an override of the WndProc method in a class derived from MessageWindow. It examines incoming Windows-based messages. If a message has the identifier WM_CUSTOMMSG, it calls the RespondToMessage callback function providing information obtained from the WParam and LParam parts of the message. This code example is part of a larger example provided for the MessageWindow class.

' Override the default WndProc behavior to examine messages.
 Protected Overrides Sub WndProc(ByRef msg As Microsoft.WindowsCE.Forms.Message)
  Select Case msg.Msg
  ' If message is of interest, invoke the method on the form that
  ' functions as a callback to perform actions in response to the message.
  Case WM_CUSTOMMSG
   Me.msgform.RespondToMessage(Fix(msg.WParam.ToInt32), Fix(msg.LParam.ToInt32))
  End Select

 ' Call the base class WndProc method
 ' to process any messages not handled.
 MyBase.WndProc(msg)
 End Sub

 // Override the default WndProc behavior to examine messages.
 protected override void WndProc(ref Message msg)
 {
  switch(msg.Msg)
  {
   // If message is of interest, invoke the method on the form that
   // functions as a callback to perform actions in response to the message.
   case WM_CUSTOMMSG:
    this.msgform.RespondToMessage((int)msg.WParam, (int)msg.LParam);
    break;
  }
  // Call the base WndProc method
  // to process any messages not handled.
  base.WndProc(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

MessageWindow Class

MessageWindow Members

Microsoft.WindowsCE.Forms Namespace