MFC passes a single global function as the generic window message procedure, which uses a map from HWND to a CWnd object pointer to translate a Win32 window handle into a pointer to a C++ window object.