Jump to content
  • Advertisement
Sign in to follow this  
PouncingPanda

How to launch web page with MacOS / Carbon

This topic is 4626 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!