Microsoft.WindowCE.Forms Namespace

The Microsoft.WindowsCE.Forms namespace contains classes for programming mobile device applications using the Microsoft® .NET Compact Framework in Visual Studio® .NET 2003.

This temporary compiled Help file is provided because documentation for this namespace currently is not available in the .NET Framework class library reference in the .NET Framework version 1.1 SDK. For information about the .NET Compact Framework and Visual Studio .NET 2003, see http://msdn.microsoft.com/mobility/.

This namespace will be in the class library in future releases.

Classes

Class | Description
InputPanel | Controls the soft input panel (SIP) for entering data on Pocket PCs and other Windows® CE .NET devices.
MessageWindow | Provides the ability to send and receive Windows-based messages.

Structures

Class | Description
Message | Implements a Windows-based message.

Send comments on this topic.

© 2003 Microsoft Corporation. All rights reserved.


InputPanel Class

Controls the soft input panel (SIP) for entering data on Pocket PCs and other Windows CE .NET devices.

System.Object
System.MarshalByRefObject
System.ComponentModel.Component
Microsoft.WindowsCE.Forms.InputPanel

[Visual Basic]
Public Class InputPanel
   Inherits Component
[C#]
public class InputPanel : Component

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.

Remarks

The .NET Compact Framework provides the InputPanel component, which supplies a managed implementation of the SIP control in Windows CE .NET. When you create a Windows-based application that targets the Pocket PC platform, Visual Studio .NET automatically adds a System.Windows.Forms.MainMenu component to the Form1 file in your project. Your form then contains the lower menu bar with the SIP icon. No programming is required to use the SIP; users can toggle the display of the SIP by tapping the icon. To program the SIP, drag the InputPanel component from the ToolBox to your form.

Note A System.Windows.Forms.MainMenu component is required to use the InputPanel component, otherwise an exception is thrown. The Visual Studio .NET designer automatically adds a System.Windows.Forms.MainMenu component to the Form1 class when you create a Pocket PC project, but not to forms you subsequently add to the project. Note that Service Pack 2 of the .NET Compact Framework removes the System.Windows.Forms.MainMenu requirement. For information about service pack downloads, see the Mobility Developer Center Web site: http://go.microsoft.com/fwlink/?LinkId=16561.

You can show the SIP programmatically using the Enabled property, get its size with the Bounds property, and determine the size of the form area not occupied by the SIP with the VisibleDesktop property. Note that the Bounds property always returns a width of 240 pixels and a height of 80 pixels for Pocket PCs, regardless of whether or not the SIP is enabled. The EnabledChanged event occurs whenever the SIP is enabled or disabled, either by the user or programmatically. A typical reason for programming the SIP is to reposition or resize controls on the form when the SIP is enabled and disabled.

Example

The following code example contains a text box on a page of a tab control. It displays the SIP when the text box receives the focus, and uses the EnabledChanged event to lower the height of the tab control when the SIP is enabled and return to the original height when the SIP is disabled.

Note that you must add a reference to Microsoft.WindowsCE.Forms to your project.

[Visual Basic]

Private Sub TextBox1_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.GotFocus
        ' Display the SIP.
        ' Note that the EnabledChanged event occurs
        ' whenever the SIP is enabled or disabled.
        InputPanel1.Enabled = True
    End Sub

Private Sub InputPanel1_EnabledChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles InputPanel1.EnabledChanged
   If InputPanel1.Enabled = False Then
     ' The SIP is disabled, so set the height of the tab control
     ' to its original height with a variable (TabOriginalHeight),
     ' which is determined during initialization of the form.
     VisibleRect = InputPanel1.VisibleDesktop
     TabControl1.Height = TabOriginalHeight
   Else
      ' The SIP is enabled, so the height of the tab control
      ' is set to the height of the visible desktop area.
      VisibleRect = InputPanel1.VisibleDesktop
      TabControl1.Height = VisibleRect.Height
   End If

  ' The Bounds property always returns a width of 240 and a height of 80
  ' pixels for Pocket PCs, regardless of whether or not the SIP is enabled.
   BoundsRect = InputPanel1.Bounds
   ' Show the VisibleDesktop and Bounds values
   ' on the second tab for demonstration purposes.
  VisibleInfo.Text = String.Format("VisibleDesktop: X = {0}, Y = {1}, Width = {2}, Height = {3}", VisibleRect.X, VisibleRect.Y, VisibleRect.Width, VisibleRect.Height)

  BoundsInfo.Text = String.Format("Bounds: X = {0}, Y = {1}, Width = {2}, Height = {3}", BoundsRect.X, BoundsRect.Y, BoundsRect.Width, BoundsRect.Height)
End Sub

Requirements

Namespace: Microsoft.WindowsCE.Forms

Platforms: .NET Compact Framework

Assembly: System.Windows.Forms (in System.Windows.Forms.dll)

See Also

InputPanel Members | Microsoft.WindowsCE.FormsNamespace


InputPanel Members

InputPanel overview

Public Constructors

InputPanel Initializes a new instance of the InputPanel class for enabling and disabling the soft input panel (SIP).

Public Events

Dispose (inherited from Component) | Adds an event handler to listen to the Disposed event on the component.
EnabledChanged | Occurs when the soft input panel (SIP) is enabled or disabled.

Public Methods

Dispose Releases all the resources used by the InputPanel .

Public Properties

Bounds | Gets a Rectangle that represents the size and location of the soft input panel (SIP).
Enabled | Gets or sets a value indicating whether the soft input panel (SIP) is enabled or disabled.
VisibleDesktop | Gets a Rectangle representing the area not obscured by the soft input panel (SIP).

Protected Methods

Dispose (inherited from Component) | Overloaded. Releases the resources used by the Component.
Finalize | Overloaded. Releases the resources used by the component.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.


InputPanel Constructor

Initializes a new instance of the InputPanel class for enabling and disabling the soft input panel (SIP).

[Visual Basic]
Public Sub New()
[C#]
public InputPanel();

Remarks

To program the SIP, drag the InputPanel component from the ToolBox to your form.

A System.Windows.Forms.MainMenu component is required to use the InputPanel component. The Visual Studio .NET designer automatically adds a System.Windows.Forms.MainMenu component to the Form1 class when you create a Pocket PC project, but not to forms you subsequently add to the project.

You do not have to add an InputPanel component to your application for users to display the SIP because the SIP icon is already available on the lower menu bar when you create a Windows-based application for the Pocket PC. You only need the InputPanel component when you want to programmatically control the SIP.

Requirements

Namespace: Microsoft.WindowsCE.Forms

Platforms: .NET Compact Framework

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

See Also

InputPanel Class | InputPanel Members | Microsoft.WindowsCE.FormsNamespace


InputPanel Methods

Public Methods

Dispose Releases all the resources use by the InputPanel Class

Protected Methods

Dispose (inherited from Component) | Overloaded. Releases the resources used by the Component.
Finalize | Overloaded. Releases the resources used by the component.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

InputPanel Class | Microsoft.WindowsCE.FormsNamespace


InputPanel.Dispose Method

Releases all resources used by the InputPanel.

Declaration Syntax

[Visual Basic]
Public sub Dispose()
[C#]
public void Dispose();

Requirements

Namespace: Microsoft.WindowsCE.Forms

Platforms: .NET Compact Framework

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

See Also

InputPanel Class | InputPanel Members | Microsoft.WindowsCE.FormsNamespace


InputPanel.Finalize Method

Releases the resources and performs other cleanup operations before the InputPanel is reclaimed by garbage collection.

Declaration Syntax

[Visual Basic]
Protected Overrides Sub Finalize()
[C#]
~InputPanel();

Requirements

Namespace: Microsoft.WindowsCE.Forms

Platforms: .NET Compact Framework

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

See Also

InputPanel Class | InputPanel Members | Microsoft.WindowsCE.FormsNamespace


InputPanel Properties

Public Properties

Bounds | Gets a Rectangle that represents the size and location of the soft input panel (SIP).
Enabled | Gets or sets a value indicating whether the soft input panel (SIP) is enabled or disabled.
VisibleDesktop | Gets a Rectangle representing the area not obscured by the soft input panel (SIP).

See Also

InputPanel Class | Microsoft.WindowsCE.FormsNamespace


InputPanel.Bounds Property

Gets a Rectangle that represents the size and location of the soft input panel (SIP).

Declaration Syntax

[Visual Basic]
Public ReadOnly Property Bounds() As Rectangle
[C#]
public Rectangle Bounds {get;}

Value

A Rectangle to use.

Remarks

The Bounds property always returns a width of 240 pixels and a height of 80 pixels for Pocket PCs, regardless of whether or not the SIP is enabled.

Example

The following code example uses the EnabledChanged event to lower the height of a tab control when the SIP is enabled and returns the tab control it its original height when the SIP is disabled. It gets the Bounds property and displays its values.

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

[Visual Basic]

    Private Sub InputPanel1_EnabledChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles InputPanel1.EnabledChanged
        If InputPanel1.Enabled = False Then
            ' The SIP is disabled, so set the height of the tab control
            ' to its original height with a variable (TabOriginalHeight),
            ' which is determined during initialization of the form.
            VisibleRect = InputPanel1.VisibleDesktop
            TabControl1.Height = TabOriginalHeight
        Else
            ' The SIP is enabled, so the height of the tab control
            ' is set to the height of the visible desktop area.
            VisibleRect = InputPanel1.VisibleDesktop
            TabControl1.Height = VisibleRect.Height

        End If

        ' The Bounds property always returns a width of 240 and a height of 80
        ' pixels for Pocket PCs, regardless of whether or not the SIP is enabled.
        BoundsRect = InputPanel1.Bounds

        ' Show the VisibleDesktop and Bounds values
        ' on the second tab for demonstration purposes.
        VisibleInfo.Text = String.Format("VisibleDesktop: X = {0}, Y = {1}, Width = {2}, Height = {3}", VisibleRect.X, VisibleRect.Y, VisibleRect.Width, VisibleRect.Height)
        BoundsInfo.Text = String.Format("Bounds: X = {0}, Y = {1}, Width = {2}, Height = {3}", BoundsRect.X, BoundsRect.Y, BoundsRect.Width, BoundsRect.Height)
    End Sub

[C#]

      private void inputPanel1_EnabledChanged(object sender, EventArgs e)
      {
         if (inputPanel1.Enabled == false)
         {
            // The SIP is disabled, so set the height of the tab control
            // to its original height with a variable (TabOriginalHeight),
            // which is determined during initialization of the form.
            VisibleRect = inputPanel1.VisibleDesktop;
            tabControl1.Height = TabOriginalHeight;
         }
         else
         {
            // The SIP is enabled, so the height of the tab control
            // is set to the height of the visible desktop area.
            VisibleRect = inputPanel1.VisibleDesktop;
            tabControl1.Height = VisibleRect.Height;
         }

      // The Bounds property always returns a width of 240 and a height of 80
      // pixels for Pocket PCs, regardless of whether or not the SIP is enabled.
      BoundsRect = inputPanel1.Bounds;

      // Show the VisibleDestkop and Bounds values
      // on the second tab for demonstration purposes.
        VisibleInfo.Text = String.Format("VisibleDesktop: X = {0}, Y = {1}, Width = {2}, Height = {3}", VisibleRect.X, VisibleRect.Y, VisibleRect.Width, VisibleRect.Height);
        BoundsInfo.Text = String.Format("Bounds: X = {0}, Y = {1}, Width = {2}, Height = {3}", BoundsRect.X, BoundsRect.Y, BoundsRect.Width, BoundsRect.Height);
      }

Requirements

Namespace: Microsoft.WindowsCE.Forms

Platforms: .NET Compact Framework

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

See Also

InputPanel Class | InputPanel Members | VisibleDesktop | Microsoft.WindowsCE.FormsNamespace


InputPanel.Enabled Property

Gets or sets a value indicating whether the soft input panel (SIP) is enabled or disabled.

Declaration Syntax

[Visual Basic]
Public Property Enabled() As Boolean
[C#]
public bool Enabled {get; set;}

Value

true if the SIP is enabled; otherwise, false.

Remarks

This SIP is enabled when it appears in the application.

When you change the Enabled property to true or false, the EnabledChanged event is raised.

Example

The following code example displays the SIP when a text box receives focus. This code example is part of a larger example provided for the InputPanel component.

[Visual Basic]

    Private Sub TextBox1_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.GotFocus
        ' Display the SIP.
        ' Note that the EnabledChanged event occurs
        ' whenever the SIP is enabled or disabled.
        InputPanel1.Enabled = True
    End Sub

[C#]

      private void textBox1_GotFocus(object sender, System.EventArgs e)
      {
         // Display the SIP.
         // Note that the EnabledChanged event occurs
         // whenever the SIP is enabled or disabled.
         inputPanel1.Enabled = true;

      }

Requirements

Namespace: Microsoft.WindowsCE.Forms

Platforms: .NET Compact Framework

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

See Also

InputPanel Class | InputPanel Members | EnabledChanged | Microsoft.WindowsCE.FormsNamespace


InputPanel.VisibleDesktop Property

Gets a Rectangle representing the area not obscured by the soft input panel (SIP).

Declaration Syntax

[Visual Basic]
Public ReadOnly Property VisibleDesktop() As Rectangle
[C#]
public Rectangle VisibleDesktop {get;}

Value

A Rectangle to use.

Remarks

The VisibleDesktop property provides a Rectangle with the dimensions of the area of the form not occupied by the SIP. When the SIP is enabled, you can reposition or resize controls to be within this area. If you are developing for a Windows CE .NET device other than a Pocket PC, the VisibleDesktop property returns the largest rectangle of form area that is not occupied by the SIP. If the SIP is off the form, VisibleDesktop returns the dimensions of the client area of the form.

Example

The following code example uses the EnabledChanged event to lower the height of a tab control when the SIP is enabled and returns the tab control to its original height when the SIP is disabled. It examines the VisibleDesktop property when the SIP is enabled and disabled so that the tab control height can be adjusted to accommodate the SIP. This code example is part of a larger example provided for the InputPanel component.

[Visual Basic]

    Private Sub InputPanel1_EnabledChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles InputPanel1.EnabledChanged
        If InputPanel1.Enabled = False Then

            ' The SIP is disabled, so set the height of the tab control
            ' to its original height with a variable (TabOriginalHeight),
            ' which is determined during initialization of the form.
            VisibleRect = InputPanel1.VisibleDesktop
            TabControl1.Height = TabOriginalHeight
        Else
            ' The SIP is enabled, so the height of the tab control
            ' is set to the height of the visible desktop area.
            VisibleRect = InputPanel1.VisibleDesktop
            TabControl1.Height = VisibleRect.Height

        End If

        ' The Bounds property always returns a width of 240 and a height of 80
        ' pixels for Pocket PCs, regardless of whether or not the SIP is enabled.
        BoundsRect = InputPanel1.Bounds

        ' Show the VisibleDesktop and Bounds values
        ' on the second tab for demonstration purposes.
        VisibleInfo.Text = String.Format("VisibleDesktop: X = {0}, Y = {1}, Width = {2}, Height = {3}", VisibleRect.X, VisibleRect.Y, VisibleRect.Width, VisibleRect.Height)
        BoundsInfo.Text = String.Format("Bounds: X = {0}, Y = {1}, Width = {2}, Height = {3}", BoundsRect.X, BoundsRect.Y, BoundsRect.Width, BoundsRect.Height)
    End Sub
[C#]
      private void inputPanel1_EnabledChanged(object sender, EventArgs e)
      {
         if (inputPanel1.Enabled == false)
         {
            // The SIP is disabled, so set the height of the tab control
            // to its original height with a variable (TabOriginalHeight),
            // which is determined during initialization of the form.
            VisibleRect = inputPanel1.VisibleDesktop;
            tabControl1.Height = TabOriginalHeight;
         }
         else
         {
            // The SIP is enabled, so the height of the tab control
            // is set to the height of the visible desktop area.
            VisibleRect = inputPanel1.VisibleDesktop;
            tabControl1.Height = VisibleRect.Height;
         }

      // The Bounds property always returns a width of 240 and a height of 80
      // pixels for Pocket PCs, regardless of whether or not the SIP is enabled.
      BoundsRect = inputPanel1.Bounds;

      // Show the VisibleDestkop and Bounds values
      // on the second tab for demonstration purposes.
        VisibleInfo.Text = String.Format("VisibleDesktop: X = {0}, Y = {1}, Width = {2}, Height = {3}", VisibleRect.X, VisibleRect.Y, VisibleRect.Width, VisibleRect.Height);
        BoundsInfo.Text = String.Format("Bounds: X = {0}, Y = {1}, Width = {2}, Height = {3}", BoundsRect.X, BoundsRect.Y, BoundsRect.Width, BoundsRect.Height);
      }

Requirements

Namespace: Microsoft.WindowsCE.Forms

Platforms: .NET Compact Framework

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

See Also

InputPanel Class | InputPanel Members | Bounds | Microsoft.WindowsCE.FormsNamespace


InputPanel Events

Public Events

EnabledChanged Occurs when the soft input panel (SIP) is enabled or disabled.

See Also

InputPanel Class | Microsoft.WindowsCE.FormsNamespace


InputPanel.EnabedChanged Event

Occurs when the soft input panel (SIP) is enabled or disabled.

Declaration Syntax

[Visual Basic]
Public Event EnabledChanged As EventHandler
[C#]
public event EventHandler EnabledChanged;

Remarks

The EnabledChanged event occurs whenever the SIP is enabled or disabled, either programmatically or by the user. When this event occurs, you can determine whether the SIP is enabled or disabled and reposition or resize controls accordingly.

You can raise this event by changing the Enabled property.

Example

The following code example uses the EnabledChanged event to lower the height of a tab control when the SIP is enabled and returns the tab control to its original height when the SIP is disabled. This code example is part of a larger example provided for the InputPanel component.

[Visual Basic]

    Private Sub InputPanel1_EnabledChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles InputPanel1.EnabledChanged
        If InputPanel1.Enabled = False Then

            ' The SIP is disabled, so set the height of the tab control
            ' to its original height with a variable (TabOriginalHeight),
            ' which is determined during initialization of the form.
            VisibleRect = InputPanel1.VisibleDesktop
            TabControl1.Height = TabOriginalHeight
        Else
            ' The SIP is enabled, so the height of the tab control
            ' is set to the height of the visible desktop area.
            VisibleRect = InputPanel1.VisibleDesktop
            TabControl1.Height = VisibleRect.Height

        End If

        ' The Bounds property always returns a width of 240 and a height of 80
        ' pixels for Pocket PCs, regardless of whether or not the SIP is enabled.
        BoundsRect = InputPanel1.Bounds

        ' Show the VisibleDesktop and Bounds values
        ' on the second tab for demonstration purposes.
        VisibleInfo.Text = String.Format("VisibleDesktop: X = {0}, Y = {1}, Width = {2}, Height = {3}", VisibleRect.X, VisibleRect.Y, VisibleRect.Width, VisibleRect.Height)
        BoundsInfo.Text = String.Format("Bounds: X = {0}, Y = {1}, Width = {2}, Height = {3}", BoundsRect.X, BoundsRect.Y, BoundsRect.Width, BoundsRect.Height)
    End Sub

[C#]

      private void inputPanel1_EnabledChanged(object sender, EventArgs e)
      {
         if (inputPanel1.Enabled == false)
         {
            // The SIP is disabled, so set the height of the tab control
            // to its original height with a variable (TabOriginalHeight),
            // which is determined during initialization of the form.
            VisibleRect = inputPanel1.VisibleDesktop;
            tabControl1.Height = TabOriginalHeight;
         }
         else
         {
            // The SIP is enabled, so the height of the tab control
            // is set to the height of the visible desktop area.
            VisibleRect = inputPanel1.VisibleDesktop;
            tabControl1.Height = VisibleRect.Height;
         }

      // The Bounds property always returns a width of 240 and a height of 80
      // pixels for Pocket PCs, regardless of whether or not the SIP is enabled.
      BoundsRect = inputPanel1.Bounds;

      // Show the VisibleDestkop and Bounds values
      // on the second tab for demonstration purposes.
        VisibleInfo.Text = String.Format("VisibleDesktop: X = {0}, Y = {1}, Width = {2}, Height = {3}", VisibleRect.X, VisibleRect.Y, VisibleRect.Width, VisibleRect.Height);
        BoundsInfo.Text = String.Format("Bounds: X = {0}, Y = {1}, Width = {2}, Height = {3}", BoundsRect.X, BoundsRect.Y, BoundsRect.Width, BoundsRect.Height);
      }

Requirements

Namespace: Microsoft.WindowsCE.Forms

Platforms: .NET Compact Framework

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

See Also

InputPanel Class | InputPanel Members | Enabled | Microsoft.WindowsCE.FormsNamespace


Message Structure

Implements a Windows-based message.

Declaration Syntax

[Visual Basic]
Public Structure Message
[C#]
public struct Message

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.

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 System.Windows.Forms.MouseEventArgs , e, in an System.Windows.Forms.Control.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);

Requirements

Namespace: Microsoft.WindowsCE.Forms

Platforms: .NET Compact Framework

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

See Also

Message Members | MessageWindow | Microsoft.WindowsCE.FormsNamespace


Message Members

Message Structure overview

Public Methods

Create | Creates a new Message structure.
Equals | Overridden. This member overrides Equals.
GetHashCode | Overridden. This member overrides GetHashCode.
GetType (inherited from Object) | Gets the Type of the current instance.
op_Equality | Compares two Message structures to determine whether they are equal.
op_Inequality | Compares two Message structures to determine whether they are not equal.
ToString (inherited from Object) | Returns a String that represents the current Object.

Public Properties

HWnd | Gets or sets the window handle of the message.
LParam | Gets or sets the LParam field of the message.
Msg | Gets or sets the ID number for the message.
Result | Specifies the value that is returned to Windows in response to handling the message.
WParam | Gets or sets the WParam field of the message.

Protected Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

Message Structure | Microsoft.WindowsCE.FormsNamespace


Message Methods

Public Methods

Create | Creates a new Message structure.
Equals | Overridden. This member overrides Equals.
GetHashCode | Overridden. This member overrides GetHashCode.
GetType (inherited from Object) | Gets the Type of the current instance.
op_Equality | Compares two Message structures to determine whether they are equal.
op_Inequality | Compares two Message structures to determine whether they are not equal.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

Message Structure | Microsoft.WindowsCE.FormsNamespace


Message.Create Method

Creates a new Message structure.

Declaration Syntax

[Visual Basic]
Public Shared Function Create( _
   ByVal hwnd As IntPtr, _
   ByVal msg As Integer, _
   ByVal wparam As IntPtr, _
   ByVal lparam As IntPtr _
) As Message
[C#]
public static Message Create(
   IntPtr hwnd,
   int msg,
   IntPtr wparam,
   IntPtr lparam
);

Parameters

hwnd
The window handle that the message is for.
msg
The message ID.
wparam
The message WParam field.
lparam
The message LParam field.

Return Value

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.

Example

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

Requirements

Namespace: Microsoft.WindowsCE.Forms

Platforms: .NET Compact Framework

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

See Also

Message Structure | Message Members | Microsoft.WindowsCE.FormsNamespace


Message.Equals Method

This member overrides Equals .

Declaration Syntax

[Visual Basic]
Public Overrides Function Equals( _
   ByVal o As Object _
) As Boolean
[C#]
public override bool Equals(
   object o
);

Parameters

o
Another object to compare to.

Requirements

Namespace: Microsoft.WindowsCE.Forms

Platforms: .NET Compact Framework

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

See Also

Message Structure | Message Members | Microsoft.WindowsCE.FormsNamespace


Message.GetHashCode Method

This member overrides GetHashCode.

Declaration Syntax

[Visual Basic]
Public Overrides Function GetHashCode() As Integer
[C#]
public override int GetHashCode();

Requirements

Namespace: Microsoft.WindowsCE.Forms

Platforms: .NET Compact Framework

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

See Also

Message Structure | Message Members | Microsoft.WindowsCE.FormsNamespace


Message.op_Equality Method

Compares two Message structures to determine whether they are equal.

Declaration Syntax

[Visual Basic]
Public Shared Function op_Equality( _
   ByVal left As Message, _
   ByVal right As Message _
) As Boolean
[C#]
public static bool op_Equality(
   Message left,
   Message right
);

Parameters

left
The Message on the left side of the operator.
right
The Message on the right side of the operator.

Return Value

true if both Message structures are equal; otherwise, false .

Remarks

Use this operator to compare two Message structures for equality.

Requirements

Namespace: Microsoft.WindowsCE.Forms

Platforms: .NET Compact Framework

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

See Also

Message Structure | Message Members | Microsoft.WindowsCE.FormsNamespace


Message.op_Inequality Method

Compares two Message structures to determine whether they are not equal.

Declaration Syntax

[Visual Basic]
Public Shared Function op_Inequality( _
   ByVal left As Message, _
   ByVal right As Message _
) As Boolean
[C#]
public static bool op_Inequality(
   Message left,
   Message right
);

Parameters

left
The Message on the left side of the operator.
right
The Message on the right side of the operator.

Return Value

true if the Message structures are equal; otherwise, false .

Remarks

Use this operator to compare two Message structures for inequality.

Requirements

Namespace: Microsoft.WindowsCE.Forms

Platforms: .NET Compact Framework

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

See Also

Message Structure | Message Members | Microsoft.WindowsCE.FormsNamespace


Message Properties

Public Properties

HWnd | Gets or sets the window handle of the message.
LParam | Gets or sets the LParam field of the message.
Msg | Gets or sets the ID number for the message.
Result | Specifies the value that is returned to Windows in response to handling the message.
WParam | Gets or sets the WParam field of the Message.

See Also

Message Structure | Microsoft.WindowsCE.FormsNamespace


Message.HWnd Property

Gets or sets the window handle of the message.

Declaration Syntax

[Visual Basic]
Public Property HWnd() As IntPtr
[C#]
public IntPtr HWnd {get; set;}

Value

The window handle of the message.

Remarks

This property is used to create a message and is the handle of the Window that gets the message.

Requirements

Namespace: Microsoft.WindowsCE.Forms

Platforms: .NET Compact Framework

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

See Also

Message Structure | Message Members | Create | Microsoft.WindowsCE.FormsNamespace


Message.LParam Property

Gets or sets the LParam field of the message.

Declaration Syntax

[Visual Basic]
Public Property LParam() As IntPtr
[C#]
public IntPtr LParam {get; set;}

Value

The LParam field of the message.

Remarks

The value of this field depends on the message. Use the LParam field to get information that is important to handling the message. This field is typically used to store an object if it is needed by the message.

Requirements

Namespace: Microsoft.WindowsCE.Forms

Platforms: .NET Compact Framework

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

See Also

Message Structure | Message Members | Microsoft.WindowsCE.FormsNamespace


Message.Msg Property

Gets or sets the ID number for the message.

Declaration Syntax

[Visual Basic]
Public Property Msg() As Integer
[C#]
public int Msg {get; set;}

Value

The ID number of the message.

Requirements

Namespace: Microsoft.WindowsCE.Forms

Platforms: .NET Compact Framework

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

See Also

Message Structure | Message Members | Microsoft.WindowsCE.FormsNamespace


Message.Result Property

Specifies the value that is returned to Windows in response to handling the message.

Declaration Syntax

[Visual Basic]
Public Property Result() As IntPtr
[C#]
public IntPtr Result {get; set;}

Value

The return value of the message.

Requirements

Namespace: Microsoft.WindowsCE.Forms

Platforms: .NET Compact Framework

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

See Also

Message Structure | Message Members | Microsoft.WindowsCE.FormsNamespace


Message.WParam Property

Gets or sets the WParam field of the Message.

Declaration Syntax

[Visual Basic]
Public Property WParam() As IntPtr
[C#]
public IntPtr WParam {get; set;}

Value

The WParam field of the message.

Remarks

The value of this field depends on the message. Use the WParam field to get information that is important to handling the message. This field is typically used to store small pieces of information, such as flags.

Requirements

Namespace: Microsoft.WindowsCE.Forms

Platforms: .NET Compact Framework

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

See Also

Message Structure | Message Members | Microsoft.WindowsCE.FormsNamespace


MessageWindow Class

Provides the ability to send and receive Windows-based messages.

System.Object
Microsoft.WindowsCE.Forms.MessageWindow

Declaration Syntax

[Visual Basic]
Public Class MessageWindow _
   Implements IDisposable
[C#]
public class MessageWindow : IDisposable

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.

Remarks

The MessageWindow class provides the ability to send and receive Windows-based messages. It creates a Window handle in native code and performs the required platform invoke calls to native Windows functions.

To use the MessageWindow in your program you need to create a class derived from MessageWindow and override the default WndProc behavior to watch for specific Window messages. You can generate messages with the Message class. You can receive only the Windows-based messages that you generate using MessageWindow or those with a native control.

To use this class, you must add a reference in your Visual Studio .NET project to the Microsoft.WindowsCE.Forms namespace.

Example

The following code example demonstrates MessageWindow by having the form send Windows-based messages of current mouse x-y coordinates to the message window, which invokes the callback method on the form to display the coordinates in the title bar.

The form contains a custom class, MsgWindow, derived from MessageWindow. The MsgWindow class examines messages in the overridden WndProc method, looking for messages with a WM_CUSTOMMSG identifier. When it finds these messages, it invokes the RespondToMessage callback method defined in the form.

The form creates a new instance of MsgWindow. The MsgWindow constructor takes a form, which in this example is the containing form. The form generates Windows-based messages in an override of the OnMouseMove method.

When the form runs, mouse movements generate messages to the message window. The message window WndProc method invokes the callback method on the form, which responds to the messages.

Note that you must add a reference to Microsoft.WindowsCE.Forms to your project.

[Visual Basic]

          Imports System
Imports System.Windows.Forms
Imports Microsoft.WindowsCE.Forms

Public Class MessageWindowForm
   Inherits System.Windows.Forms.Form
   Private mainMenu1 As System.Windows.Forms.MainMenu

   ' Create an instance of MsgWindow, a derived MessageWindow class.
   Private MsgWin As MsgWindow

   Public Sub New()
      '
      ' Required for Windows Form Designer support
      '
      InitializeComponent()

      ' Create the message window using this form for its constructor.
      Me.MsgWin = New MsgWindow(Me)
    End Sub

    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        MyBase.Dispose(disposing)
    End Sub
#Region "Windows Form Designer generated code"

    Private Sub InitializeComponent()
        Me.mainMenu1 = New System.Windows.Forms.MainMenu
        '
        ' MessageWindowForm
        '
        Me.Menu = Me.mainMenu1
        Me.Text = "Message Window Test"
    End Sub
#End Region

    Shared Sub Main()
        Application.Run(New MessageWindowForm)
    End Sub

    ' Process taps to generate messages
    ' with the WParam and LParam parameters
    ' using the X and Y mouse coordinates.
    Protected Overrides Sub OnMouseMove(ByVal e As MouseEventArgs)
        Dim msg As Microsoft.WindowsCE.Forms.Message = Microsoft.WindowsCE.Forms.Message.Create(MsgWin.Hwnd, MsgWindow.WM_CUSTOMMSG, New IntPtr(e.X), New IntPtr(e.Y))
        MessageWindow.SendMessage(msg)
        MyBase.OnMouseMove(e)
    End Sub

    ' This callback method responds to the Windows-based message.
    Public Sub RespondToMessage(ByVal x As Integer, ByVal y As Integer)
        Me.Text = "X = " + x.ToString() + ", Y= " + y.ToString()
    End Sub
End Class

' Derive MessageWindow to respond to
' Windows messages and to notify the
' form when they are received.

Public Class MsgWindow
    Inherits MessageWindow
    ' Assign integers to messages.
    ' Note that custom Window messages start at WM_USER = 0x400.
    Public Const WM_CUSTOMMSG As Integer = &H400

    ' Create an instance of the form.
    Private msgform As MessageWindowForm

    ' Save a reference to the form so it can
    ' be notified when messages are received.
    Public Sub New(ByVal msgform As MessageWindowForm)
        Me.msgform = msgform
    End Sub

    ' 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
End Class

[C#]

using System;
using System.Windows.Forms;
using Microsoft.WindowsCE.Forms;

namespace MsgWindow
{
   public class MessageWindowForm : System.Windows.Forms.Form
   {
      private System.Windows.Forms.MainMenu mainMenu1;

      // Create an instance of MsgWindow, a derived MessageWindow class.
      MsgWindow MsgWin;

      public MessageWindowForm()
      {

         InitializeComponent();

         // Create the message window using this form for its constructor.
         this.MsgWin = new MsgWindow(this);

      }
      protected override void Dispose( bool disposing )
      {
         base.Dispose( disposing );
      }
      #region Windows Form Designer generated code
      private void InitializeComponent()
      {
         this.mainMenu1 = new System.Windows.Forms.MainMenu();
         this.Menu = this.mainMenu1;
         this.Text = "Message Window Test";

      }
      #endregion

      static void Main()
      {
         Application.Run(new MessageWindowForm());
      }

      // Process taps to generate messages
      // with the WParam and LParam parameters
      // using the X and Y mouse coordinates.
      protected override void OnMouseMove(MouseEventArgs e)
      {
         Message msg = Message.Create(MsgWin.Hwnd,
            MsgWindow.WM_CUSTOMMSG,
            (IntPtr)e.X,
            (IntPtr)e.Y);
         MessageWindow.SendMessage(ref msg);
         base.OnMouseMove(e);
      }

      // This callback method responds to the Windows-based message.
      public void RespondToMessage(int x, int y)
      {
         this.Text = "X = " + x.ToString() + ", Y= " + y.ToString();
      }
   }

   // Derive MessageWindow to respond to
   // Windows messages and to notify the
   // form when they are received.
   public class MsgWindow : MessageWindow
   {
      // Assign integers to messages.
      // Note that custom Window messages start at WM_USER = 0x400.
      public const int WM_CUSTOMMSG = 0x0400;

      // Create an instance of the form.
      private MessageWindowForm msgform;

      // Save a reference to the form so it can
      // be notified when messages are received.
      public MsgWindow(MessageWindowForm msgform)
      {
         this.msgform = msgform;
      }

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

Requirements

Namespace: Microsoft.WindowsCE.Forms

Platforms: .NET Compact Framework

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

See Also

MessageWindow Members | Microsoft.WindowsCE.FormsNamespace


MessageWindow Members

MessageWindow overview

Public Constructors

MessageWindow Creates a new instance of the MessageWindow class.

Public Methods

Dispose | Releases all resources used by the MessageWindow.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
PostMessage | Sends a message to the message window and returns immediately.
SendMessage | Sends a message to the message window and waits until the WndProc method has processed the message.
ToString (inherited from Object) | Returns a String that represents the current Object.

Public Properties

Hwnd Gets the handle of the message window.

Protected Methods

Finalize | Overridden.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.
WndProc | Process Windows-based messages.

See Also

MessageWindow Class | Microsoft.WindowsCE.FormsNamespace


MessageWindow Constructor

Creates a new instance of the MessageWindow class.

Declaration Syntax

[Visual Basic]
Public Sub New()
[C#]
public MessageWindow();

Remarks

To use the MessageWindow class, derive a class from it. The derived class typically takes a form for its constructor. The form can be the containing form or another form, but is always the form that contains the callback method that responds to sent messages.

Requirements

Namespace: Microsoft.WindowsCE.Forms

Platforms: .NET Compact Framework

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

See Also

MessageWindow Class | MessageWindow Members | Microsoft.WindowsCE.FormsNamespace


MessageWindow Methods

Public Methods

Dispose | Releases all resources used by the MessageWindow.
PostMessage | Sends a message to the message window and returns immediately.
SendMessage | Sends a message to the message window and waits until the WndProc method has processed the message.

Protected Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
Finalize | Overridden.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.
WndProc | Process Windows-based messages.

See Also

MessageWindow Class | Microsoft.WindowsCE.FormsNamespace


MessageWindow.Dispose

Releases all resources used by the MessageWindow.

Declaration Syntax

[Visual Basic]
Public Overridable Sub Dispose()
[C#]
public virtual void Dispose();

Remarks

Call Dispose when you are finished using the MessageWindow.. The Dispose method leaves the MessageWindow in an unusable state. After calling Dispose, you must release all references to the MessageWindow so the garbage collector can reclaim the memory that the MessageWindow was occupying. For more information, see Cleaning Up Unmanaged Resources and Implementing a Dispose Method .

Note: Always call Dispose before you release your last reference to the MessageWindow. Otherwise, the resources it is using will not be freed until the garbage collector calls the MessageWindow object's Finalize method.

Requirements

Namespace: Microsoft.WindowsCE.Forms

Platforms: .NET Compact Framework

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

See Also

MessageWindow Class | MessageWindow Members | Microsoft.WindowsCE.FormsNamespace


MessageWindow.Finalize Method

Releases the resources and performs other cleanup operations before the MessageWindow is reclaimed by garbage collection.

Declaration Syntax

[Visual Basic]
Protected Overrides Sub Finalize()
[C#]
~MessageWindow();

Requirements

Namespace: Microsoft.WindowsCE.Forms

Platforms: .NET Compact Framework

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

See Also

MessageWindow Class | MessageWindow Members | Microsoft.WindowsCE.FormsNamespace


MessageWindow.PostMessage Method

Sends a message to the message window and returns immediately.

Declaration Syntax

[Visual Basic]
Public Shared Sub PostMessage( _
   ByRef m As Message _
)
[C#]
public static void PostMessage(
   ref Message m
);

Parameters

m
A Windows-based message.

Remarks

The .NET Compact Framework provides the Message structure for generating Windows-based messages.

Requirements

Namespace: Microsoft.WindowsCE.Forms

Platforms: .NET Compact Framework

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

See Also

MessageWindow Class | MessageWindow Members |SendMessage | Microsoft.WindowsCE.FormsNamespace


MessageWindow.SendMessage Method

Sends a message to the message window and waits until the WndProc method has processed the message.

Declaration Syntax

[Visual Basic]
Public Shared Sub SendMessage( _
   ByRef m As Message _
)
[C#]
public static void SendMessage(
   ref Message m
);

Parameters

m
A Windows-based message.

Remarks

The .NET Compact Framework provides the Message structure for generating Windows-based messages.

Example

The following code example generates Windows-based messages in on override of the System.Windows.Forms.Design.ComponentTray.OnMouseMove method. Every time the mouse moves, or whenever there is a tap, this method generates a Windows-based message with the X and Y mouse coordinate values occupying the WParam and LParam parameters. This code example is part of a larger example provided for the MessageWindow class.

[Visual Basic]

Dim msg As Microsoft.WindowsCE.Forms.Message = Microsoft.WindowsCE.Forms.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);

Requirements

Namespace: Microsoft.WindowsCE.Forms

Platforms: .NET Compact Framework

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

See Also

MessageWindow Class | MessageWindow Members | Microsoft.WindowsCE.FormsNamespace


MessageWindow.WndProc Method

Process Windows-based messages.

Declaration Syntax

[Visual Basic]
Protected Overridable Sub WndProc( _
   ByRef m As Message _
)
[C#]
protected virtual void WndProc(
   ref Message m
);

Parameters

m
A Windows-based message.

Remarks

The WndProc method corresponds to the native Windows WindowProc function.

Example

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.

[Visual Basic]

    ' 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

[C#]

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

Requirements

Namespace: Microsoft.WindowsCE.Forms

Platforms: .NET Compact Framework

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

See Also

MessageWindow Class | MessageWindow Members | Microsoft.WindowsCE.FormsNamespace


MessageWindow Properties

Public Properties

Hwnd Gets the handle of the message window.

See Also

MessageWindow Class | MessageWindow Members


MessageWindow.Hwnd Property

Gets the handle of the message window.

Declaration Syntax

[Visual Basic]
Public ReadOnly Property Hwnd() As IntPtr
[C#]
public IntPtr Hwnd {get;}

Remarks

This property returns the handle of the message window, and is used for creating Windows-based messages to identify the handle the message is sent to.

Example

The following code example creates and sends a Windows-based message. The first parameter for the Create method is the handle (Hwnd ) to the message window, which in this case is the handle to MsgWin, an instance of a derived class from MessageWindow. This code example is part of a larger example provided for the MessageWindow class.

[Visual Basic]

Dim msg As Microsoft.WindowsCE.Forms.Message = Microsoft.WindowsCE.Forms.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);

Requirements

Namespace: Microsoft.WindowsCE.Forms

Platforms: .NET Compact Framework

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

See Also

MessageWindow Class | MessageWindow Members | Microsoft.WindowsCE.FormsNamespace


Copyright

Information in this document, including URL and other Internet Web site references, is subject to change without notice. Unless otherwise noted, the example companies, organizations, products, domain names, e-mail addresses, logos, people, places and events depicted herein are fictitious, and no association with any real company, organization, product, domain name, e-mail address, logo, person, place or event is intended or should be inferred. Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, without the express written permission of Microsoft Corporation.

Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this document. Except as expressly provided in any written license agreement from Microsoft, the furnishing of this document does not give you any license to these patents, trademarks, copyrights, or other intellectual property.

© 2003 Microsoft Corporation. All rights reserved.

Microsoft, Visual Basic, Visual Studio, and Windows are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries.

The names of actual companies and products mentioned herein may be the trademarks of their respective owners.