INT_PTR CALLBACK CBaseDialog::InitialDlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { if (uMsg == WM_INITDIALOG) { CBaseDialog* dialog = (CBaseDialog*)lParam; dialog->m_Window = hWnd; SetWindowLongPtr(hWnd, DWLP_USER, (LONG_PTR)dialog); SetWindowLongPtr(hWnd, DWLP_DLGPROC, (LONG_PTR)MainDlgProc); return dialog->HandleMessage(uMsg, wParam, lParam); } return FALSE; }
INT_PTR CALLBACK CBaseDialog::MainDlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { CBaseDialog* dialog = (CBaseDialog*)GetWindowLongPtr(hWnd, DWLP_USER); return dialog->HandleMessage(uMsg, wParam, lParam); }