how do i open an IE link from c++

Started by
5 comments, last by v0dKA 19 years, 7 months ago
I need to oppen an Internet Explorer link from my c++ windows console application. I used to do it under TC using exec() or execl() func. What is the function and how should i use it to open an IE link ? Thanks.
;)
Advertisement
EDIT: if you saw my other post ignore it, this code will work ...
system ("c:\\progra~1\\intern~1\\iexplore \"www.google.ca\"");
just goes to google for example.

[Edited by - ekrax on September 18, 2004 3:12:25 PM]
Use ShellExecute.

ShellExecute(NULL, "open", "address_or_file_to_display", NULL, NULL, 0);


Alan
"There will come a time when you believe everything is finished. That will be the beginning." -Louis L'Amour
Is there a way to do this in firefox?
______________________________________________________________________________________With the flesh of a cow.
Quote:Original post by Ainokea
Is there a way to do this in firefox?


yes, try the same code but with the path to the firefox executable. there should be another way in which to do this as well that makes use of whatever browser the user has set as default.

-me
Quote:Original post by Palidine
there should be another way in which to do this as well that makes use of whatever browser the user has set as default.
ShellExecute(NULL, "open", "http://www.gamedev.net", NULL, NULL, SW_SHOWNORMAL);
That will open the page in the default browser. No need to use any browser paths.

224816 - INFO: Use ShellExecute to Launch the Default Web Browser
Ra
This is insanely cool! How do you make it so it opens in a new window (and not steal my old one)?
.:<<-v0d[KA]->>:.

This topic is closed to new replies.

Advertisement