• 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
Switching app type from background only to full UI, and back?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Switching app type from background only to full UI, and back?


  • Subject: Switching app type from background only to full UI, and back?
  • From: Jim Wintermyre <email@hidden>
  • Date: Thu, 4 Nov 2010 17:46:27 -0700

I have an app that needs to always be running in the background. Most of the time it is just a faceless daemon, but for some complicated reasons, sometimes it needs to display various windows, and I can't easily factor out these UI elements so that the UI part is handled by a regular app (and IPC with the background server is used).

When there are no windows being displayed, I want the app to be like a normal background-only process; i.e. no icon in the dock or app switcher, so that a) the user can't easily quit this process (it needs to always be around for detecting when our hardware is present, and as a server for communicating with the hardware, that our various other client apps use to talk to the device), and b) the user doesn't get confused about why this apparently "empty" app is in the dock/app switcher.

But when there are windows being displayed, I want the app to behave like a full-fledged "normal" application, with its own menu bar, and which shows up in the dock and application switcher. When the user closes all the windows, I want it to go back to behaving like a background-only app as described above.

So I'm looking for a way to programmatically switch the "app type" on the fly.

I did some searching on the net and found some useful info, but nothing that quite fits what I need. I know about LSUIElement, but that can't be switched on the fly. I thought about just setting LSUIElement to 1, and I could handle not having a menu bar, but then there are focus issues with any windows since they aren't really associated with any process. If my app has windows open, I'd like to be able to Cmd-tab to something that looks like my app, and have all my windows come to the foreground. TransformProcessType() looked promising, but it only goes in one direction.

Anyone been able to do anything like this? I'm all ears. I have a few ideas, but I was really hoping maybe there was just some Apple-approved way to do this that I haven't heard about... before I start going down the weird hack road.

Thanks,
Jim
_______________________________________________

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


  • Follow-Ups:
    • Re: Switching app type from background only to full UI, and back?
      • From: vincent habchi <email@hidden>
    • Re: Switching app type from background only to full UI, and back?
      • From: Ken Thomases <email@hidden>
  • Prev by Date: Re: Subject: Re: iPad frame-by-frame animation
  • Next by Date: Re: iPad frame-by-frame animation
  • Previous by thread: Re: Subject: Re: iPad frame-by-frame animation
  • Next by thread: Re: Switching app type from background only to full UI, and back?
  • Index(es):
    • Date
    • Thread