BOOL CALLBACK AfxDlgProc(HWND hWnd, UINT message, WPARAM, LPARAM) { if (message == WM_INITDIALOG) { // special case for WM_INITDIALOG CDialog* pDlg = DYNAMIC_DOWNCAST(CDialog, CWnd::FromHandlePermanent(hWnd)); if (pDlg != NULL) return pDlg->OnInitDialog(); else return 1; } return 0; }
UINT_PTR CALLBACK CXTPPropertyGridItemFont::FontDlgProc(HWND hWnd, UINT message, WPARAM, LPARAM) { // special case for WM_INITDIALOG if (message == WM_INITDIALOG) { HWND hWndCombo = GetDlgItem(hWnd, 1139); if (hWndCombo) EnableWindow(hWndCombo, FALSE); CDialog* pDlg = DYNAMIC_DOWNCAST(CDialog, CWnd::FromHandlePermanent(hWnd)); if (pDlg != NULL) return (UINT_PTR)pDlg->OnInitDialog(); else return 1; } return 0; }
BOOL WINAPI ScreenSaverConfigureDialog(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { ASSERT(AfxGetScreenSaverDialog()); if (!AfxGetScreenSaverDialog()) return 0L; if (!AfxGetScreenSaverDialog()->m_hWnd) AfxGetScreenSaverDialog()->Attach(hDlg); LRESULT lResult; if (uMsg == WM_INITDIALOG) { // special case for WM_INITDIALOG CDialog* pDlg = DYNAMIC_DOWNCAST(CDialog, CWnd::FromHandlePermanent(hDlg)); if (pDlg != NULL) lResult = pDlg->OnInitDialog(); else lResult = 1; } else { lResult = AfxCallWndProc( AfxGetScreenSaverDialog(), AfxGetScreenSaverDialog()->m_hWnd, uMsg, wParam, lParam); } if (uMsg == WM_NCDESTROY) { ASSERT(!AfxGetScreenSaverDialog() || !AfxGetScreenSaverDialog()->m_hWnd); } return lResult; }