从桌面应用程序杀死 WinCE 设备进程 [英] Killing a WinCE device process from a desktop app
问题描述
我正在将文件从桌面复制到 WinCE 设备(通过 RAPI API),如果主 WinCE 程序正在运行,我需要杀死它,更新并重新启动它.
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.
到目前为止,我设法复制文件并顺利启动主程序,但我找不到通过 RAPI 终止进程的方法(有 CeCreateProcess 函数,但没有 CeTerminateProcess 或类似函数)
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)
目前我正在生成 RapiProc.exe -k \MyDir\MyProcess.exe 并且它可以工作,但我找不到通过 RAPI 执行此操作的方法
Currently i'm spawning RapiProc.exe -k \MyDir\MyProcess.exe and it works, but I cannot find the way to do it via RAPI
有什么想法吗?
TIA
推荐答案
RAPI 不提供终止进程的直接方法.您必须创建一个提供该功能的自定义 RAPI DLL.作为一个好的起点,这篇博客文章 展示了如何通过自定义 RAPI dll 检索设备 ID.只需修改它以广播 WM_CLOSE,如果失败则广播 TerminateProcess.
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.
这篇关于从桌面应用程序杀死 WinCE 设备进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!