Solved

Customizing CFileDialog

Posted on 1997-04-06
1
1,209 Views
Last Modified: 2013-11-20
- I want my users to be able to change or pick directories by using a customized CFileDialog. To me this means: I want to turn the CFileDialog into a -let's call it a-  'CFolderDialog'. This CFolderDialog should not show files, but folders only.

- a related question:
Every article I've read about 'customizing the CFileDialog'  emphasizes on adding controls to the thing, not on how to remove them. E.g. I would like to hide the "Files of type" edit control. How to get its control ID?
0
Comment
Question by:gunnar
1 Comment
 
LVL 2

Accepted Solution

by:
rajesh032097 earned 100 total points
ID: 1300879
Hi,
You can call following method to hide the "file type" control in your CFolderDialog::OnInitDialog()
CFolderDialog::OnInitDialog()
{
 CFileDialog::OnInitDialog();
 /// other code
 CWnd* pParent = GetParent();
 /// cmb1 is the resource ID of the "File Type " combo box.
 /// the other combo box has ID of cmb2
 CWnd* c8 = pParent->GetDlgItem(cmb1);
 c8->ShowWindow(SW_HIDE);
 }

I hope it will work.
In fact there is a tricky way to get control ID's of all the controls in the CFileDialog class. If you want, I will give you that.
For other parameter settings, I hope you are using various flags given in the CFileDialog constructor.

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
mixString challenge 36 112
sumNumber challenge 16 112
matchUp  challenge 6 53
post4 challenge 28 93
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now