/// <summary> /// 接收消息 /// </summary> /// <param name="m"></param> protected override void DefWndProc(ref System.Windows.Forms.Message m) { switch (m.Msg) { case NativeMethods.WM_COPYDATA: COPYDATASTRUCT mystr = new COPYDATASTRUCT(); Type mytype = mystr.GetType(); mystr = (COPYDATASTRUCT)m.GetLParam(mytype); if (mystr.lpData.StartsWith("open")) { showDetail(mystr.lpData.Substring(mystr.lpData.IndexOf("-")+1),true); } else if (mystr.lpData.StartsWith("manualopen")) { showDetail(mystr.lpData.Substring(mystr.lpData.IndexOf("-") + 1), false); } else if (mystr.lpData.StartsWith("close")) { closeDetail(); } else { Detail_1.WINDOW_HANDLER = int.Parse(mystr.lpData); } break; default: base.DefWndProc(ref m); //MessageBox.Show("no"); break; } }
public static extern int SendMessage( int hWnd, // handle to destination window int Msg, // message int wParam, // first message parameter ref COPYDATASTRUCT lParam // second message parameter );
/// <summary> /// 接收来自详细页面的消息 /// </summary> /// <param name="m"></param> protected override void DefWndProc(ref System.Windows.Forms.Message m) { switch (m.Msg) { case NativeMethods.WM_COPYDATA: COPYDATASTRUCT mystr = new COPYDATASTRUCT(); Type mytype = mystr.GetType(); mystr = (COPYDATASTRUCT)m.GetLParam(mytype); if (mystr.lpData.StartsWith("isdetailclick")) { LogUtil.debug("isdetailclick:" + mystr.lpData); ControlCenter.pauseTime = DateTime.Now; ControlCenter.isPause = true; } else if (mystr.lpData.StartsWith("startindex"))//回首页 { LogUtil.debug("startindex:" + mystr.lpData); cc.playIndex(); } else if (mystr.lpData.StartsWith("nextdetail"))//播放下一个详情页面 { LogUtil.debug("nextdetail:" + mystr.lpData); ControlCenter.isColseDetail = true; } else if (mystr.lpData.StartsWith("exit"))//退出系统 { //先kill SystemUtil.KillProcess("sungrow_touch"); //先清理资源再退出程序 if (Main.cc != null) Main.cc.clear(); //为防本程序的进程不能成功退出而导致GE出现问题,强制杀掉本程序的进程 //System.Diagnostics.Process geProcess = System.Diagnostics.Process.GetCurrentProcess(); //geProcess.Kill(); this.Close(); LogUtil.debug("exit:" + mystr.lpData); Environment.Exit(0); } break; default: base.DefWndProc(ref m); //MessageBox.Show("no"); break; } }
public static extern int SendMessage( int hWnd, // handle to destination window int Msg, // message int wParam, // first message parameter ref COPYDATASTRUCT lParam // second message parameter );