In article
<1fec09ae-84d2-417f-ba3a-59eef7f87850@w7g2000hsa.googlegroups.com>,
> Hi
>
> How can i terminate application from other application ? not kill ?
If it's a normal, full-citizen Mac app, you send it a quit AppleEvent.
OSErr QuitApplicationByPSN(const ProcessSerialNumber* inPSN)
{
AppleEvent theQuitEvent = {typeNull, NULL};
AEBuildError theBuildError;
OSErr theError = AEBuildAppleEvent(kCoreEventClass,
kAEQuitApplication,
typeProcessSerialNumber, inPSN,
sizeof(ProcessSerialNumber),
kAutoGenerateReturnID,
kAnyTransactionID,
&theQuitEvent,
&theBuildError,"");
if(theError == noErr)
{
AppleEvent theReply = {};
theError = AESend(&theQuitEvent, &theReply, kAENoReply |
kAENeverInteract,
kAENormalPriority, kNoTimeOut, NULL, NULL);
(void)AEDisposeDesc(&theQuitEvent);
}
return theError;
}
How you get the ProcessSerialNumber to pass in depends on what you
already have.

Signature
"Harry?" Ron's voice was a mere whisper. "Do you smell something ... burning?"
- Harry Potter and the Odor of the Phoenix
p2 - 18 Jul 2008 13:10 GMT
> In article
> <1fec09ae-84d2-417f-ba3a-59eef7f87...@w7g2000hsa.googlegroups.com>,
[quoted text clipped - 35 lines]
> "Harry?" Ron's voice was a mere whisper. "Do you smell something ... burning?"
> - Harry Potter and the Odor of the Phoenix
thanks
p2