Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Force application to close on Windows CE using C++

Tags:

c++

windows-ce

How can I force an application, say myapp.exe, to close using C++ on Windows CE from a different application?

The scenario is that I have a previous installation of some software that does not behave properly when upgrading to a new version. I therefore need to kill a process (from the updater) before continuing the update.

like image 812
Chris Avatar asked Mar 10 '26 20:03

Chris


1 Answers

TerminateProcess? (MSDN)

BOOL TerminateProcess( HANDLE hProcess, 
                       DWORD uExitCode );

You will need the HANDLE to the process which you can easily obtain using the Toolhelp32 APIs. An eample of their use to enumerate all processes on the system can be found here.

like image 60
Konrad Avatar answered Mar 13 '26 08:03

Konrad