How do i open a web browser in c++

Sep 25, 2011 at 11:39pm
im working on a program were it opens a certain web browser by the path like if a person enter the number 1 it will open c/programfiles/mozzila/firefox some thing like that but how do i do it i try ed system() but it doesn't work? any idea?
Sep 26, 2011 at 12:55am
Sep 26, 2011 at 1:24am
not much help?
Sep 26, 2011 at 2:04am
How much help do you want? The answer is right there in the first reply. Go use it.
Sep 26, 2011 at 2:16am
The answer is in the first reply, but I'll just write it here too.

This will open the URL in the default web browser.

1
2
3
4
void OpenWebsite (char * cpURL)
{
      ShellExecute (NULL, "open", cpURL, NULL, NULL, SW_SHOWNORMAL);
}


Or:

#define OpenWebsite(a) ShellExecute(NULL,"open",a,NULL,NULL,SW_SHOWNORMAL);

Both of those should work.
Last edited on Sep 26, 2011 at 2:17am
Topic archived. No new replies allowed.