响应VC++ 标题栏右边的关闭按钮“红叉”

击标题栏右边的关闭按钮“红叉”时,程序会向窗口发送WM_CLOSE消息,因此可以截取此消息在窗口关系前做一些提示或者是不允许点击时关闭程序

[cpp] view plain copy
 
 在CODE上查看代码片派生到我的代码片
  1. case WM_CLOSE:  
  2.     if (...)  
  3.     {  
  4.         PostQuitMessage(WM_QUIT);  
  5.         return 0;  
  6.     }  
  7.     else  
  8.     {  
  9.         return 1;  
  10.     }  
  11.       

http://blog.csdn.net/x356982611/article/details/16946503

原文地址:https://www.cnblogs.com/findumars/p/5342116.html