Click to See Complete Forum and Search --> : How to use "m_ofn.lpfnHook" to Customizing CFileDialog


xipeng
April 3rd, 1999, 01:39 PM
I want to custom a CFileDialog,
but I don't know how to use "lpfnHook" attrib in "OPENFILENAME" struct.
And I derive a new class from CFileDialog,
how to get controls' message from CFileDialog after I custom a CFileDialog.

Magnus Eklof
April 8th, 1999, 02:55 AM
Well, if you haven't done it, check the Dev Studio help. Search for OPENFILENAME and then have a look at the Flags part way down, the flag OFN_EXPLORER will link you to an extensive help on the subject. I can give you a few hints from my memory though. Use the flags OFN_EXPLORER | OFN_ENABLEHOOK and then you need to set lpfnHook (in OPENFILENAME) to point to your Hook procedure (OFNHookProc type). You can also add controls by using a child template, add the flag OFN_ENABLETEMPLATE, and draw your template and set lpTemplateName (in OPENFILENAME) to the name of the template.
Please reply if you still have problems and I should be able to dig up a directory browser class (derived from CFileDialog and using a child template) I made. I could post some code.

/Magnus