Help shelling out to another program and returning to original pro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello all,

Here is what I am trying to do:

1) I want to shell from my currently running .netcf app to another app
2) I want my current app to pause or stop running until the other app is done.

I am shelling from my current app to a camera application to take some
pictures. When the camera application is done I want to return to my
application and process the pictures that were taken.

I shell from my app to the camera app by doing the following:


OpenNETCF.Diagnostics.Process.Start("\windows\hpcamapp.exe", "")



That works great. But my app is still running and processing events in the
background while the camera application is running. I need my application to
halt until the camera application is exited.

Any help would be great and thanks in advance,
 
Do you have any source code or examples on this Chris?

--
------------------------------------------
Noble D. Bell
AgForest Partners, Inc.



The Process returned has a handle - you need to wait on it.

-Chris
 
The first thing to note is that you *don't* want your application to halt
while the other application is running! That will cause a major headache,
as you're turning off all of the UI if you do that and your users will hate
your guts for all eternity.

If there is some processing that you're doing in a thread and that thread is
what you want to stop until the other application returns, call
WaitForExit() on the Process instance returned by Start().

If you're starting the process from the UI thread, set a global variable
that indicates to whatever background code that does the processing to pause
that and have some thread, timer or whatever, call WaitForExit() and, when
it returns true (use a time-out and only wait for a short time, since you're
in the UI thread), clear that global variable so that processing continues.

Paul T.

Noble Bell said:
Do you have any source code or examples on this Chris?
 
Back
Top