Sign in to follow this  
PouncingPanda

How to launch web page with MacOS / Carbon

Recommended Posts

PouncingPanda    122
Hello all, Does anybody know how to programatically launch a web browser under MacOS X? I have a game which launches a website "help/register", and on Windows all I had to do was execute
ShellExecute(hWnd, "open", "http://www.google.com", "", "", SW_SHOW | SW_MAXIMIZE);
On MacOS X, I'm using Carbon (I target MacOS X 10.2 and up). Does anybody know how to do this? I'm several days into google and Apple developer website searching, and I've found nothing. Thanks I lot in advance!

Share this post


Link to post
Share on other sites
Peregrin    496
This is how I launch a broswer on OS X in Jooleem:

CFURLRef url = NULL;

// Create a string ref of the URL:
CFStringRef urlStr = CFStringCreateWithCString( NULL, "http://address.goes.here", kCFStringEncodingASCII);

// Create a URL object:
url = CFURLCreateWithString (NULL, urlStr, NULL);

// Open the URL:
LSOpenCFURLRef(url, NULL);

// Release the created resources:
CFRelease(url);
CFRelease(urlStr);




Hope this helps.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this