Re: Find app by signature
Re: Find app by signature
- Subject: Re: Find app by signature
- From: Vince DeMarco <email@hidden>
- Date: Mon, 31 Mar 2003 14:50:14 -0800
On Monday, March 31, 2003, at 2:04 PM, Greg Robbins wrote:
At 4:25 PM -0500 3/31/03, Steve Roy wrote:
I'm looking at NSWorkspace hoping to find a method to locate an
application
given its 4-byte signature (creator code).
Use LSGetApplicationForInfo, from LaunchServices.h, to get the FSRef
for the application given its OSType signature:
const OSType kAnyFileType = kLSUnknownType;
const CFStringRef kAnyExtension = NULL;
CFURLRef* kDontWantURL = NULL;
FSRef appFSRef;
OSStatus err = LSGetApplicationForInfo(kAnyFileType, signature,
kAnyExtension, kLSRolesAll, &appFSRef, kDontWantURL);
You can use CFURLCreateFromFSRef to make an NSURL from the FSRef.
Or you can just get
OSStatus err = LSGetApplicationForInfo(kAnyFileType, signature,
kAnyExtension, kLSRolesAll, NULL, &urlToApp)
and urlToApp will be a url to the application you want.
vince
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.