interprocess communication under WinCE and Windows Moblie can be implemented by the following technologies.
1. Windows Message
2. Point-to-Point message queues
3. MSMQ
The following uses the Windows message for interprocess communication under the. NET Compact Framework.
Referencing libraries
The development of Windows message under Cf.net requires reference to Microsoft.WindowsCE.Forms, which is typically stored in C:\Program files\microsoft.net\sdk\ compactframework\v2.0 \windowsce\microsoft.windowsce.forms.dll
Send a message
using Microsoft.WindowsCE.Forms;
public partial class MsgForm : Form
{
[DllImport("coredll.dll", EntryPoint = "RegisterWindowMessage", SetLastError = true)]
private static extern uint RegisterWindowMessage(string lpString);
private uint msgUid = RegisterWindowMessage ("MESSAGE_UID");
public static int MSG_BROADCAST = 0xFFFF;
private void SendMessage(object sender)
{
Message msg = Message.Create((IntPtr) MSG_BROADCAST, (int)msgUid , IntPtr.Zero, IntPtr.Zero);
MessageWindow.SendMessage(ref msg);
}
}