• 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
Non-deprecated way to determine Process Type (LSUIElement etc.) ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Non-deprecated way to determine Process Type (LSUIElement etc.) ?


  • Subject: Non-deprecated way to determine Process Type (LSUIElement etc.) ?
  • From: Jerry Krinock <email@hidden>
  • Date: Thu, 26 Nov 2015 21:58:42 -0800

Several years ago I succumbed to a few users who wanted the ability to switch my OS X apps between foreground (regular app) and background (LSUIElement) on the fly.  Switching has been possible in both directions since OS X 10.7, using TransformProcessType().  The user interface is, for example, a NSStatusItem (aka “menu extra”).

However, in 10.9, Apple deprecated all Process Manager API *except* TransformProcessType().  The deprecated ProcessInformationCopyDictionary(), in particular, was the only way to determine the *current* process type.  (The dictionary it returned could have keys LSUIElement or LSBackgroundOnly.)

Without this API, the only way I have to know the current type is to ask NSBundle if Info.plist has LSUIElement when the app launches, and keep track of when I change it.  It works, but, I think, not very robust.

Does anyone know of a non-deprecated way to determine process type?  I’ve reviewed NSRunningApplication pretty carefully but this capability appears to have not survived the “upgrade” from Process Manager :(

Jerry
_______________________________________________

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: Non-deprecated way to determine Process Type (LSUIElement etc.) ?
      • From: Ken Heglund <email@hidden>
  • Prev by Date: Re: xcodebuild and PMD
  • Next by Date: Re: Bunch of CoreData based NSDocument questions.
  • Previous by thread: Re: xcodebuild and PMD
  • Next by thread: Re: Non-deprecated way to determine Process Type (LSUIElement etc.) ?
  • Index(es):
    • Date
    • Thread