• 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: How to write a daemon/background app?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to write a daemon/background app?


  • Subject: Re: How to write a daemon/background app?
  • From: Stephane Sudre <email@hidden>
  • Date: Tue, 16 Dec 2003 13:37:45 +0100

On Tuesday, December 16, 2003, at 12:40 PM, James Chen wrote:

Thanks, Stephane
That resolves my problem.

In that case, you can write a Background Cocoa app which when it's launched for the first time (or when it's installed) decalres itself to be a Login Item (I think there's some code available somewhere explaining how to do this).
I have no clue to find such stuff.
Could you point me to the place you mentioned?

From the mailing list archive:

NSMutableArray* loginItems;

loginItems = (NSMutableArray*) CFPreferencesCopyValue((CFStringRef)
@"AutoLaunchedApplicationDictionary", (CFStringRef) @"loginwindow",
kCFPreferencesCurrentUser, kCFPreferencesAnyHost);

loginItems = [[loginItems autorelease] mutableCopy];

//Do you stuff on "loginItems" array here

CFPreferencesSetValue((CFStringRef)
@"AutoLaunchedApplicationDictionary", loginItems, (CFStringRef)
@"loginwindow", kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
CFPreferencesSynchronize((CFStringRef) @"loginwindow",
kCFPreferencesCurrentUser, kCFPreferencesAnyHost);

[loginItems release];
_______________________________________________
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.

References: 
 >Re: How to write a daemon/background app? (From: James Chen <email@hidden>)

  • Prev by Date: Re: How to write a daemon/background app?
  • Next by Date: Re: A little Advice about Recording informations in XML.
  • Previous by thread: Re: How to write a daemon/background app?
  • Next by thread: NSTableView + Scroll wheel problem on G5
  • Index(es):
    • Date
    • Thread