DuiLib -- HandleMessage HandleCustomMessage MessageHandler

Simple

HandleMessage HandleCustomMessage MessageHandler 三者区别

LRESULT CWindowWnd::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    return ::CallWindowProc(m_OldWndProc, m_hWnd, uMsg, wParam, lParam);
}
LRESULT WindowImplBase::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    lRes = HandleCustomMessage(uMsg, wParam, lParam, bHandled);
    if (bHandled) return lRes;

    if (m_PaintManager.MessageHandler(uMsg, wParam, lParam, lRes))
        return lRes;
    return CWindowWnd::HandleMessage(uMsg, wParam, lParam);
}
//CWindowWnd是父类,WindowImplBase是子类
class UILIB_API WindowImplBase : public CWindowWnd


如果派生类 如果实现这些虚函数 执行顺序如下:
HandleMessage --> HandleCustomMessage --> MessageHandler


因此只要实现HandleCustomMessage即可
阅读 159
7 声望
1 粉丝
0 条评论
7 声望
1 粉丝
宣传栏