Re: How to write a daemon/background app?
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.