Re: Get parent process (Carbon question)
Re: Get parent process (Carbon question)
- Subject: Re: Get parent process (Carbon question)
- From: Douglas Davidson <email@hidden>
- Date: Fri, 6 Sep 2002 15:09:53 -0700
On Friday, September 6, 2002, at 02:16 PM, Renaud Boisjoly wrote:
Well, I've mastered getppid() and now know all about using unix
functions in Cocoa... but the problem persists.
What I'm trying to do is figure out if my app was launched from the
Finder or from my System Preference Pane...
When an application is launched normally, i.e. using Launch Services or
NSWorkspace, it is not invoked directly by the process requesting the
launch. Instead, Launch Services communicates with a server process
that actually performs the fork/exec to invoke the application to be
launched. Thus getppid() is not likely to help here, unless your
preference pane is invoking the application directly with something
like NSTask. And in that case your preference pane could simply pass a
command-line argument to tell the app that it is launching it.
Otherwise, you may wish to have your preference pane provide some
notification when it is the one launching the application. There are
many ways you might do this--via a distributed notification, via
distributed objects, via an AppleEvent passed to the application either
on launch or subsequently, to name just a few.
Douglas Davidson
_______________________________________________
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.