如何在Windows资源管理器中模拟触摸指针 [英] How do I simulate touch pointer in windows explorer

查看:85
本文介绍了如何在Windows资源管理器中模拟触摸指针的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在桌面上拦截用户的触摸操作,并将他们的触摸手势模拟到屏幕上的另一个位置。目标窗口是Windows桌面或Windows资源管理器。



当前解决方案。

我使用RegisterPointerInputTarget API将所有用户触摸信息定向到我创建的窗口,以便我可以接收所有的触摸信息。

然后我使用InjectTouchInput API来创建预期位置的触摸信息。



问题:

当前的解决方案可以在IE和Chrome中运行,但在Windows资源管理器和Windows桌面上不起作用。

原因是Windows资源管理器或Windows桌面在调用InjectTouchInput之前没有收到消息WM_POINTERACTIVATE,因此Windows资源管理器或Windows桌面可以从我的InjectTouchInput接收触摸消息,但忽略这些触摸消息。



原因消息WM_POINTERACTIVATE非常重要,因为此消息可能将我的第一个触摸指针(InjectTouchInput)标记为主指针。没有主指针,Windows资源管理器或Windows桌面将忽略所有触摸消息。



我高度怀疑用户的原始触摸指针被视为主指针,以便我的模拟指针无法被标记为主指针并且WM_POINTERACTIVATE丢失。



问题:有没有办法让我们有机会标记我们的模拟指针作为主要指针。是否有一些API,可以从现有的触摸指针中删除主指针标志。或者有一些消息,我可以将我的触摸指针标记为主指针。

I am trying to intercept user's touch action on desktop, and simulate their touch gesture to another position on screen. The target window is windows desktop or windows explorer.

current solution.
I am using RegisterPointerInputTarget API to direct all user touch information to the window which I created so that I can receive all the touch information.
Then I am using InjectTouchInput API to create touch information to expected position.

Problem:
Current solution can work in IE and chrome but does not work in windows explorer and windows desktop.
The reason is windows explorer or windows desktop does not get a message "WM_POINTERACTIVATE" before I calling InjectTouchInput, so that windows explorer or windows desktop can receive the touch message from my InjectTouchInput, but these touch messages are ignored.

The reason message "WM_POINTERACTIVATE" is so important, because this message could mark my first touch pointer(InjectTouchInput) as primary pointer. Without primary pointer, windows explorer or windows desktop will ignore all touch message.

I highly suspect that the user's original touch pointer are considered as primary pointer, so that my simulated pointer cannot get the chance to be marked as primary pointer and "WM_POINTERACTIVATE" is lost.

Question: Is there some way we can get the chance to mark our simulated pointer as primary pointer. Is there some API, which can remove the primary pointer flag from existing touch pointer. Or there some message, which I can mark my touch pointer as primary pointer.

推荐答案

case WM_POINTERACTIVATE:

{

InjectTouchInput();

}
case WM_POINTERACTIVATE:
{
InjectTouchInput();
}


你找到了解决办法吗?分享我们会很棒。
did u find the solution?share us would be great.


这篇关于如何在Windows资源管理器中模拟触摸指针的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆