MFC to open IE

  • Thread starter Thread starter Janiv Ratson
  • Start date Start date
J

Janiv Ratson

Hello,

What is the best programmatic way to open a URL explicitly using IE
(assuming IE is installed on a machine, but not assuming as a default
browser)?

Thanks,
Janiv Ratson.
 
It would appear that the easiest way to do it is to just run (via
ShellExecute, CreateProcess or whatever function you choose) the following
commandline:
iexplore http://www.abc.com/def/

Internet Explorer (at least as it is installed in my windows XP SP2
machine) will take a URL as a parameter and when passed a URL with no other
parameters, it opens that URL in a window (in my case, a new IE window will
be opened but that might depend on settings somewhere)
 
Hi,

simplest way to open any url in default browser:

ShellExecute(NULL, _T("open"), url, NULL,NULL, showcmd);

if you want to open url with IE when IE isn't default browser you should
launch iexplore.exe from <Program Files>\Internet Explorer and pass url as a
parameter in ShellExecute.
 
Use ShellExecute. It will open the *default browser*, whatever that happens
to be(IE or firefox etc).
 
Hello and thanks,
On the contrary, I need to open IE specifically(even if firefox is the
default brpwser), because these are MCE html files.
Thanks,
Janiv Ratson.


Ajay Kalra said:
Use ShellExecute. It will open the *default browser*, whatever that
happens
to be(IE or firefox etc).

--
Ajay Kalra [MVP - VC++]
(e-mail address removed)


Janiv Ratson said:
Hello,

What is the best programmatic way to open a URL explicitly using IE
(assuming IE is installed on a machine, but not assuming as a default
browser)?

Thanks,
Janiv Ratson.
 
Janiv Ratson said:
Hello,

What is the best programmatic way to open a URL explicitly using IE
(assuming IE is installed on a machine, but not assuming as a default
browser)?

Launch "iexplore.exe" using ShellExecute and specify the url on the
command-line.

-- David
 
Back
Top