From: Mao on
Dear all:
I'm a junior engineer in SW. And now, i try to develop a software to
simulate a touch screen's operation without any touch hardware. In win 7,
these two message, wm_touch and wm_gesture, can't be triggled directly by
SendMessage and PostMessage. So In win7's touch architecture, these messages
can only be triggled by a touch hardware? Or It can be triggled by other win
api and other ways, like driver, to make it true?


--
....
From: David Ching on
"Mao" <Mao(a)discussions.microsoft.com> wrote in message
news:7D1BF478-8950-4723-BE3A-4344F7A793C1(a)microsoft.com...
> Dear all:
> I'm a junior engineer in SW. And now, i try to develop a software to
> simulate a touch screen's operation without any touch hardware. In win 7,
> these two message, wm_touch and wm_gesture, can't be triggled directly by
> SendMessage and PostMessage. So In win7's touch architecture, these
> messages
> can only be triggled by a touch hardware? Or It can be triggled by other
> win
> api and other ways, like driver, to make it true?
>

Why do you say they can't be triggered with PostMessage()? Make sure the
app that is posting has the same privilege as the one handling WM_TOUCH (or
run the poster app As Administrator to be sure).

-- David

From: Joseph M. Newcomer on
Have you tried? I was not aware that there was any possibility of restricting these so
they could not be generated by SendMessage or PostMessage.
joe

On Thu, 24 Dec 2009 23:30:01 -0800, Mao <Mao(a)discussions.microsoft.com> wrote:

>Dear all:
> I'm a junior engineer in SW. And now, i try to develop a software to
>simulate a touch screen's operation without any touch hardware. In win 7,
>these two message, wm_touch and wm_gesture, can't be triggled directly by
>SendMessage and PostMessage. So In win7's touch architecture, these messages
>can only be triggled by a touch hardware? Or It can be triggled by other win
>api and other ways, like driver, to make it true?
Joseph M. Newcomer [MVP]
email: newcomer(a)flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
From: Mao on
"Note also that the touch input handle in this parameter is no longer valid
after the message has been forwarded using PostMessage, SendMessage, or one
of their variants. These functions will close and invalidate this handle."

Above is the note in the MS MSDN's wm_touch description, and i had tried to
directly use postmessage and sendmessage in a button event, just like the
below example,

MESSAGE_MAP
ON_MESSAGE(WM_TOUCH , OnTouch);

void XXXX::OnBnClicked()
{
this->PostMessage(WM_TOUCH , wParam , lParam);
}

the OnTouch function has also been added in my program, but when the
PostMessage transferred the WM_TOUCH message, my onTouch function doestn't be
triggled. Furthermore, if i changed the WM_TOUCH to any other Message, like
WM_LBUTTONDOWN, the program processing is also correct(onTouch can be
triggled). So i think whether the wm_touch message can't be directly triggled
if i have no any touch hardware. Or by other ways to triggle these message.

Thanks for reply....
--
....


"Joseph M. Newcomer" wrote:

> Have you tried? I was not aware that there was any possibility of restricting these so
> they could not be generated by SendMessage or PostMessage.
> joe

From: Mao on
"Note also that the touch input handle in this parameter is no longer valid
after the message has been forwarded using PostMessage, SendMessage, or one
of their variants. These functions will close and invalidate this handle."

Above is the note in the MS MSDN's wm_touch description. How to make sure
the privilege as the one handling WM_TOUCH? If i have no privilege to handle
WM_TOUCH, the privilege how to get?
PS: In my program, if i change wm_touch to other messages, like
WM_LBUTTONDOWN, the program process can work correctly, but wm_touch can't.
--
....

> Why do you say they can't be triggered with PostMessage()? Make sure the
> app that is posting has the same privilege as the one handling WM_TOUCH (or
> run the poster app As Administrator to be sure).
>
> -- David
>
> .
>