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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Launching programs within a Visual C++ program

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi,

I'm writing a program that has a html help file. Does anyone know how to launch a web browser from within a C++ program? I tryed system("my.html") but it didn't seem to work.

Thanks for any help.

 
you should try :

ShellExecute(hwndYourWindow,"open","my.html", NULL,NULL,SW_SHOWNORMAL);

or even better :

ShellExecute(hwndYourWindow,"open","C:\\path\\to\\my.html", NULL,NULL,SW_SHOWNORMAL);

look the MSDN documents on ShellExecute()
another command is CreateProcess() but I think
ShellExecute() is everything you need.
 
MSDN magazine in it's prior incarnations also discussed adding a browser control to your application (rather than just kicking one off). Here's a link (the article contains a couple more):


There was also a book put out by Microsoft Press, called, "Programming Microsoft Internet Explorer 5.0" which is no longer in print, but is available at used bookstores online:

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top