From: Dipesh_Sharma on
Hi All,
How can i stop a running exe in WM5.0? I haven't started that exe, so i dont
have any handle for that. I want to replace that exe with a newer version
when its running, for that i am using "DeleteFile" function, but since the
exe is running so its not able to delete it. How can i stop it so that
DeleteFile function deletes it.

With Regards,
Dipesh
From: r_z_aret on
On Fri, 21 May 2010 02:14:01 -0700, Dipesh_Sharma
<DipeshSharma(a)discussions.microsoft.com> wrote:

>Hi All,
>How can i stop a running exe in WM5.0? I haven't started that exe, so i dont
>have any handle for that. I want to replace that exe with a newer version
>when its running, for that i am using "DeleteFile" function, but since the
>exe is running so its not able to delete it. How can i stop it so that
>DeleteFile function deletes it.

I'm going to be somewhat terse here because I don't have enough info
to know just which method might work for you. I will definitely
provide longer explanations if you want/need them.

Start -> Settings -> System -> Memory -> Running Programs
provides a way to stop programs on most WM 5 Pocket PCs, and maybe
some WM 5 Smartphones. Definitely not on the WM 5 Smartphone I tried.

If you've installed a task manager, that should let you stop the
program.

A warm boot should stop any running programs. But some programs will
restart. You can prevent restart by renaming the executable file and
then doing a warm boot.


>
>With Regards,
>Dipesh

-----------------------------------------
To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).

Robert E. Zaret, MVP
PenFact, Inc.
20 Park Plaza, Suite 400
Boston, MA 02116
www.penfact.com
From: Dipesh_Sharma on
Hi Robert,
Thanks for the reply, but may be i have not elaborated my requirement. I
want to stop a running executable through coding in c/ C++ only thats why i
mentioned "DeleteFile" function which is used to simply delete the file, but
since exe is running and using memory its not possible to delete it.

With Regards,
Dipesh

"r_z_aret(a)pen_fact.com" wrote:

> On Fri, 21 May 2010 02:14:01 -0700, Dipesh_Sharma
> <DipeshSharma(a)discussions.microsoft.com> wrote:
>
> >Hi All,
> >How can i stop a running exe in WM5.0? I haven't started that exe, so i dont
> >have any handle for that. I want to replace that exe with a newer version
> >when its running, for that i am using "DeleteFile" function, but since the
> >exe is running so its not able to delete it. How can i stop it so that
> >DeleteFile function deletes it.
>
> I'm going to be somewhat terse here because I don't have enough info
> to know just which method might work for you. I will definitely
> provide longer explanations if you want/need them.
>
> Start -> Settings -> System -> Memory -> Running Programs
> provides a way to stop programs on most WM 5 Pocket PCs, and maybe
> some WM 5 Smartphones. Definitely not on the WM 5 Smartphone I tried.
>
> If you've installed a task manager, that should let you stop the
> program.
>
> A warm boot should stop any running programs. But some programs will
> restart. You can prevent restart by renaming the executable file and
> then doing a warm boot.
>
>
> >
> >With Regards,
> >Dipesh
>
> -----------------------------------------
> To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).
>
> Robert E. Zaret, MVP
> PenFact, Inc.
> 20 Park Plaza, Suite 400
> Boston, MA 02116
> www.penfact.com
> .
>
From: r_z_aret on
On Thu, 27 May 2010 14:13:10 -0700, Dipesh_Sharma
<DipeshSharma(a)discussions.microsoft.com> wrote:

>Hi Robert,
>Thanks for the reply, but may be i have not elaborated my requirement. I
>want to stop a running executable through coding in c/ C++ only thats why i
>mentioned "DeleteFile" function which is used to simply delete the file, but
>since exe is running and using memory its not possible to delete it.

If the app is reasonably well behaved, it should respond to a WM_QUIT
message. If that doesn't work, you can try WM_DESTROY. To send either,
you will need an HWND for the main window of the app. If the app's
main window has a unique window class name, you can use it in the
second argument of FindWindows. If the caption on its main window is
unique and constant, you can use it in the first argument of
FindWindow, but the call to FindWindow can hang if the app doesn't
respond. If neither of those works, you can use EnumWindows.


>
>With Regards,
>Dipesh
>
>"r_z_aret(a)pen_fact.com" wrote:
>
>> On Fri, 21 May 2010 02:14:01 -0700, Dipesh_Sharma
>> <DipeshSharma(a)discussions.microsoft.com> wrote:
>>
>> >Hi All,
>> >How can i stop a running exe in WM5.0? I haven't started that exe, so i dont
>> >have any handle for that. I want to replace that exe with a newer version
>> >when its running, for that i am using "DeleteFile" function, but since the
>> >exe is running so its not able to delete it. How can i stop it so that
>> >DeleteFile function deletes it.
>>
>> I'm going to be somewhat terse here because I don't have enough info
>> to know just which method might work for you. I will definitely
>> provide longer explanations if you want/need them.
>>
>> Start -> Settings -> System -> Memory -> Running Programs
>> provides a way to stop programs on most WM 5 Pocket PCs, and maybe
>> some WM 5 Smartphones. Definitely not on the WM 5 Smartphone I tried.
>>
>> If you've installed a task manager, that should let you stop the
>> program.
>>
>> A warm boot should stop any running programs. But some programs will
>> restart. You can prevent restart by renaming the executable file and
>> then doing a warm boot.
>>
>>
>> >
>> >With Regards,
>> >Dipesh
>>
>> -----------------------------------------
>> To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).
>>
>> Robert E. Zaret, MVP
>> PenFact, Inc.
>> 20 Park Plaza, Suite 400
>> Boston, MA 02116
>> www.penfact.com
>> .
>>

-----------------------------------------
To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).

Robert E. Zaret, MVP
PenFact, Inc.
20 Park Plaza, Suite 400
Boston, MA 02116
www.penfact.com