Search code examples
windows-mobileactivesync

How start/stop applications on ActiveSync cradled device


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!


Solution

  • 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.