From: David Ching on
"Mao" <Mao(a)discussions.microsoft.com> wrote in message
news:01FE152A-A1DA-454F-BA73-CB4C41BC6F6F(a)microsoft.com...
> Thanks for your suggestion. But unfortunately, I take lParam as NULL, and
> pass to the event. It also can't be triggered. So the handle, lParam,
> plays
> an important role (For OS to judge whether a touch handle or not). I think
> that the handle is created and connected to the touch's hardware is also
> needed in the Win 7 touch's architecture, isn't it? So, a touch handle
> connect to a hardware can be simulated by an API?

I'm sorry but I don't know about the hardware requirements from WM_TOUCH and
WM_GESTURE. I do know about using PostMessage to simulate messages received
from the system and have never before encountered one that calling
PostMessage() did not actually generate a message because Windows was "smart
enough" to try to interpret the lParam and figure it was bogus.
Unfortunately, I don't have time to install the Win 7 SDK and try it myself.
Did you override CWnd::WindProc() as I suggested to see if you receive
WM_TOUCH there? That's about all I can suggest, sorry.

-- David


From: Mao on
Never mind!!!! I will keep on trying it. Thank you very much.
--

> I'm sorry but I don't know about the hardware requirements from WM_TOUCH and
> WM_GESTURE. I do know about using PostMessage to simulate messages received
> from the system and have never before encountered one that calling
> PostMessage() did not actually generate a message because Windows was "smart
> enough" to try to interpret the lParam and figure it was bogus.
> Unfortunately, I don't have time to install the Win 7 SDK and try it myself.
> Did you override CWnd::WindProc() as I suggested to see if you receive
> WM_TOUCH there? That's about all I can suggest, sorry.
>
> -- David
>
>
> .
>
From: David Ching on
"Mao" <Mao(a)discussions.microsoft.com> wrote in message
news:FC7B176C-3CE9-4301-8689-DA157990ACFE(a)microsoft.com...
> Never mind!!!! I will keep on trying it. Thank you very much.

I confirm your findings that posting WM_TOUCH (0x0240) to the same window
results in the message not being received when run on Windows 7. When
running the same app on Vista, the message is received. So Windows 7 is
preventing the message from being posted. Calling RegisterTouchWindow() has
no effect on this. Sorry I couldn't help more. The Touch API is still so
new there are few people who know short of Microsoft.

-- David


From: David Ching on
"David Ching" <dc(a)remove-this.dcsoft.com> wrote in message
news:#wDlARCiKHA.1648(a)TK2MSFTNGP05.phx.gbl...
> I confirm your findings that posting WM_TOUCH (0x0240) to the same window
> results in the message not being received when run on Windows 7. When
> running the same app on Vista, the message is received. So Windows 7 is
> preventing the message from being posted. Calling RegisterTouchWindow()
> has no effect on this. Sorry I couldn't help more. The Touch API is
> still so new there are few people who know short of Microsoft.
>

I've run your situation past a few C++ people at Microsoft. First responses
speculate ntuser is not forwarding the posted WM_TOUCH message due to
invalid parameters. It was news to me that ntuser validates message
parameters in PostMessage(), but there you go. Will let you know if
anything more definitive comes up.

Regardless, it was also pointed out that even if you successfully did post
WM_TOUCH, your app still would not be useful because you wouldn't know what
info to post (the lParam HTOUCHINFO) because you would need to match what
the hardware sends, and you don't know what the hardware sends because you
don't have any hardware. So this whole approach of posting WM_TOUCH will
probably not get very far.

Another approach is to call SendInput() to generate the WM_TOUCH messages,
but alas this API (or at least the doc of it) hasn't been updated to support
Touch parameters.

The easiest way is probably to go buy a Touch enabled Windows 7 PC, sorry.

-- David


From: David Ching on
"David Ching" <dc(a)remove-this.dcsoft.com> wrote in message
news:uLIIPoKiKHA.3964(a)TK2MSFTNGP06.phx.gbl...
> I've run your situation past a few C++ people at Microsoft.

Another Microsoft MVP, Raffaele Rialdi, suggests:
> I would suggest to use the MultiTouchVista from codeplex and nui group
> projects.
> I built my own multtouch device using that stuff:
> http://www.iamraf.net/Articles/SurfRaf-home-made-surface-for-Windows-7
>
> If you want to programmatically test an application simulating touch, you
> can use tuio protocol described here:
> http://nuigroup.com/
> it's a winsock based protocol used to give Win7 MulitouchVista driver the
> correct sequence of touches.
>

If this helps you, please let him know (it's his blog in the first link).

Thanks,
David