Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Starting as Startup Item?



At 18:15 +0000 04.12.2004, Finlay Dobbie wrote:
On Sat, 4 Dec 2004 09:28:23 +0100, M. Uli Kusterer
<email@hidden> wrote:
 At 10:20 Uhr +0200 04.12.2004, Mihkel Tammepuuu wrote:
 >How can an application determine if it was launched as a Startup
 >Item on logging in to Mac OS or a usual way like (double)clicking
 >it's icon?

   IIRC you get some additional parameters to your main() function when
 you're launched from Finder.

I don't think that this is documented behaviour, and anyway I think that this happens regardless of who launches your application (as long as it was done via Launch Services).


Looking at main() arguments don't help much, I always get 2 arguments, the first is of course the app executable path and the second is a rather obscure string beginning with minus sign like -psn_0_1441793 or -psn_0_1966081.
You can see these arguments if you issue ps -axl command and make the Terminal wide enough. Also looking at ppid DOES NOT help, parent process is
/System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreGraphics.framework/Resources/WindowServer either way.


//
Mihkel




_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >Re: Starting as Startup Item? (From: Finlay Dobbie <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.