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: launching gif in default browser...?



You can get the default browser with Launch Services (I did not compile
the following code, and Mail is a lousy code editor :-)...

{
// Get the FSRef of the browser (the http handler):
FSRef app;
CFURLRef url;
OSStatus status;

url = CFURLCreateWithString( NULL, CFSTR("http://www.apple.com";), NULL
);
status = LSGetApplicationForURL( url, kLSRolesAll, &app, NULL );
CFRelease( url );

// Then you can use LSOpenFromRefSpec to open your GIF in the found
application.
}

-Chris

On Jul 25, 2004, at 4:05 PM, Ando Sonenblick wrote:

> Gang,
>
> My app outputs GIFs, which I want to auto launch into the default
> browser when created.
>
> If I create a url to the outputted GIF file and ask IC to launch it,
> it opens in Preview, which isn't very conducive to actually seeing the
> resulting file animate as it just show individual frames.
>
> I'm wondering what is the best/easiest way to force it to launch into
> the default browser. The only way I see to do it is this:
>
> Get the creator code of the default web broswer with code like:
>
> err = ICGetPref(icInstance, kICHelperHTTP, &icAttr, (Ptr)
> &targetSpec, &dataSize);
> if (err == noErr)
> signature = targetSpec.fCreator;
>
> Then use the creator and apple events to find if running, or launch if
> not, the app with the creator code, then ae the file over to it.
>
> But this seems like a lot of work (and do I really want to be working
> with creator codes these days?!?!)
>
> Anyone have any better solutions?
>
> thx,
> ando
>
> -----------------------
> Ando Sonenblick
> SpriTec Software
> www.spritec.com
> _______________________________________________
> 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.
_______________________________________________
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: 
 >launching gif in default browser...? (From: Ando Sonenblick <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.