用于FindWindow
获取父窗口的句柄。(为 lpClassName 传递 null)(更多信息:http ://www.pinvoke.net/default.aspx/user32.FindWindow )
[DllImport("user32.dll", SetLastError = true)]
static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
使用转发捕获的消息SendMessageW
(更多信息:http ://www.pinvoke.net/default.aspx/user32.SendMessage )
// Works for unicode. One can also
// use CharSet = CharSet.Unicode instead of [MarshalAs(UnmanagedType.LPWStr)]
[DllImport("user32.dll", EntryPoint = "SendMessageW")]
static extern IntPtr SendMessageW(IntPtr hWnd,
UInt32 Msg,
IntPtr wParam,
[MarshalAs(UnmanagedType.LPWStr)] string lParam);