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: Finlay Dobbie <email@hidden>
- Date: Tue, 13 Sep 2005 17:46:04 +0100
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:launchIdentifier:
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
_______________________________________________
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