Launching another process, and knowing when it's loaded?
Launching another process, and knowing when it's loaded?
- Subject: Launching another process, and knowing when it's loaded?
- From: "Theodore H. Smith" <email@hidden>
- Date: Tue, 13 Sep 2005 16:24:50 +0100
This is probably due to the inherant nature of the MacOS, but here goes:
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.
I'm using NSWorkspace's launchedApplications method, but the thing
is, I'm not sure if the app I'm launching will always be in the
process list immediately after launchApplication returns.
So, it's like this;
[ws launchApplication:kAppPath showIcon:NO autolaunch:NO];
// is the app open by the time my code gets here, or not?
bool b = CheckIfAppExists();
Can I assume that the app won't open and close by the time the
function has returned?
For example b could be false if the app has already opened and closed.
or b could be false if the app hasn't yet opened!
Assumptions are generally bad things, right? I wonder if I could make
this auxiliary app wait for the parent app to signal for it to quit?
That would make more sense, and remove an assumption.
I guess I just want to know the most graceful way of doing this. I'll
be able to do it reliably, but doing it the most simple graceful way
is a different matter :)
--
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