?
Solved

Customizing CFileDialog

Posted on 1997-04-06
1
Medium Priority
?
1,225 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 300 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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…
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.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses
Course of the Month12 days, 2 hours left to enroll

752 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