• 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
Re: how to check whether the application is running?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to check whether the application is running?


  • Subject: Re: how to check whether the application is running?
  • From: Ken Thomases <email@hidden>
  • Date: Mon, 13 Oct 2008 22:34:39 -0500

On Oct 13, 2008, at 9:45 PM, XiaoGang Li wrote:

I have a cmd-line application and also a GUI application, when
cmd-line app get specified information from low-level service, it will
launch the GUI app to tell user that something happens. but the low- level
service maybe send the specified info multiple times. so if the GUI app is
running, the cmd-line should not launch it again, I means there should not
have two same GUI app running in the front at the same time.
SO, my question is that what cmd-line should do? how to check this case?
can someone give me some point. I have no idea about this even no key words
to google it. thanks very much.

The command-line app should be using Launch Services (rather than NSTask or fork+exec) to launch the GUI app. By default, Launch Services won't launch two instances of the app, so you get the behavior you're looking for "for free".


Cheers,
Ken

_______________________________________________

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


References: 
 >how to check whether the application is running? (From: "XiaoGang Li" <email@hidden>)

  • Prev by Date: intercepting NSBrowser multiple selection extension with shift down/up arrow
  • Next by Date: Re: intercepting NSBrowser multiple selection extension with shift down/up arrow
  • Previous by thread: how to check whether the application is running?
  • Next by thread: intercepting NSBrowser multiple selection extension with shift down/up arrow
  • Index(es):
    • Date
    • Thread