日期:2014-05-17 浏览次数:20788 次
const uint WM_CLOSE = 0x0010;
[DllImport("user32.dll", SetLastError = true)]
public static extern int PostMessage(IntPtr hWnd, uint WM_CHAR, int wParam, int lParam);
PostMessage(hWnd, WM_CLOSE, 0, 0); //SendMessage也可以,不过会阻塞当前线程