LONG CSaverWnd::WndProc(UINT a_uMsg, WPARAM a_wParam, LPARAM a_lParam) { switch (a_uMsg) { case WM_NCCREATE: return OnNCCreate(reinterpret_cast<CREATESTRUCT*>(a_lParam)) ; case WM_CREATE: return OnCreate(reinterpret_cast<CREATESTRUCT*>(a_lParam)) ? 0L : -1L ; case WM_ACTIVATEAPP: return OnActivateApp(a_wParam, a_lParam) ? 0L : -1L ; case WM_DESTROY: OnDestroy() ; return 0L ; case WM_NCDESTROY: OnNCDestroy() ; return 0L ; case WM_PAINT: return OnPaint() ? 0L : -1L ; case WM_MOUSEMOVE: POINT pt ; pt.x = LOWORD(a_lParam) ; pt.y = HIWORD(a_lParam) ; OnMouseMove(a_wParam, pt) ; return 0 ; case WM_SYSCOMMAND: if (OnSysCommand(a_wParam, a_lParam)) { return 0 ; } break ; } return ::DefWindowProc(m_hWnd, a_uMsg, a_wParam, a_lParam) ; }
//-------------------------------------------------------------------------------- bool CNCController::ProcessMessage( COSWindow& Window, Cmp_long_ptr& lResult, unsigned int uMsg, Cmp_uint_ptr Cmp_uint_ptr, Cmp_long_ptr Cmp_long_ptr ) { _WINQ_FCONTEXT( "CNCController::ProcessMessage" ); bool bProcessed = ProcessHook( Window, lResult, uMsg, Cmp_uint_ptr, Cmp_long_ptr ); if( bProcessed ) { return true; } switch ( uMsg ) { case COSWindow::wmNCCreate: { OnNCCreate( Window, lResult, Cmp_uint_ptr, Cmp_long_ptr ); bProcessed = true; } break; case COSWindow::wmNCActivate: { OnNCActivate( Window, lResult, Cmp_uint_ptr, Cmp_long_ptr ); bProcessed = true; } break; case COSWindow::wmNCDestroy: { OnNCDestroy( Window, lResult, Cmp_uint_ptr, Cmp_long_ptr ); bProcessed = false;//The top level window must see this to clean up } break; } return bProcessed; }