摘要: 在C#的WinForm程序中,是用户点击了右上角的“关闭”按钮,还是调用了WinForm.Close()方法。最典型的是要知道点击右上角的“关闭”按钮发出的事件。下面这个方法可以判断这点:protected override void WndProc(refMessage msg) { const int WM_SYSCOMMAND = 0x0112;const int SC_CLOSE = 0xF060; if (msg.Msg == WM_SYSCOMMAND&& ((int)msg.WParam == SC_CLOSE)){//Doing Something return;}base.W 阅读全文
posted @ 2011-01-30 14:12 文明的天空 阅读(508) 评论(0) 推荐(0) 编辑