A tip for Windows 7 touch development

Windows 7 running on Touch PC works like this:

 

Once the vertical scroll bar is enabled on a window and comes out to work, pressing finger inside the window dose not gernerate WM_LBUTTONDOWN message at once. That is different from using the mouse device(while using the mouse, the WM_LBUTTONDOW message will be generated once you press the mouse inside the window, and the WM_LBUTTONUP message will be generated once you release the mouse).

 

Now assume that you have just pressed your finger inside the vertical scrolled window.

 

If you move your finger backward or forward first, the WM_LBUTTONDOWN message will be generated at once. And then you will do the action as mousemove with left mouse button being pressed. While you release your finger, the WM_LBUTTONUP message is generated at once. In this case, you are doing mouse moving.

 

If you move your finger upward or downward first, the WM_LBUTTONDOWN message will not be generated. Then you begin to scroll the window, and there is no WM_MOUSEMOVE message even though you move your finger backward or forward. While you release your finger, there is no WM_LBUTTONUP message generated. In this case, you are doing scrolling.

 

If you do not move your finger and just release it, there will be three messages generated in the sequence : WM_LBUTTONDOWN,

WM_MOUSEMOVE,

WM_LBUTTONUP.

 

You can test these using the Notepad.

你可能感兴趣的:(windows,action,button,scroll)