private static extern int SendMessage ( int hWnd, // 目标窗口的句柄 int Msg, // 在这里是WM_COPYDATA int wParam, // 第一个消息参数 ref ECGExplore.MainForm.CopyDataStruct lParam // 第二个消息参数 );
/// <summary> /// 接收消息,得到消息字符串 /// </summary> /// <param name="m">System.Windows.Forms.Message m</param> /// <returns>接收到的消息字符串</returns> public static string ReceiveMessage(ref System.Windows.Forms.Message m) { ECGExplore.MainForm.CopyDataStruct cds = (ECGExplore.MainForm.CopyDataStruct)m.GetLParam(typeof(ECGExplore.MainForm.CopyDataStruct)); return(cds.lpData); }