• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Who's launching me?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Who's launching me?


  • Subject: Re: Who's launching me?
  • From: John Stiles <email@hidden>
  • Date: Sun, 12 Feb 2006 21:31:17 -0800

Paul J. Lucas wrote:
On Sun, 12 Feb 2006, John C. Randolph wrote:

On Feb 12, 2006, at 2:09 PM, Paul J. Lucas wrote:

Is there any way for an application to know what other
application launched it?
Check the UNIX manual pages for getpid() and getppid().

In thinking about this more, that's insufficient. I really want to know which process called me telling me to open a document.

In the case of iPhoto launching my application as an external
editor, what if my application is already running? I need to
know that iPhoto is the one requesting me to open a document.
It sounds like your original question needed to be more specific. Information such as this is conveyed via AppleEvents. The Cocoa framework simplifies most of the mechanics to handle the 99% case, but in doing so you lose some of the information available to you (like "what app asked me to do this?"). If you deal in raw AppleEvents, the information is all there, however.

Unfortunately I don't have a lot more specific advice for you, since I haven't yet had to use AppleEvent code in any of my Cocoa apps. :|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
References: 
 >Who's launching me? (From: "Paul J. Lucas" <email@hidden>)
 >Re: Who's launching me? (From: "John C. Randolph" <email@hidden>)
 >Re: Who's launching me? (From: "Paul J. Lucas" <email@hidden>)

  • Prev by Date: image in a button problem
  • Next by Date: Re: Who's launching me?
  • Previous by thread: Re: Who's launching me?
  • Next by thread: Re: Who's launching me?
  • Index(es):
    • Date
    • Thread