Hi. I would like to open the default internet browser from within my c++ program, and it should open directly with a specified URL. Does anyone have any idea how I can do it?
Hi. I would like to open the default internet browser from within my c++ program, and it should open directly with a specified URL. Does anyone have any idea how I can do it?
There are a few ways of doing it (A thread recently covered this and some of the methods included ATL and the like)....It can be tedios to find the default browser....where it is kept on disk....open it and get it to open a page............but the easiest way is to trust the shell to do the work for you.....
Look up ShellExecute() on MSDN......the file to open needs to be the full URL (ala..."http://www.cprogramming.com")
The shell will look at the use settings, see which browser is the default browser, open the app and open the webpage (basically the shell will do all the work for you.....and you dont need to lookup the user's preferences.....that's what the shell is there for I guess!)