Solved

Need Help in Customizing Common Dialog Box , WIN API

Posted on 2006-11-13
4
223 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

920 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

16 Experts available now in Live!

Get 1:1 Help Now