Click to See Complete Forum and Search --> : finding default browser


May 14th, 1999, 02:59 AM
hi
i am writing an application in vc++ which is to open an html file. for this i want to know the existing browser in system.
when i am trying to get it from registry , i am not finding consistency in CLSID entries made by netscape and internetExplorer.
say internet explorer is not having entry LocalServer32 for its exe.
Is there any to find it out programatically???
just if i get the exe path of browser its enough.

please help me to find it out

Raghu

Jason Teagle
May 14th, 1999, 03:29 AM
Find the registry entry for ".html" (without the quotes), this will give the document type (the description displayed in Windows Explorer's full details view). Then, search for the shell\command\open (it's something like that, I can't remember exactly and I can't view my registry here - disabled by admin)subkey under this document type key (not under the .html key), and this should give a string of the form:

c:\somedirectory\someotherdir\iexplore.exe,1

If you strip off the ',' and digit(s), that gives you the EXE path.

If you want more info, e-mail me at jteagle@geocities.com and I'll give a code example.

Daren Chandisingh
May 14th, 1999, 06:23 AM
An alternative to manually locating the default Web browser is to let Windows do the work for you.

You can use the ShellExecute() function to open the page. For example:


char *pFile = "c:\\files\\index.html";
ShellExecute(NULL, "open", pFile, NULL, NULL, SW_SHOWNORMAL);


--
Daren Chandisingh