Download Source Code

CWinDropTarget Class Reference

Implements the IDropTarget interface. More...

#include <WinDropTarget.h>

List of all members.

Public Member Functions

BOOL Revoke ()
 Cancels drag and drop support for encapsulated window.
BOOL Register (HWND hWnd, UINT uMsg)
 Registers the specified window for drag and drop support.
HRESULT STDMETHODCALLTYPE Drop (IDataObject *pdto, DWORD grfKeyState, POINTL ptl, DWORD *pdwEffect)
 Implements the drop message.
HRESULT STDMETHODCALLTYPE DragOver (DWORD grfKeyState, POINTL ptl, DWORD *pdwEffect)
 Handles the drag over message.
HRESULT STDMETHODCALLTYPE DragLeave ()
 Called when drag leaves a window.
HRESULT STDMETHODCALLTYPE DragEnter (IDataObject *pdto, DWORD grfKeyState, POINTL ptl, DWORD *pdwEffect)
 Called when a drag enters a window.
 CWinDropTarget ()
 Constructor.
virtual ~CWinDropTarget ()
 Destructor.
HRESULT STDMETHODCALLTYPE QueryInterface (REFIID iid, void **ppvObject)
 Query interface implementation.
ULONG STDMETHODCALLTYPE AddRef ()
 Adds object reference.
ULONG STDMETHODCALLTYPE Release ()
 Removes object reference.
void PlainTextMode (BOOL b)
 Sets plain text mode.

Static Public Member Functions

static BOOL GetData (IDataObject *pDo, UINT uClipboardFormat, TMem< BYTE > &buf)
 Retrieves data from the IDataObject.


Detailed Description

Implements the IDropTarget interface.

Use this class to add drag-and-drop support to any generic window. Drop information is relayed to the specified window via a standard windows message.


Member Function Documentation

HRESULT CWinDropTarget::DragEnter IDataObject *  pdto,
DWORD  grfKeyState,
POINTL  ptl,
DWORD *  pdwEffect
 

Called when a drag enters a window.

Parameters:
[in] pdto - Pointer to drop information
[in] grfKeyState - Key state
[in] ptl - Drag point
[out] pdwEffect - Receives drag effect
Returns:
See also:

HRESULT CWinDropTarget::DragOver DWORD  grfKeyState,
POINTL  ptl,
DWORD *  pdwEffect
 

Handles the drag over message.

Parameters:
[in] grfKeyState - Key state
[in] ptl - Drag point
[out] pdwEffect - Receives drag effect
Returns:
See also:

HRESULT CWinDropTarget::Drop IDataObject *  pdto,
DWORD  grfKeyState,
POINTL  ptl,
DWORD *  pdwEffect
 

Implements the drop message.

Parameters:
[in] pdto - Pointer to IDataObject
[in] grfKeyState - Key state at drop
[in] ptl - Drop point
[out] pdwEffect - Receives drop effect
Returns:
Zero if success
See also:

BOOL CWinDropTarget::GetData IDataObject *  pDo,
UINT  uClipboardFormat,
TMem< BYTE > &  buf
[static]
 

Retrieves data from the IDataObject.

Parameters:
[in] pDo - Pointer to IDataObject
[in] uClipboardFormat - Encoding format
[in] buf - Receives the data
Returns:
Non-zero if data is retrieved
See also:

void CWinDropTarget::PlainTextMode BOOL  b  )  [inline]
 

Sets plain text mode.

Parameters:
[in] b - Desired plain text mode
If non-zero, specifies that all drop messages should be converted to plain text. Otherwise, messages are passed on as is.

HRESULT STDMETHODCALLTYPE CWinDropTarget::QueryInterface REFIID  iid,
void **  ppvObject
[inline]
 

Query interface implementation.

Parameters:
[in] iid - Interface ID
[out] ppvObject - Receives interface pointer.
Returns:
Zero if success
See also:

BOOL CWinDropTarget::Register HWND  hWnd,
UINT  uMsg
 

Registers the specified window for drag and drop support.

Parameters:
[in] hWnd - Window requiring drag and drop support
[in] uMsg - Drag and drop message callback
Returns:
Non-zero if success
See also:

BOOL CWinDropTarget::Revoke  ) 
 

Cancels drag and drop support for encapsulated window.

Returns:
Non-zero if success
See also:


The documentation for this class was generated from the following files:
  • inc/WinDropTarget.h
  • WinDropTarget.cpp
Copyright Robert Umbehant
This documentation is covered by the LGPL