IDirectManipulationViewport::AddEventHandler method

Adds a new event handler to listen for viewport events.

Syntax


HRESULT AddEventHandler(
  [in]           HWND window,
  [in]           IDirectManipulationViewportEventHandler *eventHandler,
  [out, retval]  DWORD *cookie
);

Parameters

window [in]

The handle of a window owned by the thread for the event callback.

eventHandler [in]

The handler that is called when viewport status and update events occur. The specified object must implement the IDirectManipulationViewportEventHandler interface.

cookie [out, retval]

The handle that represents this event handler callback.

Return value

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

Remarks

The event callback is fired from the thread that owns the specified window. Consecutive events of the same callback method may be coalesced.

Note  If the viewport has a drag-drop behavior attached, the event handler should implement IDirectManipulationDragDropEventHandler.

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

 

 

Community Additions

ADD
Show:
© 2014 Microsoft