进程之间发送消息
使用到的Window API
1.ChangeWindowMessageFilterEx
2.FindWindow
3.PostMessage
直接上代码
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
[DllImport("user32.dll")]
public static extern bool ChangeWindowMessageFilterEx(IntPtr HWnd, uint Msg, int WParam, IntPtr LParam);
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
[DllImport("user32.dll", SetLastError = true)]
public static extern bool PostMessage(IntPtr hWnd, int Msg, int wParam, ref COPYDATASTRUCT lParam);