Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to "preview" a txt or html from Visual C++?

Status
Not open for further replies.

Insider1984

Technical User
Feb 15, 2002
132
US
basically I know about WinExec and system functions but niether will work for this.

I created a txt file or html file from my program and using the windows default application I would like to open it. Basically simulate opening the text file where it would normally open up.

Again sorry for the easy ones... I learn by doing and so far I havn't had to do this. =====================
Insider
4 year 'on the fly' programmer
C++ Basic Java
 
I'm not 100% sure I understand the question, but... if you just want to launch a file as if it were double clicked in Windows Explorer, one easy way to do this is to use ShellExecute:


ShellExecute( NULL, "open", "c:\\myfile.txt", NULL, "c:\\myfile.txt", SW_SHOWNORMAL );


For more info, see

Sorry if that wasn't what you were asking.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top