سؤال

Is is it possible to, from a desktop program, start or stop an application or send commands to a cradled Windows Mobile device attached via a USB cradle to the PC?

Scenario: I would like to automate a process that involves closing a (poorly-designed0 application the handheld so that I can backup and remove some of its files which are locked while its running, change some things, and then start a different program on the handheld which automatically recreates some of the files.

Any thoughts on this would be appreciated. Thanks!

هل كانت مفيدة؟

المحلول

You can use RAPI to manipulate the connected device from a Windows desktop application. There is a managed C# wrapper available for managed development. You can use C API or a COM interface to program RAPI in the native world.

To start a program on the device using the C API, you would call CeCreateProcess. To kill a process from the desktop you have two options: 1) write a RAPI dll, or 2) write a simple mobile app that closes the process and call this program via CeCreateProcess. See this answer for more information.

نصائح أخرى

you can use the dll OpenNetCF.Desktop.Communication to perform this procedure, but I'm not sure that this library has the ability to close the application, take a look at the website: http://rapi.codeplex.com/

I checked quickly, and have not found a method to finalize the function, but the CreateProcess method has an output parameter ProcessInfo and this struct has a handle, you can verify that with this information you could terminate the application via CloseHandle.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top