Windows Phone 8 - Touch Screen Event Modeling

What would be the best approach to simulate a user using the touch screen of a Windows Phone 8 device?

One approach I could imagine was to use native code to call Win32 API functions that control mouse events. This suggests that touch-screen events more or less coincide with mouse events and that these API functions are available. Does anyone know if this is the case on WP8?

Another approach would be to have something like Android ADB for Windows Phone. On Android, you can use ADB to control the device from a PC, as well as simulate touch screen events (for example, through Monkeyrunner). I did not find any information if there is such a tool as ADB for Windows Phone 8.

The goal of finding a solution for this is to integrate Windows Phone 8 devices into the automatic testing process.

+8
windows-phone-8
source share
2 answers

I found out that there is a DLL file called InputInjection.dll in the System32 folder on Windows Phone 8 (at least in the image of the simulator that I mounted).

This library contains the following functions:

  • ApiInjectInitialize
  • ApiInjectTouchEvent
  • ApiInjectButtonEvent
  • ApiInjectEnableExclusive
  • ApiInjectUninitialize

InputInjection.dll in Dependency Walker

After doing some research, I found out that there are official ways to simulate touch input for developing Windows 8:

However, the functions used to develop Windows 8 are not available on Windows Phone 8. But the functions are called similarly to those that I found in InputInjection.dll:

  • InitializeTouchInjection is similar to ApiInjectInitialize
  • InjectTouchInput is similar to ApiInjectTouchEvent
  • (...)

I could not find documentation on InputInjection.dll and its functions. These features also do not appear in the SDK header files. Perhaps Microsoft uses these features for its own tests during the development of Windows Phone.

Question: is it possible to access this library and somehow call these functions? It will be similar to using "private APIs" on iOS, I think. I tried several ways to achieve this using the Windows Phone 8 application using native C ++ code, but I have not had any luck so far (the main reason is that the applications work in isolation on Windows Phone). Is there a way to get a binary launch on a Windows Phone (perhaps through a debug bridge or something else)?

+5
source share

You can access all of these APIs from the Win32 Service / Kernel Driver. Include the header file in the source code and the injection method library, it will work

0
source share

All Articles