Spawning default web browser.
Posted on 1998-05-08
I am writing an MFC application under Windows 95. My application generates
html files, and I would like to include a preview button which opens the user's
default web browser with a particular local html document.
I think there are two approaches to this problem:
1) Look in the registry for the user's default web browser, then use spawnl() to launch it,
sending the html file as a command-line argument.
2) Somehow use the normal Windows mechanism for launching the appropriate
application associated with a particular filetype.
My problem with (1), is that I don't know where in the registry to look for the
default web browser.
My problem with (2), is that I don't know how to access the normal Windows mechanism
for launching the application associated with a file extension. spawnl() fails when asked
to execute an html file.