Re: Launch Services question
Re: Launch Services question
- Subject: Re: Launch Services question
- From: Stéphane Sudre <email@hidden>
- Date: Thu, 1 Aug 2002 11:54:17 +0200
On Wednesday, July 31, 2002, at 08:18 PM, Marco Piovanelli wrote:
What is the Launch Services way to fire up an application
so that the very first Apple event it receives is a custom
event of my choice instead of the usual aevt/oapp, aevt/odoc
or aevt/pdoc events?
LSOpenFromRefSpec looks promising, but I don't see a
way to specify my own event.
If there's no way to do this with a single call
(like I could using LaunchApplication in the olden
days), I'd like at least a way to stop Launch
Services from sending the aevt/oapp event (or any
event for that matter), so I can just use AESend later.
I was sent this piece of code a while ago:
void LaunchApplicationWithParameter(DescType inDescType,char *
inBuffer,long inSize,CFURLRef inURLRef)
{
LSLaunchURLSpec tLaunchSpec;
OSStatus status;
AEDesc recordDesc;
AEInitializeDesc(&recordDesc);
status = AECreateDesc(inDescType, inBuffer, inSize, &recordDesc);
if (status == noErr)
{
tLaunchSpec.appURL= inURLRef;
tLaunchSpec.itemURLs=NULL;
tLaunchSpec.passThruParams=&recordDesc;
tLaunchSpec.launchFlags=kLSLaunchDontAddToRecents |
kLSLaunchAsync | kLSLaunchNoParams | kLSLaunchNewInstance;
tLaunchSpec.asyncRefCon=NULL;
status=LSOpenFromURLSpec(&tLaunchSpec,NULL);
// Release Memory
CFRelease(tURLRef);
}
else
{
}
AEDisposeDesc(&recordDesc);
}
_______________________________________________
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.