RegisterTouchWindow function (winuser.h)
Registers a window as being touch-capable.
Syntax
BOOL RegisterTouchWindow(
[in] HWND hwnd,
[in] ULONG ulFlags
);
Parameters
[in] hwnd
The handle of the window being registered. The function fails with ERROR_ACCESS_DENIED if the calling thread does not own the specified window.
[in] ulFlags
A set of bit flags that specify optional modifications. This field may contain 0 or one of the following values.
Value | Meaning |
---|---|
|
Specifies that hWnd prefers noncoalesced touch input. |
|
Setting this flag disables palm rejection which reduces delays for getting WM_TOUCH messages.
This is useful if you want as quick of a response as possible when a user touches your application.
By default, palm detection is enabled and some WM_TOUCH messages are prevented from being sent to your application. This is useful if you do not want to receive WM_TOUCH messages that are from palm contact. |
Return value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, use the GetLastError function.
Remarks
Examples
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
HWND hWnd;
hInst = hInstance; // Store instance handle in the global variable.
hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);
RegisterTouchWindow(hWnd, 0);
if (!hWnd)
{
return FALSE;
}
ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);
return TRUE;
}
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 7 [desktop apps only] |
Minimum supported server | Windows Server 2008 R2 [desktop apps only] |
Target Platform | Windows |
Header | winuser.h (include Windows.h) |
Library | User32.lib |
DLL | User32.dll |