Re: Terminate Application

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Paul G. Tobey [eMVP] (ptobey)
Date: 09/28/04


Date: Tue, 28 Sep 2004 08:24:22 -0700

If TerminateProcess doesn't affect it, you're not passing the right
parameters...

You should come up with a scheme to notify the application to exit, not just
close. You might do this by creating a new message with
RegisterWindowMessage() and passing that when you want the application to
exit and handling it by actually exiting the application when it is
received. Or, you could use CreateEvent() and in the target application,
exit when the event is set, etc., etc.

Paul T.

"Marc Ambrosius" <marc.ambrosius@nurfuerspam.de> wrote in message
news:%23h7apiTpEHA.1960@TK2MSFTNGP10.phx.gbl...
> Hi,
>
> how can I terminate an (.NET CF) application from another one? My
> application runs and I send a WM_CLOSE via PostMessage. It disappears from
> screen but remains in memory. Afterwards I try to check if it still runs
> by calling FindWindow. But this function never returns. Calling
> TerminateProcess doesn't affect my application. Using Windows CE Remote
> Process Viewer terminating succeeds. Is there any way to do the same thing
> (without changing the application)?
>
> Thanks in advance
>
> Marc
>



Relevant Pages

  • Re: What is Proces.WaitCode = 255 ?
    ... Except that the exit code is a DWORD, ... The exit value specified in the ExitProcess or TerminateProcess ... The return value from the main or WinMain function of the process. ... The exception value for an unhandled exception that caused the process ...
    (microsoft.public.dotnet.framework)
  • Re: How to kill an application from code Compact Framework
    ... applications, write something for notification that will allow this to be ... done cleanly, rather than with TerminateProcess, which is a bad idea. ... event that an application can set to cause you to exit. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Close application
    ... >I also used the terminateprocess way but all of this won't close it. ... writeln('Trying to terminate process ',IntToHex(ID,8),' ...'); ... Bart Broersma ...
    (alt.comp.lang.borland-delphi)
  • Re: stopping a process
    ... Look up TerminateProcess in the Win32 Programmer's Reference Help File ... causes a process to exit, but DLLs attached to the process are not ...
    (microsoft.public.vb.winapi)
  • Re: Killing process
    ... I think I need something besides TerminateProcess(). ... possible to terminate a process by just passing a string value to the ... Prev by Date: ...
    (comp.lang.python)