Barry said:
I have a console application which start a Windows Application, how will i
know when the Windows Application has finished processing (it basically
downloads some web info), i want to kill the Windows application when the
download completes.
I tried Proces.WaitForInputIdle() without any success.
You haven't offered enough specifics, not even what specifically about
WaitForInputIdle() didn't accomplish what you wanted (for example, did
it return immediately? did it never return?), to allow any accurate advice.
However, I will suggest that the best solution would be if you could get
the Windows application, via some command line switch or something for
example, to just exit on its own when it's done. Then you could use the
WaitForExit() method or the Exited event in the Process class to monitor
the application.
If the application doesn't offer that, and you really must shut it down
explicitly, then the exact means of doing so will depend a lot on the
application and how it manages the download.
All that said, you also aren't specific about what sort of "web info"
this application is downloading, but assuming it's actually talking to
an HTTP server as the phrase "web info" suggests, you may be better off
just implementing the download in your own application, using the
HttpWebRequest class for example.
Pete