pretty code

2014年10月18日 星期六

How to catch windows message in wxWidgets

1. Add define in your header file.

WXLRESULT MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam);

2. Add implement in your cpp file.

WXLRESULT XXX::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
{
    switch(message)
    {
        case WM_KEY:
            break;
        default:
            break;
    }  
 
    return ZZZ::MSWWindowProc(message, wParam, lParam);
 }

XXX is your class name and ZZZ is the base class that you derive.

3. You can catch the windows message what you want now.

沒有留言: