c#进程间通信-接收消息

 
        /// <summary>
        /// 接收消息
        /// </summary>
        /// <param name="m">参数</param>
        protected override void DefWndProc(ref Message m)
        {
            try
            {
                if (m.Msg == WM_COPYDATA)
                {
                    COPYDATASTRUCT str = new COPYDATASTRUCT();
                    Type sendtype = str.GetType();
                    str = (COPYDATASTRUCT)m.GetLParam(sendtype);
                    string receiveData = str.lpData;
                    if (receiveData == "Over")
                    {
                        SendMsg("多媒体播放器", "StopReadText|" + this.Text);
                        isplay = false;
                    }
                }
            }
            catch
            {

            }
            base.DefWndProc(ref m);
        }

你可能感兴趣的:(c#进程间通信-接收消息)