开发者

Killing a WinCE device process from a desktop app

开发者 https://www.devze.com 2023-01-09 22:11 出处:网络
I\'m copying files from the desktop to a WinCE device (via the RAPI API), and if the main WinCE program is running, I need to kill it, update and restart it again.

I'm copying files from the desktop to a WinCE device (via the RAPI API), and if the main WinCE program is running, I need to kill it, update and restart it again.

So far, I manage to copy the files and start the main program with no problem, but I cannot found a 开发者_如何学运维way to terminate a process via RAPI (there is a CeCreateProcess function but no CeTerminateProcess or similar)

Currently i'm spawning RapiProc.exe -k \MyDir\MyProcess.exe and it works, but I cannot find the way to do it via RAPI

Any ideas?

TIA


RAPI doesn't provide a direct way to kill a process. You must create a custom RAPI DLL that provides that capability. As a good starting point, this blog article shows how to retrieve the device ID via a custom RAPI dll. Just modify it to broadcast a WM_CLOSE and then a TerminateProcess if that fails.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号