ndProc ASSERToldWndProc NULL pOldWndProc oldWndProc else endif // subclass the window with standard AfxWndProc WNDPROC afxWndProc AfxGetAfxWndProc oldWndProc WNDPROCSetWindowLonghWnd GWL_WNDPROC DWORDafxWndProc ASSERToldWndProc NULL if oldWndProc afxWndProc pOldWndProc oldWndProc pThreadState-gtm_pWndInit NULL else ASSERTafxContextIsDLL // should never get here // subclass the window with the proc which does gray backgrounds oldWndProc WNDPROCGetWindowLonghWnd GWL_WNDPROC if oldWndProc NULL ASSERTGetProphWnd szAfxOldWndProc NULL SetProphWnd szAfxOldWndProc oldWndProc if WNDPROCGetProphWnd szAfxOldWndProc oldWndProc SetWindowLonghWnd GWL_WNDPROC DWORDpThreadState-gtm_bDlgCreate _AfxGrayBackgroundWndProc : _AfxActivationWndProc ASSERToldWndProc NULL LRESULT lResult CallNextHookExpThreadState-gtm_hHookOldCbtFilter co de wParam lParam ifndef _AFXDLL if afxContextIsDLL ::UnhookWindowsHookExpThreadState-gtm_hHookOldCbtFilter pThreadState-gtm_hHookOldCbtFilter NULL endif return lResult // always indirectly accessed via AfxGetAfxWndProc WNDPROC AFXAPI AfxGetAfxWndProc ifdef _AFXDLL return AfxGetModuleState-gtm_pfnAfxWndProc // 如果MFC是动态连入返回的地址是AfxWndProcBase else return ampAfxWndProc // 否则返回AfxWndProc endif // The WndProc for all CWnd’s and derived classes LRESULT CALLBACK AfxWndProcHWND hWnd UINT nMsg WPARAM wParam LPARAM lParam // special message which identifies the window as using AfxWndProc if nMsg WM_QUERYAFXWNDPROC 查询是否为AFX的窗口过程 return 1 // all other messages route through message map CWnd pWnd CWnd::FromHandlePermanenthWnd FromHandlePermanent函数用于返回一个和hWnd句柄对应的 永久的CWnd类所谓永久的就是CWnd调用了Attach函数 连上了一个窗口句柄。
ASSERTpWnd NULL ASSERTpWnd-gtm_hWnd hWnd return AfxCallWndProcpWnd hWnd nMsg wParam lParam 函数见后 ifdef _AFXDLL undef AfxWndProc LRESULT CALLBACK AfxWndProcBaseHWND hWnd UINT nMsg WPARAM wParam LPARAM lParam AFX_MANAGE_STATE_afxBaseModuleState.GetData // 由于MFC是动态连入的所以必须要这条语句 return AfxWndProchWnd nMsg wParam lParam 调用MFC静态连入时使用的函数 endif // 微软官方规定的发送消息给CWnd的函数 LRESULT AFXAPI AfxCallWndProcCWnd pWnd HWND hWnd UINT nMsg WPARAM wParam 0 LPARAM lParam 0 _AFX_THREAD_STATE pThreadState _afxThreadState.GetData MSG oldState pThreadState-gtm_lastSentMsg // save for nesting pThreadState-gtm_lastSentMsg.hwnd hWnd pThreadState-gtm_lastSentMsg.message nMsg pThreadState-gtm_lastSentMsg.wParam wParam pThreadState-gtm_lastSentMsg.lParam lParam ifdef _DEBUG if afxTraceFlags amp traceWinMsg _AfxTraceMsg_TquotWndProcquot amppThreadState-gtm_lastSentMsg endif // Catch exceptions thrown outside the scope of a callback // in debug builds and warn the user. LRESULT lResult TRY ifndef _AFX_NO_OCC_SUPPORT // special case for WM_DESTROY if nMsg WM_DESTROY ampamp pWnd-gtm_pCtrlCont NULL pWnd-gtm_pCtrlCont-gtOnUIActivateNULL endif // special case for .
上一篇:
VC编程技术600个大型项目源码
下一篇:
性病门诊非淋菌性泌尿生殖道感染965例支原体检测及