本文整理汇总了C++中CDialog::OnInitDialog方法的典型用法代码示例。如果您正苦于以下问题:C++ CDialog::OnInitDialog方法的具体用法?C++ CDialog::OnInitDialog怎么用?C++ CDialog::OnInitDialog使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDialog
的用法示例。
在下文中一共展示了CDialog::OnInitDialog方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AfxDlgProc
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;
}
示例2: FontDlgProc
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;
}
示例3: ScreenSaverConfigureDialog
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;
}