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

How to open .htm file in new browser? 1

Status
Not open for further replies.

hstijnen

Programmer
Nov 13, 2002
172
NL
Hi,

I'd like to open a htm file from my CBuilder app. I use the following statement:

ShellExecute(NULL
,"open"
,"file://server_IP/path/test.htm"
,""
,""
,SW_SHOWDEFAULT);

It opens indeed the file. However, when I have a browser opened it opens the file in that browser. How can I force to open it in a new browser?

Thanks for help,

Regards, Henk
 
Don't open the URL directly. With ShellExecute() run browser's .exe and pass the URL as the parameter.
Code:
 ShellExecute(NULL, "open", "[Browser's .exe]", "[URL]", "", SW_SHOWDEFAULT);
 
Off topic:
How do you create such a block to display program code?
 
While writing a post, click "Preview Post" button. In "Editing Tips" there is a line Click Here for the full list of TGML tags..., click and find out how to beautify your post. The code blocks are explained in the table second from the end.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top