Mailing Lists: Apple Mailing Lists

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

Re: Launch Internet Browser



On 11/27/03 7:20 PM, Monty didst favor us with:

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

I don't know why it wouldn't. They're all in InternetConfig.h.

The headers point to application services. Including
> applications services directly does not work either.

This still works for me in Mac OS X, except I don't use the
ICFindConfigFile() call. That part's not applicable anymore.

Larry

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

References: 
 >Launch Internet Browser (From: "Monty" <email@hidden>)



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.