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)

protected virtual void WndProc(
	ref Message m
)

Parameters

m
Type: Microsoft.WindowsCE.Forms.Message%
A Windows-based message.

The WndProc method corresponds to the native Windows WindowProc function.

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 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);
 }
}


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.

.NET Compact Framework

Supported in: 3.5, 2.0, 1.0
Show: