Solved

Need Help in Customizing Common Dialog Box , WIN API

Posted on 2006-11-13
4
211 Views
Last Modified: 2010-04-01
My teacher gave me a project that i have to write a program like Notepad , but he also request when i use File->Open , there is a preview in that Open Dialog to view the Text file that i selected . I know that i must Customize the Common Dialog but the truth is i don't know where to start .
I've told that i have to define again the template in Fileopen.dlg . But my questions are :
1/when i define it again , what about all the function that it provide ? Example like GetOpenFileName , how can i reuse it ?
2/How can i add the Preview section in that Dialog box that can view text file ?
I just need the idea to do it. Thanks for reading .
0
Comment
Question by:darkangel2007
  • 2
  • 2
4 Comments
 
LVL 5

Accepted Solution

by:
NickGeorghiou earned 125 total points
ID: 17930435
0
 

Author Comment

by:darkangel2007
ID: 17935586
thank you Nick . I think that link will help . But i need a little help : how can i display the content of the selected text in the preview section . Can you please tell me ?
0
 
LVL 5

Expert Comment

by:NickGeorghiou
ID: 17935655
Hi darkangel2007,

You will need to create a custom template. Refer to the "Explorer-Style Custom Templates" section in the link I have provided. In your custom template you will need to add a control to display the preview in.

What is that you need to preview? Do you need to show some of the text that is in the text file?

If so you can probably us a static text control in your template. Whenever the selected text is changed you will then need to capture this event and check if you can open the file as a text file. Read in some lines and display them in the static text control...

I am not sure if this is exactly what is intended by preview??

Regards,
Nick

0
 

Author Comment

by:darkangel2007
ID: 17938368
Yes , it is . And i'll try it . Thanks again .
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

708 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now