ReactOS 0.4.15-dev-8116-gf69e256
DragSourceHelper Class Reference

implementation of IDragSourceHelper interface More...

#include <dragdropimpl.h>

Collaboration diagram for DragSourceHelper:

Public Member Functions

 DragSourceHelper ()
 
virtual ~DragSourceHelper ()
 
HRESULT InitializeFromBitmap (HBITMAP hBitmap, POINT &pt, RECT &rc, IDataObject *pDataObject, COLORREF crColorKey=GetSysColor(COLOR_WINDOW))
 
HRESULT InitializeFromWindow (HWND hwnd, POINT &pt, IDataObject *pDataObject)
 

Private Attributes

IDragSourceHelperpDragSourceHelper
 

Detailed Description

implementation of IDragSourceHelper interface

Definition at line 214 of file dragdropimpl.h.

Constructor & Destructor Documentation

◆ DragSourceHelper()

DragSourceHelper::DragSourceHelper ( )
inline

Definition at line 219 of file dragdropimpl.h.

220 {
221 if (FAILED(CoCreateInstance(CLSID_DragDropHelper,
222 NULL,
223 CLSCTX_INPROC_SERVER,
224 IID_IDragSourceHelper,
225 (void**)&pDragSourceHelper)))
227 }
IDragSourceHelper * pDragSourceHelper
Definition: dragdropimpl.h:216
#define NULL
Definition: types.h:112
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
#define FAILED(hr)
Definition: intsafe.h:51

◆ ~DragSourceHelper()

virtual DragSourceHelper::~DragSourceHelper ( )
inlinevirtual

Definition at line 229 of file dragdropimpl.h.

230 {
231 if (pDragSourceHelper != NULL)
232 {
235 }
236 }
ULONG Release()

Member Function Documentation

◆ InitializeFromBitmap()

HRESULT DragSourceHelper::InitializeFromBitmap ( HBITMAP  hBitmap,
POINT pt,
RECT rc,
IDataObject pDataObject,
COLORREF  crColorKey = GetSysColor(COLOR_WINDOW) 
)
inline

Definition at line 239 of file dragdropimpl.h.

245 {
246 if (pDragSourceHelper == NULL)
247 return E_FAIL;
248
249 SHDRAGIMAGE di;
250 BITMAP bm;
251 GetObject(hBitmap, sizeof(bm), &bm);
252 di.sizeDragImage.cx = bm.bmWidth;
253 di.sizeDragImage.cy = bm.bmHeight;
254 di.hbmpDragImage = hBitmap;
255 di.crColorKey = crColorKey;
256 di.ptOffset.x = pt.x - rc.left;
257 di.ptOffset.y = pt.y - rc.top;
258 return pDragSourceHelper->InitializeFromBitmap(&di, pDataObject);
259 }
#define E_FAIL
Definition: ddrawi.h:102
static HBITMAP hBitmap
Definition: timezone.c:26
#define pt(x, y)
Definition: drawing.c:79
HRESULT InitializeFromBitmap([in] LPSHDRAGIMAGE pshdi, [in] IDataObject *pDataObject)
Definition: bl.h:1331
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
#define GetObject
Definition: wingdi.h:4468

◆ InitializeFromWindow()

HRESULT DragSourceHelper::InitializeFromWindow ( HWND  hwnd,
POINT pt,
IDataObject pDataObject 
)
inline

Definition at line 261 of file dragdropimpl.h.

262 {
263 if (pDragSourceHelper == NULL)
264 return E_FAIL;
265 return pDragSourceHelper->InitializeFromWindow(hwnd, &pt, pDataObject);
266 }
HRESULT InitializeFromWindow([in] HWND hwnd, [in] POINT *ppt, [in] IDataObject *pDataObject)
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023

Member Data Documentation

◆ pDragSourceHelper

IDragSourceHelper* DragSourceHelper::pDragSourceHelper
private

The documentation for this class was generated from the following file: