Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

IDirectManipulationViewport::SetContact method

Specifies an association between a contact and the viewport.

Syntax


HRESULT SetContact(
  [in]  UINT32 pointerId
);

Parameters

pointerId [in]

The ID of the pointer.

Return value

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

Remarks

Call this method when it a WM_POINTERDOWN message is received. Upon receiving a WM_POINTERDOWN, the application can use the coordinates of the input to hit-test and determine the viewports to which the contact is associated.

After initialization, Direct Manipulation is not aware of viewport z-order or parent-child relations between viewports. The order of SetContact calls defines the viewport tree. To establish the correct viewport hierarchy, SetContact should be called first on the child-most viewport, followed by the parent, grand-parent, and so on.

Use GET_POINTERID_WPARAM to get the pointer identifier from a pointer message. The contact is removed automatically when WM_POINTERUP is received.

If a contact is associated with one or more viewports using the SetContact method, Direct Manipulation will examine further input from that contact and attempt to identify an appropriate manipulation based on the configuration of the associated viewports. If a manipulation is recognized, the application will then receive a WM_POINTERCAPTURECHANGED message for this contact. In this context, the WM_POINTERCAPTURECHANGED message indicates that Direct Manipulation has captured the contact and the application will not receive input from this contact that is consumed for this manipulation.

Requirements

Minimum supported client

Windows 8 [desktop apps only]

Minimum supported server

Windows Server 2012 [desktop apps only]

Header

DirectManipulation.h

IDL

DirectManipulation.idl

IID

IID_IDirectManipulationViewport is defined as 28b85a3d-60a0-48bd-9ba1-5ce8d9ea3a6d

See also

IDirectManipulationViewport
User Input Messages and Notifications

 

 

Community Additions

Show:
© 2014 Microsoft