How do i open a web browser in c++

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?
not much help?
How much help do you want? The answer is right there in the first reply. Go use it.
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
Topic archived. No new replies allowed.