次の方法で共有


Capturing Touch Screen (Stylus) Input (Windows Embedded CE 6.0)

1/6/2010

The OS usually posts a stylus message to the window that contains the position at which the user tapped the touch screen when the stylus event occurs. An application can change this behavior by using the SetCapture function to route stylus messages to a specific window. The specified window receives all of the stylus messages until the application calls the ReleaseCapture function or calls the SetCapture function to specify another capture window, or until the user taps on a window that another thread created.

When the stylus capture changes, the OS sends a WM_CAPTURECHANGED message to the window that is losing the stylus capture. The lParam parameter of this message specifies a handle to the window that is gaining the stylus capture.

Only the foreground window can capture stylus input. When a background window attempts to capture stylus input, the background window receives messages only for stylus events that occur when the user taps the touch screen within the visible portion of the window.

Capturing stylus input is useful if a window must receive all stylus input, even when the stylus moves outside the window. For example, an application typically tracks the stylus position after the user presses the stylus to the touch screen and follows the stylus until the user removes the stylus from the touch screen. If an application has not captured stylus input and the user removes the stylus from the touch screen outside the window, the window does not receive the message that indicates that the user removed the stylus from the touch screen.

A thread can use the GetCapture function to determine whether one of the windows that the thread created has captured the stylus. If one of the windows that the thread created has captured the stylus, GetCapture retrieves a handle to the window.

See Also

Concepts

Receiving Double-Tap Messages

Other Resources

Touch Application Development