Solved

Add buttons to CFileDialog

Posted on 1998-10-18
7
364 Views
Last Modified: 2013-11-20
I want to add custom buttons to the common File Dialog.
How can I do that?
0
Comment
Question by:michali
[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
7 Comments
 

Expert Comment

by:jbalagop
ID: 1323491
if you have the handle to the file dialog when you create the CFileDialog class (using new). just use the handle to draw into the FileDialog. Also once you have the handle, one can add more controls in it. Also, make sure you do this before you call DoModal().
0
 
LVL 5

Expert Comment

by:AnswerTheMan
ID: 1323492
i have a full code for that. increase points.
0
 
LVL 11

Expert Comment

by:mikeblas
ID: 1323493
jbalagop's answer isn't even close to correct. He proves his incorrectness himself--you don't get a handle to the window until you call DoModal(), and even then, the call is modal and you can't see the handle unless you sublcass from CFileDialog.

I'm not sure why you'd need more than 50 points to provide a sample; the whole process isn't even ten lines long!

The way to go is to derive your own class from CFileDialog. Before you call Create() or DoModal(), make sure you set the flags in m_ofn to use an additional template. Then, set the template name and the resource handle in m_ofn to point at the template you want to use.

See http://www.nwlink.com/~mikeblas/samples/custfile.zip for a complete sample that works in VC++ 6.0.

B ekiM

0
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!

 
LVL 3

Expert Comment

by:zhongbing
ID: 1323494
1. derive your own class from CFileDialog, after that, you can just deal with it like a normal dialog.

2. use the same way just like add a button to a dialog, not by Resource editer but. you should use CButton->Create() to create it.

3. then show you dialog.


0
 
LVL 3

Expert Comment

by:zhongbing
ID: 1323495
sorry for the wrong answer, yes, it can't work.
0
 
LVL 1

Expert Comment

by:Bridge
ID: 1323496
The question was answered by me in 'Page Setup dialog customization'
0
 
LVL 11

Accepted Solution

by:
mikeblas earned 50 total points
ID: 1323497
Huh?  What's wrong with my answer?  Download the sample: it works and does exactly what you asked for here.

B ekiM


0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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

Suggested Solutions

Title # Comments Views Activity
repeateFront java challenge 31 95
how do i create updater to My Activex application? 3 102
isEverywhere  challenge 19 86
zeroFront challenge 7 124
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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 …
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.
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

726 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