开发者

Getting WM_TOUCH messages from every window and processing in my APP

I am developing touchscreen application. The goal of the application is when the end user is going to make vertical touch movement (a vertical line with his finger)on the screen on touchscreen device with Windows7 all of the active windows need to minimize (something like show desktop). My question is how can i process all the WM_TOUCH messages that happen everywhere in every window that is active on the desktop. There is no windows hook with which i can take all 开发者_如何学编程the WM_TOUCH messages. I tried to use the WH_GETMESSAGE with hope that i can extract the WM_TOUCH messages but is not working, I tried to use the WH_MOUSE_LL and got all the mouse events. There is function GetMessageExtraInfo with which i can see from where the mouse messages is initiated with this code:

if ((GetMessageExtraInfo().ToInt32() & MOUSEEVENTF_FROMTOUCH) == 0xFF515700) { textBoxLog.AppendText("asdada"); } if this is true then the message is initiated by TouchScreen device. This works only with the messages that are sent from my app(my app active window), but not with the mouse messages i am getting from the other windows outside my app window. I am researching this subject for a while and i still can't get any answer. So please if someone knows any way how can i get all the WM_TOUCH messages to my app please respond.

Mihail


You must hook the global message proc. This way you are the first to get at all the messages. The way you are doing this will not work because your wndproc is only "active" when your windows is active.

Simply create a new wndproc that processes only the messages you want to be global and either allowing them to pass through or cutting them off depending on the logic you want.

http://msdn.microsoft.com/en-us/library/ms644990%28v=vs.85%29.aspx


According to a similiar discussion on Windows DevCenter this doesn't seem to be possible:

There is no good way to catch touch input globally on Windows 7. As Bob mentioned, windows need to be specifically registered to receive touch input and this isn't something that can be safely done for other applications' windows.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜