Initializare CFileDialog
Posted: 26 Oct 2012, 15:18
Am derivat o clasa din CFileDialog, in care am pus un CStatic unde pun un file preview ... totul merge OK, dar nu reusesc sa initializez acest control static chiar la deschidere ... am incercat in
nu merge ... am incercat in
nu merge ... am pus un PostInitDialogMessage:
unde ar trebui sa pun cod pentru a avea acel file preview chiar la deschiderea CFileDialog ?
Code: Select all
BOOL CFileDialogExt::OnInitDialog()
{
CFileDialog::OnInitDialog();
// TODO: Add extra initialization here
ShowFilePreview();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
Code: Select all
void CFileDialogExt::OnInitDone()
{
ShowFilePreview();
}
Code: Select all
BOOL CFileDialogExt::OnInitDialog()
{
CFileDialog::OnInitDialog();
// TODO: Add extra initialization here
::PostMessage(m_hWnd, WMU_POSTINITDIALOG, 0, 0);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CFileDialogExt::OnInitDone()
{
::PostMessage(m_hWnd, WMU_POSTINITDIALOG, 0, 0);
}
// unde
LRESULT CFileDialogExt::OnPostInitDialog(WPARAM wParam, LPARAM lParam)
{
CStatic* pStatic = (CStatic*)GetDlgItem(IDC_STATIC_PICTURE);
CBitmap bmpNoPreview;
bmpNoPreview.LoadBitmap(IDB_NOPREVIEW);
pStatic->SetBitmap(bmpNoPreview);
return 0;
}