MFC Programming question


What is the easiest way to customize the Explorer-stly FileOpen dialog using MFC?  I know how to do it SDK-style by hooking the dialog procedure and I know how to customize the old-style common dialogs in MFC by using a child window dialog containing the new controls, but I am looking for a more elegant way to be able to add my own controls to the dialog.  Am I stuck with dynamically placing the controls on the dialog and hooking into it for processing?  Has somebody already solved this problem?

Thank in advance...
derrickhAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
MarkusLoiblConnect With a Mentor Commented:
I have some little code for your problem, tell me your e-mail and I'll send you
0
 
AVaulinCommented:
You must write class delivered from CFileDialog, add any controls you want in OnInitDialog method (use Create method for each control) and handle any messages you need (if for example you want to add button you must use ON_COMMAND macro to add button pressing handle).
Good luck.
0
 
derrickhAuthor Commented:
You told me what I already said in the question: "Am I stuck with dynamically placing the controls on the dialog and hooking into it for processing?"

This is exactly what I didn't want to do.  The method that is more MFC-like is to create a dialog template with the new controls using the VC Studio and attach it to the default dialog using the DS_CHILD and OFN_ENABLETEMPLATE flag.  If I do that though, I still need to be able to capture all of the new controls' messages.  Can I still do this in the message map? And if so, can you please elaborate a little more than you did in the original answer.  

I am trying to avoid using the "OFN_ENABLEHOOK" flag for the new controls.
0
 
derrickhAuthor Commented:
My e-mail is derrick@prismnet.com.
0
 
derrickhAuthor Commented:
That's it!  The MFC solution using the OnInitDone() was what I was looking for.  Thanks!
0
All Courses

From novice to tech pro — start learning today.