Customized File Open Dialog 
Author Message
 Customized File Open Dialog

Hi,

I am trying to prevent the OnOpenDocument method from opening the
default directory dialog box, and instead to open my personalized
dialog box. How is that possible, short of using an OnOpenFile
menu handler?

Thanks for any help.

Regards,
Gerard



Mon, 02 Sep 2002 03:00:00 GMT  
 Customized File Open Dialog
Short of nothing ... you have to put some work in here

This is the framework code:

void CWinApp::OnFileOpen()
{
 ASSERT(m_pDocManager != NULL);
 m_pDocManager->OnFileOpen();

Quote:
}

and

void CDocManager::OnFileOpen()
{
 // prompt the user (with all document templates)
 CString newName;
 if (!DoPromptFileName(newName, AFX_IDS_OPENFILE,
   OFN_HIDEREADONLY | OFN_FILEMUSTEXIST, TRUE, NULL))
  return; // open cancelled

 AfxGetApp()->OpenDocumentFile(newName);
  // if returns NULL, the user has already been alerted

Quote:
}

From this you can see that the only real way to do it is to handle the
message ID_FILE_OPEN in your derived application class
( available from within class wizard ) and changing

 ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)

in your application's message map to

 ON_COMMAND(ID_FILE_OPEN, CMyDerivedWinApp::OnFileOpen)



Mon, 02 Sep 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Problem with customized File Open Dialog

2. Customized File Open/Save Dialog problem

3. Customizing Open File Dialog -- am I right?

4. Customizing Open File Dialog -- am I right?

5. DDX member variables are not updated in Customized Open File Dialog

6. Customize standard file open dialog list view control

7. customizing Open File Dialog...

8. how to customize IE's Open dialog ?

9. customize 'office like' file open

10. File Open Dialog - Open button Enable&Disable

11. File Open Dialog - Open button Enable&Disable

12. File Open Dialog - Open button Enable&disable

 

 
Powered by phpBB® Forum Software