StatusItem to foreground app
StatusItem to foreground app
- Subject: StatusItem to foreground app
- From: Steve Cronin <email@hidden>
- Date: Sun, 24 Aug 2008 16:02:08 -0500
Folks;
I'm building a tool that I want to allow the user switch 'modes'
either running as a menubar statusItem or as regular dock-based
application.
NOTE: The info.plist has LSUIElement=1.
If the user designates the application to run as regular dock-based
application then, early in startup, I do:
ProcessSerialNumber psn = { 0, kCurrentProcess };
OSStatus returnCode = TransformProcessType(&psn,
kProcessTransformToForegroundApplication);
if( returnCode == 0) {
...
I have this working fine under Leopard, however, the application's
deployment target is 10.4.
On the Tiger machines I'm getting a returnCode = -50.
GetMacOSStatusErrorString tells me that there is an error in the user
parameters.
I have examined the psn high = 0 and low = 2 which seems right to me...
The 10.4 application does NOT die; rather it continues to load and run
EXCEPT there is no menu bar, no dock icon, and it is not listed in
'Force Quit'. (The TransformProcessType has failed.)
Is the LSUIElement confusing 10.4?
Was this a known bug on 10.4 that was never fixed?
Was there a 10.4 workaround?
So here's my predicament:
I need the LSUIElement set to run as a statusItem (yes?)
LSUIElement cannot be changed by code (yes?)
If I have this set LSUIElement then I can ONLY run as a status item in
10.4.
If I do not set LSUIElement then I can NEVER run as a status item in
either Leopard or Tiger....
I really don't want to deploy separate binaries for obvious reasons.
Does anyone have any insight into what is going on here?
Thanks for any thoughts!
Steve
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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