WM_CLOSE

来源:互联网 发布:黑暗森林威慑 知乎 编辑:程序博客网 时间:2024/06/01 15:27
下面是系统菜单命令值/* * System Menu Command Values */#define SC_SIZE         0xF000#define SC_MOVE         0xF010#define SC_MINIMIZE     0xF020#define SC_MAXIMIZE     0xF030#define SC_NEXTWINDOW   0xF040#define SC_PREVWINDOW   0xF050#define SC_CLOSE        0xF060#define SC_VSCROLL      0xF070#define SC_HSCROLL      0xF080#define SC_MOUSEMENU    0xF090#define SC_KEYMENU      0xF100#define SC_ARRANGE      0xF110#define SC_RESTORE      0xF120#define SC_TASKLIST     0xF130#define SC_SCREENSAVE   0xF140#define SC_HOTKEY       0xF150#if(WINVER >= 0x0400)#define SC_DEFAULT      0xF160#define SC_MONITORPOWER 0xF170#define SC_CONTEXTHELP  0xF180#define SC_SEPARATOR    0xF00F#endif /* WINVER >= 0x0400 */窗口上的关闭按钮 发送的是  WM_SYSCOMMAND, SC_CLOSE 消息关闭清理等工作 推荐重载 对话框的 DestroyWindow 中处理 当点击右上角的关闭按钮:WM_CLOSE ->WM_SYSCOMMAND ->WM_COMMAND(IDCANCEL)->WS_DESTROY->WM_NCDESTROY