1.在窗口的头文件中声明:
afx_msg LRESULT OnMyMessage(WPARAM wParam, LPARAM lParam);
2.在cpp的BEGIN_MESSAGE_MAP和END_MESSAGE_MAP之间声明:
ON_MESSAGE(WM_MY_MSG, OnMyMessage)
3.实现OnMyMessage:
LRESULT CDlg::OnMyMessage(WPARAM wParam, LPARAM lParam)
{
switch (wParam)
{
case WM_CLOSE:
break;
default:
break;
}
return 0;
}
手机扫一扫
移动阅读更方便
你可能感兴趣的文章