Solved

Adding a New PushButton to CFileDialog

Posted on 1998-06-29
3
400 Views
Last Modified: 2013-11-20
Can Some one post me a method to add a PushButton like example07b of david .j. kruglinski in vc++ 5.0
I did use GetParent method to get handle of IDOK but my new button which i created did not show in cfiledialog (dwStyle has WS_VISIBLE flag)
0
Comment
Question by:shriya
  • 2
3 Comments
 
LVL 7

Expert Comment

by:galkin
ID: 1318492
To add a control to standard dialog you must define your own dialog template. open comctl32.dlg as resources, find common dialog you want to use, copy it to your resources. Open dialog resource in resource editor, add control to the template.Add OFN_ENABLETEMPLATE flag to Flags field of m_ofn structure and specify template name in lpTemplateName field of this structure.
0
 
LVL 1

Author Comment

by:shriya
ID: 1318493
Actually I wnted to add a push-Button at runtime without using Resource editor.
This was done by David Kruglinski in version 1.5
I tried the same but couldn't achieve it.
it need not be cFiledialog even
aboutDialog box would do(only I should do it without using resource editor.
0
 
LVL 7

Accepted Solution

by:
galkin earned 50 total points
ID: 1318494
If you want to add button at run time use file dialog hook procedure. It is lpfnHook member of m_ofn structure. OFN_ENABLEHOOK flag must be set. You must also implement hook procedure that will receive all messages and windows handle of the window that is sent a message. You can catch WM_CREATE window for dialog window and create your button
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
windows 10 how make picture as desktop background 2 62
Best tools for Backup and restore of Wordpress site 6 57
substring method in java 1 122
Doc'in system (example?) BA 7 111
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

778 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