public static string GetMsgStr(Message m) { System.Type cls = new CommonControl.COPYDATASTRUCT().GetType(); CommonControl.COPYDATASTRUCT lParam = (CommonControl.COPYDATASTRUCT)m.GetLParam(cls); int dwData = (int)lParam.dwData; byte[] destination = new byte[lParam.cbData]; Marshal.Copy(lParam.lpData, destination, 0, destination.Length); return(Encoding.Default.GetString(destination)); }
public static extern bool PostMessage(IntPtr hWnd, int Msg, int wParam, ref CommonControl.COPYDATASTRUCT lParam);
private static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, ref CommonControl.COPYDATASTRUCT lParam);