How to launch web page with MacOS / Carbon

Started by
1 comment, last by PouncingPanda 18 years, 6 months ago
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!
Advertisement
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.
Jooleem. Get addicted.
It most certainly does help! Thanks a lot.

This topic is closed to new replies.

Advertisement