您的位置:首页 > 其它

使用API函数发送消息关闭程序:WM_CLOSE=0x0010;

2014-11-12 22:06 155 查看
private void button1_Click(object sender, EventArgs e)
{
//使用API函数发送消息关闭程序:WM_CLOSE=0x0010;
SendMessage(System.Diagnostics.Process.GetCurrentProcess().MainWindowHandle, 0x0010, 0, 0);
}
[System.Runtime.InteropServices.DllImport("user32")]
private static extern Int16 SendMessage(IntPtr hWnd, Int16 Msg, Int16 wParam, Int16 lParam);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐