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

Call the default browser

Status
Not open for further replies.

BobbyB

Programmer
Feb 19, 2002
44
CA
How can I call the default browser(or internet explorer if it's easier) to display a website with MFC?
 
1. You could read the registry key "HKCR\htmlfile\shell\open\command" to retrive the full qualified path to the executabile (default browser)

2. ShellExecute(0, "open",
pszMyHTMLFile, 0, 0, SW_SHOWNORMAL);

3. Use FindExecutabile with the name of html file as first parameter.

HTH,
s-)

Blessed is he who in the name of justice and goodwill, sheperds the weak through the valley of darkness...
 
2. ShellExecute(0, "open", pszMyHTMLFile, 0,
0,SW_SHOWNORMAL);

seems only to work if the internet explorer is already open... Is this normal or it's(maybe) beacause I'm using NT 4.0
 
No, I too have IE6.0 on NT4.0 (with service pack 6) and the call to the shell function works even if IExplorer is not open. It simply starts a new instance of IntrenetExplorer

Try the other two aproaches if you have problems though,

All the best, s-)

Blessed is he who in the name of justice and goodwill, sheperds the weak through the valley of darkness...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top