Export (0) Print
Expand All

MessageWindow.WndProc Method

Process Windows-based messages.

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

protected virtual void WndProc (
	ref Message m
)
protected void WndProc (
	/** @ref */ Message m
)
Not applicable.

Parameters

m

A Windows-based message.

The WndProc method corresponds to the native Windows WindowProc function.

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 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.

.NET Compact Framework

Supported in: 2.0, 1.0

Community Additions

ADD
Show:
© 2015 Microsoft