IDirectManipulationManager::Activate method (directmanipulation.h)

Activates Direct Manipulation for processing input and handling callbacks on the specified window.

Syntax

HRESULT Activate(
  [in] HWND window
);

Parameters

[in] window

The window in which to activate Direct Manipulation.

Return value

If the method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

The manipulation manager is deactivated, by default. The manager does not receive or respond to input and callbacks until Activate is called for the window.

Calls to Activate and Deactivate are reference counted.

Examples

The following example shows how to activate and deactivate input processing.

LRESULT WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
{
    BOOL handled = FALSE;
    switch ( msg )
    {
    case WM_SIZE:
        switch ( wParam)
        {
        case SIZE_MINIMIZED:
        case SIZE_MAXHIDE:
            pManipulationManager->Deactivate(hwnd);
            break;

        default:
            pManipulationManager->Activate(hwnd);
            break;
        }
        break;
    }
    if ( !handled)
    {
        return DefWindowProc(hwnd,msg,wParam,lParam);
    }
    else
    {
        return 0;
    }
}

Requirements

Requirement Value
Minimum supported client Windows 8 [desktop apps only]
Minimum supported server Windows Server 2012 [desktop apps only]
Target Platform Windows
Header directmanipulation.h

See also

IDirectManipulationManager