I am writiing an application in c# targeting window mobile 5.0. The project
consists of one application(lets call it main) which needs to start another
application. I do this using process class. this part works fine. Now when my
other application starts, i need to hide it. i do that using this.hide(). Now
I need to kill this applicatiion from my main application. which I am unable
to do. process.kill, process.close, process.closemainwindowhandle all fail.
Even the findwindow and destroywindow doesnt work, since findwindow cannot
find window handle since its hidden. Same is the case for SendMessage using
WM_CLOSE. How can I kill my application from my main application? Please
suggest.

Re: Unable to kill a process by jp2code

jp2code
Wed May 09 10:06:21 CDT 2007

In C++, whenever you create another form, there is the option to store the
HANDLE to that new form. Then, whenever you want to destroy the form, you
use the HANDLE.

Is that available in C Sharp?

"Pulkit" asks:
>I am writiing an application in c# targeting window mobile 5.0. The project
> consists of one application(lets call it main) which needs to start
> another
> application. I do this using process class. this part works fine. Now when
> my
> other application starts, i need to hide it. i do that using this.hide().
> Now
> I need to kill this applicatiion from my main application. which I am
> unable
> to do. process.kill, process.close, process.closemainwindowhandle all
> fail.
> Even the findwindow and destroywindow doesnt work, since findwindow cannot
> find window handle since its hidden. Same is the case for SendMessage
> using
> WM_CLOSE. How can I kill my application from my main application? Please
> suggest.