Solved

Customizing CFileDialog

Posted on 1997-04-06
1
1,222 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
Suggested Courses

734 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