在C#创建的PostMessage的()一WM_TOUCH消息/ .NET消息、PostMessage、WM_TOUCH、NET

由网友(野外鞭尸)分享简介:(有关背景信息,请参阅Composing对于SendMessage函数(),Kinect的为多点触摸设备一个WM_TOUCH消息,询问基本相同的问题,因为我的,但其接受的答案实际上并没有回答这个问题。棘手位不填写 TOUCHINPUT 结构,但做一个有效的触摸输入句柄。)(For background, see Co...

(有关背景信息,请参阅Composing对于SendMessage函数(),Kinect的为多点触摸设备一个WM_TOUCH消息,询问基本相同的问题,因为我的,但其接受的答案实际上并没有回答这个问题。棘手位不填写 TOUCHINPUT 结构,但做一个有效的触摸输入句柄。)

(For background, see Composing a WM_TOUCH message for SendMessage(), Kinect as a multi-touch device which asks basically the same question as mine but whose accepted answer doesn't actually answer the question. The tricky bit isn't filling in TOUCHINPUT structures but making a valid touch input handle.)

我想模拟多点触摸输入设备的presence在一个讨厌的hackish的方式,这在大纲是这样的:

I would like to simulate the presence of a multi-touch input device in a nasty hackish way, which in outline goes like this:

while (true) {
  choose locations etc. for simulated touches;
  PostMessage(GetForegroundWindow(), WM_TOUCH, nTouches, ...);
}

棘手位是善有善报在标有空间......。 MSDN文档,这是勿庸置疑从一个的消费者的角度编写的的 WM_TOUCH 的消息说,在的lParam WM_TOUCH 消息

The tricky bit is what goes in that space labelled "...". The MSDN documentation, which is unsurprisingly written from the point of view of a consumer of WM_TOUCH messages, says that the lParam for the WM_TOUCH message is

的触摸输入手柄,可用于在调用 GetTouchInputInfo 来检索有关与该消息相关联的触摸点的详细信息。

a touch input handle that can be used in a call to GetTouchInputInfo to retrieve detailed information about the touch points associated with this message.

我可以很轻松地做,比如,对 TOUCHINPUT 结构数组,这就是 GetTouchInputInfo 给你。但是,这似乎是从一个触摸输入句柄是完全不同的事情。 (例如,触摸输入句柄必须是正确的事情传递给 CloseTouchInputHandle ,据称 PostMessage的 SendMessage函数就可以了。)

I can easily enough make, e.g., an array of TOUCHINPUT structures, which is what GetTouchInputInfo gives you. But that seems to be an entirely different thing from a "touch input handle". (E.g., a touch input handle needs to be the right sort of thing to pass to CloseTouchInputHandle, which allegedly PostMessage or SendMessage will do.)

是否有可能(正式或非正式的!)用户code,以产生一个有效的触摸输入处理,它可以传递给 PostMessage的?如果是这样,如何​​?

Is it possible (officially or unofficially!) for user code to generate a valid touch input handle that it can pass to PostMessage? If so, how?

推荐答案

Windows 8的具有在桌面环境伪造倒是一个TouchInjection API。

Windows 8 has a TouchInjection API for faking touches in the Desktop Environment.

http://social.technet.microsoft.com/wiki/contents/articles/6460.simulating-touch-input-in-windows-8-using-touch-injection-api.aspx

阅读全文

相关推荐

最新文章