Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 266
  • Last Modified:

Need Help in Customizing Common Dialog Box , WIN API

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
darkangel2007
Asked:
darkangel2007
  • 2
  • 2
1 Solution
 
darkangel2007Author Commented:
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
 
NickGeorghiouCommented:
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
 
darkangel2007Author Commented:
Yes , it is . And i'll try it . Thanks again .
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now