Windows message for interprocess communication under the. NET Compact Framework

Source: Internet
Author: User
Tags compact

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

}

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.