Re: Launching another process, and knowing when it's loaded?
Re: Launching another process, and knowing when it's loaded?
- Subject: Re: Launching another process, and knowing when it's loaded?
- From: "Theodore H. Smith" <email@hidden>
- Date: Tue, 13 Sep 2005 20:00:51 +0100
Thanks, I'll give
launchAppWithBundleIdentifier:options:additionalEventParamDescriptor:lau
nchIdentifier: a go!
On 13 Sep 2005, at 17:46, Finlay Dobbie wrote:
On 13/09/05, Theodore H. Smith <email@hidden> wrote:
Using NSWorkspace to launch an auxiliary process, I am finding it
hard to reliably tell when the process has actually opened, and then
tell when it's actually closed.
Are you not getting NSWorkspaceDidLaunchApplicationNotification and
NSWorkspaceDidTerminateApplicationNotification?
[ws launchApplication:kAppPath showIcon:NO autolaunch:NO];
// is the app open by the time my code gets here, or not?
bool b = CheckIfAppExists();
No, probably not. Apps are launched asynchronously by default. If you
don't want them to launch asynchronously, then you'll have to use the
launchAppWithBundleIdentifier:options:additionalEventParamDescriptor:l
aunchIdentifier:
method (which provides more fine-grained control) on 10.3+ (or call
LaunchServices directly if you need Jaguar compatibility).
Can I assume that the app won't open and close by the time the
function has returned?
The app probably won't have even finished launching by the time the
function has returned.
-- Finlay
--
http://elfdata.com/plugin/
What does our work achieve, if it's not making the world a happier
place?
http://www.whatnextjournal.co.uk/Pages/Next/Happiness.html
When's the last time you thought deeply about how to improve our lives?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden