2010-07-10 5 views

Répondre

10

Pour OSX> = 10,6 NSWorkSpace utilisation:

Pour une solution à base de CFPreferences voir par exemple le topdraw sources:

CFStringRef appID = CFSTR("com.apple.desktop"); 
CFStringRef bkg = CFSTR("Background"); 

// get: 
NSDictionary *origBackgroundDict = (NSDictionary)CFPreferencesCopyAppValue(bkg, appID); 

// ... 

// set and notify dock: 
CFPreferencesSetAppValue(bkg, (CFPropertyListRef)backgroundDict, appID); 
CFPreferencesAppSynchronize(appID); 
[[NSDistributedNotificationCenter defaultCenter] 
    postNotificationName:@"com.apple.desktop" object:@"BackgroundChanged"]; 
+1

comment créer live wallpaper –

Questions connexes