Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Add buttons to CFileDialog

Posted on 1998-10-18
7
Medium Priority
?
376 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 150 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

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…
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

618 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