• 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: Launching a GUI app from a daemon?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Launching a GUI app from a daemon?


  • Subject: Re: Launching a GUI app from a daemon?
  • From: "Mike T. Miller" <email@hidden>
  • Date: Mon, 24 Nov 2003 12:50:17 -0800

You can launch a GUI app by using fork/exec with the "open" command. That's the easy bit. Killing the app from the daemon is a bit trickier: the pid you have access to in your daemon is for the "open" process, not the app, and, alas, "open" returns without waiting for the app to die.

I think you will have to communicate with the shared workspace (returned from NSApplication) and find out the NSApplicationProcessIdentifier so that you can kill it. If there is an easier way to do this, I'd love to hear it.

-mike


On Nov 24, 2003, at 12:13 PM, Steve Herman wrote:

Can anyone offer any good advice or techniques for launching a GUI application from a daemon?

The daemon is currently a C program and is not linked with any of the Carbon/Cocoa frameworks. Are there Unix calls that would fit best for this situation, or should I look at making the daemon link with the Foundation framework and use NSTask... or link with Carbon and use LaunchServices?

The daemon will need to be able to kill the GUI app at certain times as well if that makes any difference.
--
+-------------------------------------------------------+
| Steve Herman |
| Macintosh Software Development and Support |
| Lockheed Martin Information Technology NASA-ODIN |
| 102 Research Blvd, Bldg 2 |
| Madison, AL 35758 (voice) 256 319-2869 |
| mailto:email@hidden (fax) 256 319-2984 |
+-------------------------------------------------------+
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

--
Mike T. Miller
Sr. Java Architect, NorCal Software Services
Sun Microsystems, Inc.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Launching a GUI app from a daemon?
      • From: Brian Christensen <email@hidden>
References: 
 >Launching a GUI app from a daemon? (From: Steve Herman <email@hidden>)

  • Prev by Date: Fwd: Database applications in OS X
  • Next by Date: Re: Database applications in OS X
  • Previous by thread: Launching a GUI app from a daemon?
  • Next by thread: Re: Launching a GUI app from a daemon?
  • Index(es):
    • Date
    • Thread