Modifying common dialogs 
Author Message
 Modifying common dialogs

I am developing a dialog application which requires a control in the
top-left of the dialog with which you must select a directory.

Rather than reinvent the wheel, I want to modify the Fileopen Common
Dialog. I have been reading Professional MFC (Wrox Press) by Mike
Blasckack (wrong spelling, sorry) which describes how to do this, but
not well enough for me (even though there is an example, doh.). Can
someone please walk me through it using MVC++ 5.0? I have reasoned
that I could subclass my Main Dialog from the Fileopen Dialog an then
add extra controls, but this doesn't seem like the best method.

For better encapsulation I want the Fileopen Dialog to be fixed to the
top-left of my main dialog, so that the main dialog can be left to
worry about sizing/control placement issues. Or can I just rip out the
tree directory control from the Fileopen dialog and place it on my
main dialog?

Surely I don't have to populate my own tree control with directory
information and write all of the necessary methods?

Any advice gratefully received.


Thanks



Thu, 30 Aug 2001 03:00:00 GMT  
 Modifying common dialogs
Hi,

I don't know if it works for VC5.0 the following is for VC6.0 and a win95
system with the explorer update.

You have to do the following.

First create your own dialog. Now in this dialog create a invisible static
control with the magical id: stc32. The point where this control is inserted
is the place where win95 will place the controls.

This only works if you got the new explorer look dialog boxes!! (the one
with the list button etc.).

Now size this stc32 control to occupy the area of the common dialog. Check
the control box in the more styles tab. Ok save it your almost there.

Now create a new class with the class wzzard:

class CNewFileDlg : public CFileDialog

Now let your DoModal meber look like this: (the IDD_NPDLG should match the
ID of your dialog box the one with the stc32 control).

In the  m_ofn.Flags |= OFN_ENABLETEMPLATE ;
 m_ofn.lpTemplateName = MAKEINTRESOURCE( IDD_NPDLG );

 return CFileDialog::DoModal();

Use it in your program.



Quote:
>I am developing a dialog application which requires a control in the
>top-left of the dialog with which you must select a directory.

>Rather than reinvent the wheel, I want to modify the Fileopen Common
>Dialog. I have been reading Professional MFC (Wrox Press) by Mike
>Blasckack (wrong spelling, sorry) which describes how to do this, but
>not well enough for me (even though there is an example, doh.). Can
>someone please walk me through it using MVC++ 5.0? I have reasoned
>that I could subclass my Main Dialog from the Fileopen Dialog an then
>add extra controls, but this doesn't seem like the best method.

>For better encapsulation I want the Fileopen Dialog to be fixed to the
>top-left of my main dialog, so that the main dialog can be left to
>worry about sizing/control placement issues. Or can I just rip out the
>tree directory control from the Fileopen dialog and place it on my
>main dialog?

>Surely I don't have to populate my own tree control with directory
>information and write all of the necessary methods?

>Any advice gratefully received.


>Thanks



Thu, 30 Aug 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Modifying common dialogs

2. Modified common dialog ASSERTS - why?

3. How do I modify common dialog boxes?

4. Modified Common Control from C++ to VB

5. Cannot display the dialog derived from common file dialog

6. Nesting Common File Dialog within my Dialog

7. Common Open Dialog not displaying a dialog when file doesn't exist

8. Common areas/common data/data sharing

9. Transparent dialog in property sheet with Windows XP common controls

10. using common dialog HookProc

11. Common Dialog Problem

12. common dialog control directory select

 

 
Powered by phpBB® Forum Software