0
点赞
收藏
分享

微信扫一扫

MFC 简单的事件测试

MFC 简单的事件测试_clementine

View 的 WM_LBUTTONDOWN 事件消息。

void CMFCApplication1View::OnLButtonDown(UINT nFlags, CPoint point)
{
    CString str;
    str.Format(TEXT("x = %d, y = %d"), point.x, point.y);
    MessageBox(str);

    CView::OnLButtonDown(nFlags, point);
}

MFC 简单的事件测试_clementine_02

View 的 WM_CHAR 事件消息。

void CMFCApplication1View::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
    TCHAR ch = (TCHAR)nChar;
    CString str;
    str.Format(TEXT("%c"), ch);
    MessageBox(str);

    CView::OnChar(nChar, nRepCnt, nFlags);
}



举报

相关推荐

0 条评论