-
'default' exes
In a program I'm developing I want the help to be on the internet, so I've got this so far:
Code:
case ID_HELP_ONLINEHELP:
{
char PathtoNet[] = "C:\\Program Files\\Internet Explorer\\iexplore.exe www.newscientist.com";
WinExec(PathtoNet, SW_SHOWNORMAL);
}
break;
Obviously there are a couple of problems with this method. Firstly WinExec isn't unicode which is a problem. Secondly, I have to hard code the path of the browser, so if you're not using internet explorer and it's not stored in C:\Program Files\Internet Explorer you're out of luck.
This brings me, finally, to my question. Does windows maintain somewhere the path to the executable of the default browser for the system? If not how would I go about obtaining this.
btw newscientist is just my test website. :)
-
Code:
ShellExecute(NULL or hwnd, NULL, TEXT("http://www.newscientist.com"), NULL, NULL, SW_SHOWNORMAL)
-
Thanks mate, one more question, can I make it open a new window regardless?
If there is already an instance of the browser running it just opens it in that window.
-
This google search 'open web page in new window shellexecute' reveals this web page:
http://www.codeproject.com/internet/urlnewwindow.asp
-