IDirectManipulationManager::P rocessInput 方法 (directmanipulation.h)

将键盘和鼠标消息传递到应用的 UI 线程上的操作管理器。

语法

HRESULT ProcessInput(
  [in]          const MSG *message,
  [out, retval] BOOL      *handled
);

参数

[in] message

要处理的输入消息。

[out, retval] handled

如果不应对此消息进行进一步处理,则为 TRUE;否则为 FALSE

返回值

如果方法成功,则返回 S_OK。 否则,将返回 HRESULT 错误代码。

注解

为鼠标和键盘输入调用此方法。

示例

以下示例演示如何将消息传递给操作管理器。

LRESULT WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    BOOL handled = FALSE;

LRESULT WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    BOOL handled = FALSE;
    switch (msg)
    {
    case WM_KEYDOWN:
    case WM_POINTERWHEEL:
    case WM_POINTERHWHEEL:
    case WM_MOUSEWHEEL:
    case WM_MOUSEHWHEEL:
        MSG msg = {};
        msg.hwnd = hwnd;
        msg.message = message;
        msg.lParam = lParam;
        msg.wParam = wParam;

        if (FAILED(m_pManipulationManager->ProcessInput(&msg, &handled)))
        {
            handled = false;
        }
        break;
    }

    if ( !handled)
    {
        return DefWindowProc(hwnd,msg,wParam,lParam);
    }
    else
    {
        return 0;
    }
}

要求

要求
最低受支持的客户端 Windows 8 [仅限桌面应用]
最低受支持的服务器 Windows Server 2012 [仅限桌面应用]
目标平台 Windows
标头 directmanipulation.h

另请参阅

IDirectManipulationManager