Re: Replacing Info.plist programmatically
Re: Replacing Info.plist programmatically
- Subject: Re: Replacing Info.plist programmatically
- From: Claudio Procida <email@hidden>
- Date: Thu, 23 Nov 2006 01:28:55 +0100
That isn't your only concern. If the user isn't running as an admin,
it is likely that they won't be able to modify the app bundle's
contents at all :|
Also, in a multi-user environment, you may have two different users
and each one could have a different preference about whether it
should show in the dock or not.
definitely right.
Right. That will do it.
I learn that TransformProcessType will work only if the app is
LSBackgroundOnly (while I need LSUIElement, as I'd like to always show
the window).
Second, where do I have to put the call to TransformProcessType? In
applicationDidFinishLaunching: seems to be too late, as the Dock icon
won't show. I've put it into the app's delegate +initialize: method and
still I have these glitches
- the Dock Icon won't bounce, it just appears from nowhere already still.
- the menubar won't show!
the code I'm using now is the following:
if (![[defaults valueForKey:MBLHideDockIconKey] boolValue])
{
ProcessSerialNumber psn = { 0, kCurrentProcess };
OSStatus returnCode = TransformProcessType
<http://cocoadev.com/index.pl?TransformProcessType>(&psn,
kProcessTransformToForegroundApplication);
if (returnCode != 0)
{
NSLog <http://cocoadev.com/index.pl?NSLog>(@"Could not transform
to a foreground app. Error %d", returnCode);
}
OSErr errCode = SetFrontProcess(&psn);
if (errCode != 0)
{
NSLog <http://cocoadev.com/index.pl?NSLog>(@"Could not bring the
app to front. Error %d", errCode);
}
}
I guess I'm going slightly Off Topic here since this is Carbon stuff :/
--
Claudio Procida
Emeraldion Lodge
http://www.emeraldion.it
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins (at) lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden