Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Launch Internet Browser



I am looking for a good way to launch an internet browser from a carbon
program. The user will click on a URL and the browser will launch and go to
that address. I found this snippet attached to the end of the email. It is
for OS 8 & 9. I need it to run on OS X. The compiler doesn't recognise the
function calls. The headers point to application services. Including
applications services directly does not work either. Does any have a good
way to accomplish this?

Thanks for the help,

Monty.

#include <Types.h>
#include <InternetConfig.h>
OSStatus LaunchURL(ConstStr255Param urlStr)
{
OSStatus err;
ICInstance inst;
long startSel;
long endSel;
err = ICStart(&inst, '????'); // Use your creator code if you
have one!
if (err == noErr) {
err = ICFindConfigFile(inst, 0, nil);
if (err == noErr) {
startSel = 0;
endSel = urlStr[0];
err = ICLaunchURL(inst, "\p", (char *) &urlStr[1],
urlStr[0], &startSel, &endSel);
}
(void) ICStop(inst);
}
return (err);
}
_______________________________________________
carbon-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/carbon-development
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.