Solved

Customizing CFileDialog

Posted on 1997-04-06
1
1,217 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Different colored text in ComboBox without Subclassing 8 66
Generic progress indicator 6 117
matchUp  challenge 9 115
unix example issues 18 98
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
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 a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

861 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