ReactOS  0.4.15-dev-3739-gff9301e
CDeskLinkDropHandler Class Reference

#include <CDeskLinkDropHandler.hpp>

Inheritance diagram for CDeskLinkDropHandler:
Collaboration diagram for CDeskLinkDropHandler:

Public Member Functions

 CDeskLinkDropHandler ()
 
 ~CDeskLinkDropHandler ()
 
STDMETHODIMP DragEnter (IDataObject *pDataObject, DWORD dwKeyState, POINTL pt, DWORD *pdwEffect)
 
STDMETHODIMP DragOver (DWORD dwKeyState, POINTL pt, DWORD *pdwEffect)
 
STDMETHODIMP DragLeave ()
 
STDMETHODIMP Drop (IDataObject *pDataObject, DWORD dwKeyState, POINTL pt, DWORD *pdwEffect)
 
STDMETHODIMP GetClassID (CLSID *lpClassId)
 
STDMETHODIMP GetCurFile (LPOLESTR *ppszFileName)
 
STDMETHODIMP IsDirty ()
 
STDMETHODIMP Load (LPCOLESTR pszFileName, DWORD dwMode)
 
STDMETHODIMP Save (LPCOLESTR pszFileName, BOOL fRemember)
 
STDMETHODIMP SaveCompleted (LPCOLESTR pszFileName)
 
- Public Member Functions inherited from ATL::CComObjectRootEx< CComMultiThreadModelNoCS >
 ~CComObjectRootEx ()
 
ULONG InternalAddRef ()
 
ULONG InternalRelease ()
 
void Lock ()
 
void Unlock ()
 
HRESULT _AtlInitialConstruct ()
 
- Public Member Functions inherited from ATL::CComObjectRootBase
 CComObjectRootBase ()
 
 ~CComObjectRootBase ()
 
void SetVoid (void *)
 
HRESULT _AtlFinalConstruct ()
 
HRESULT FinalConstruct ()
 
void InternalFinalConstructAddRef ()
 
void InternalFinalConstructRelease ()
 
void FinalRelease ()
 
- Public Member Functions inherited from IUnknown
HRESULT QueryInterface ([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
 
ULONG AddRef ()
 
ULONG Release ()
 

Additional Inherited Members

- Public Types inherited from IDropTarget
typedef IDropTargetLPDROPTARGET
 
- Public Types inherited from IUnknown
typedef IUnknownLPUNKNOWN
 
- Public Types inherited from IPersistFile
typedef IPersistFileLPPERSISTFILE
 
- Public Types inherited from IPersist
typedef IPersistLPPERSIST
 
- Static Public Member Functions inherited from ATL::CComObjectRootBase
static void WINAPI ObjectMain (bool)
 
static const struct _ATL_CATMAP_ENTRYGetCategoryMap ()
 
static HRESULT WINAPI InternalQueryInterface (void *pThis, const _ATL_INTMAP_ENTRY *pEntries, REFIID iid, void **ppvObject)
 
- Public Attributes inherited from ATL::CComObjectRootBase
LONG m_dwRef
 
- Public Attributes inherited from IDropTarget
const DWORD MK_ALT = 0x20
 
const DWORD DROPEFFECT_NONE = 0
 
const DWORD DROPEFFECT_COPY = 1
 
const DWORD DROPEFFECT_MOVE = 2
 
const DWORD DROPEFFECT_LINK = 4
 
const DWORD DROPEFFECT_SCROLL = 0x80000000
 
const DWORD DD_DEFSCROLLINSET = 11
 
const DWORD DD_DEFSCROLLDELAY = 50
 
const DWORD DD_DEFSCROLLINTERVAL = 50
 
const DWORD DD_DEFDRAGDELAY = 200
 
const DWORD DD_DEFDRAGMINDIST = 2
 

Detailed Description

Definition at line 13 of file CDeskLinkDropHandler.hpp.

Constructor & Destructor Documentation

◆ CDeskLinkDropHandler()

CDeskLinkDropHandler::CDeskLinkDropHandler ( )

Definition at line 12 of file CDeskLinkDropHandler.cpp.

13 {
15 }
LONG g_ModuleRefCnt
Definition: ACPPage.cpp:13
#define InterlockedIncrement
Definition: armddk.h:53

◆ ~CDeskLinkDropHandler()

CDeskLinkDropHandler::~CDeskLinkDropHandler ( )

Definition at line 17 of file CDeskLinkDropHandler.cpp.

18 {
20 }
LONG g_ModuleRefCnt
Definition: ACPPage.cpp:13
#define InterlockedDecrement
Definition: armddk.h:52

Member Function Documentation

◆ DragEnter()

STDMETHODIMP CDeskLinkDropHandler::DragEnter ( IDataObject pDataObject,
DWORD  dwKeyState,
POINTL  pt,
DWORD pdwEffect 
)

Implements IDropTarget.

Definition at line 24 of file CDeskLinkDropHandler.cpp.

26 {
27  TRACE("(%p)\n", this);
28 
29  *pdwEffect &= DROPEFFECT_LINK;
30 
31  return S_OK;
32 }
#define TRACE(s)
Definition: solgame.cpp:4
const DWORD DROPEFFECT_LINK
Definition: oleidl.idl:932
#define S_OK
Definition: intsafe.h:52

◆ DragLeave()

STDMETHODIMP CDeskLinkDropHandler::DragLeave ( void  )

Implements IDropTarget.

Definition at line 44 of file CDeskLinkDropHandler.cpp.

45 {
46  TRACE("(%p)\n", this);
47  return S_OK;
48 }
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:52

◆ DragOver()

STDMETHODIMP CDeskLinkDropHandler::DragOver ( DWORD  dwKeyState,
POINTL  pt,
DWORD pdwEffect 
)

Implements IDropTarget.

Definition at line 35 of file CDeskLinkDropHandler.cpp.

36 {
37  TRACE("(%p)\n", this);
38 
39  *pdwEffect &= DROPEFFECT_LINK;
40 
41  return S_OK;
42 }
#define TRACE(s)
Definition: solgame.cpp:4
const DWORD DROPEFFECT_LINK
Definition: oleidl.idl:932
#define S_OK
Definition: intsafe.h:52

◆ Drop()

STDMETHODIMP CDeskLinkDropHandler::Drop ( IDataObject pDataObject,
DWORD  dwKeyState,
POINTL  pt,
DWORD pdwEffect 
)

Implements IDropTarget.

Definition at line 51 of file CDeskLinkDropHandler.cpp.

53 {
54  TRACE("(%p)\n", this);
55 
56  if (!pDataObject)
57  {
58  ERR("pDataObject is NULL\n");
59  return E_POINTER;
60  }
61 
62  WCHAR szDir[MAX_PATH], szDest[MAX_PATH], szSrc[MAX_PATH];
64 
65  CComPtr<IShellFolder> pDesktop;
66  HRESULT hr = SHGetDesktopFolder(&pDesktop);
68  return hr;
69 
70  CDataObjectHIDA pida(pDataObject);
71  if (FAILED_UNEXPECTEDLY(pida.hr()))
72  return pida.hr();
73 
74  LPCITEMIDLIST pidlParent = HIDA_GetPIDLFolder(pida);
75  for (UINT i = 0; i < pida->cidl; ++i)
76  {
77  LPCITEMIDLIST pidlChild = HIDA_GetPIDLItem(pida, i);
78 
79  CComHeapPtr<ITEMIDLIST> pidl(ILCombine(pidlParent, pidlChild));
80  if (!pidl)
81  {
82  ERR("Out of memory\n");
83  break;
84  }
85 
86  StringCbCopyW(szDest, sizeof(szDest), szDir);
87  if (SHGetPathFromIDListW(pidl, szSrc))
88  {
89  CStringW strTitle;
90  strTitle.Format(IDS_SHORTCUT, PathFindFileNameW(szSrc));
91 
92  PathAppendW(szDest, strTitle);
93  PathRemoveExtensionW(szDest);
94  StringCbCatW(szDest, sizeof(szDest), L".lnk");
95 
96  hr = CreateShellLink(szDest, szSrc, NULL, NULL, NULL, NULL, -1, NULL);
97  }
98  else
99  {
100  STRRET strret;
101  hr = pDesktop->GetDisplayNameOf(pidl, SHGDN_INFOLDER, &strret);
102  if (FAILED_UNEXPECTEDLY(hr))
103  break;
104 
105  hr = StrRetToBufW(&strret, pidl, szSrc, _countof(szSrc));
106  if (FAILED_UNEXPECTEDLY(hr))
107  break;
108 
109  CStringW strTitle;
110  strTitle.Format(IDS_SHORTCUT, szSrc);
111 
112  PathAppendW(szDest, strTitle);
113  PathRemoveExtensionW(szDest);
114  StringCbCatW(szDest, sizeof(szDest), L".lnk");
115 
116  hr = CreateShellLink(szDest, NULL, pidl, NULL, NULL, NULL, -1, NULL);
117  }
118 
119  if (FAILED_UNEXPECTEDLY(hr))
120  break;
121  }
122 
123  return hr;
124 }
HRESULT hr
Definition: shlfolder.c:183
HRESULT WINAPI StrRetToBufW(LPSTRRET src, const ITEMIDLIST *pidl, LPWSTR dest, UINT len)
Definition: string.c:1522
LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:699
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
Definition: pidl.c:1294
static PCUIDLIST_RELATIVE HIDA_GetPIDLItem(CIDA const *pida, SIZE_T i)
Definition: shellutils.h:554
void __cdecl Format(UINT nFormatID,...)
Definition: cstringt.h:753
#define IDS_SHORTCUT
Definition: resource.h:12
STRSAFEAPI StringCbCatW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:342
BOOL WINAPI PathAppendW(LPWSTR lpszPath, LPCWSTR lpszAppend)
Definition: path.c:126
#define L(x)
Definition: ntvdm.h:50
#define FALSE
Definition: types.h:117
void WINAPI PathRemoveExtensionW(LPWSTR lpszPath)
Definition: path.c:823
LPWSTR WINAPI PathFindFileNameW(LPCWSTR lpszPath)
Definition: path.c:394
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:79
#define _countof(array)
Definition: sndvol32.h:68
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:82
#define MAX_PATH
Definition: compat.h:34
static PCUIDLIST_ABSOLUTE HIDA_GetPIDLFolder(CIDA const *pida)
Definition: shellutils.h:549
#define ERR(fmt,...)
Definition: debug.h:110
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
BOOL WINAPI SHGetSpecialFolderPathW(HWND hwndOwner, LPWSTR szPath, int nFolder, BOOL bCreate)
Definition: shellpath.c:2851
HRESULT CreateShellLink(LPCWSTR pszLinkPath, LPCWSTR pszTargetPath OPTIONAL, LPCITEMIDLIST pidlTarget OPTIONAL, LPCWSTR pszArg OPTIONAL, LPCWSTR pszDir OPTIONAL, LPCWSTR pszIconPath OPTIONAL, INT iIconNr OPTIONAL, LPCWSTR pszComment OPTIONAL)
Definition: sendmail.cpp:102
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
#define CSIDL_DESKTOPDIRECTORY
Definition: shlobj.h:2027
#define E_POINTER
Definition: winerror.h:2365
STRSAFEAPI StringCbCopyW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:166

◆ GetClassID()

STDMETHODIMP CDeskLinkDropHandler::GetClassID ( CLSID lpClassId)

Implements IPersist.

Definition at line 157 of file CDeskLinkDropHandler.cpp.

158 {
159  TRACE("(%p)\n", this);
160 
161  if (!lpClassId)
162  {
163  ERR("lpClassId is NULL\n");
164  return E_POINTER;
165  }
166 
167  *lpClassId = CLSID_DeskLinkDropHandler;
168 
169  return S_OK;
170 }
#define TRACE(s)
Definition: solgame.cpp:4
#define ERR(fmt,...)
Definition: debug.h:110
#define S_OK
Definition: intsafe.h:52
#define E_POINTER
Definition: winerror.h:2365

◆ GetCurFile()

STDMETHODIMP CDeskLinkDropHandler::GetCurFile ( LPOLESTR ppszFileName)

Implements IPersistFile.

Definition at line 127 of file CDeskLinkDropHandler.cpp.

128 {
129  FIXME("(%p)\n", this);
130  return E_NOTIMPL;
131 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ IsDirty()

STDMETHODIMP CDeskLinkDropHandler::IsDirty ( void  )

Implements IPersistFile.

Definition at line 133 of file CDeskLinkDropHandler.cpp.

134 {
135  FIXME("(%p)\n", this);
136  return E_NOTIMPL;
137 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ Load()

STDMETHODIMP CDeskLinkDropHandler::Load ( LPCOLESTR  pszFileName,
DWORD  dwMode 
)

Implements IPersistFile.

Definition at line 139 of file CDeskLinkDropHandler.cpp.

140 {
141  return S_OK;
142 }
#define S_OK
Definition: intsafe.h:52

◆ Save()

STDMETHODIMP CDeskLinkDropHandler::Save ( LPCOLESTR  pszFileName,
BOOL  fRemember 
)

Implements IPersistFile.

Definition at line 144 of file CDeskLinkDropHandler.cpp.

145 {
146  FIXME("(%p)\n", this);
147  return E_NOTIMPL;
148 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ SaveCompleted()

STDMETHODIMP CDeskLinkDropHandler::SaveCompleted ( LPCOLESTR  pszFileName)

Implements IPersistFile.

Definition at line 150 of file CDeskLinkDropHandler.cpp.

151 {
152  FIXME("(%p)\n", this);
153  return E_NOTIMPL;
154 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

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