Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.7 KiB

  1. #ifndef __IDLDROP_H__
  2. #define __IDLDROP_H__
  3. typedef struct {
  4. DWORD dwDefEffect;
  5. IDataObject *pdtobj;
  6. POINTL pt;
  7. DWORD * pdwEffect;
  8. HKEY hkeyProgID;
  9. HKEY hkeyBase;
  10. UINT idMenu;
  11. UINT idCmd;
  12. DWORD grfKeyState;
  13. } DRAGDROPMENUPARAM;
  14. class CIDLDropTarget: public IDropTarget
  15. {
  16. public:
  17. CIDLDropTarget(HWND hwnd);
  18. HRESULT _Init(LPCITEMIDLIST pidl);
  19. HWND _GetWindow();
  20. // IUnknown
  21. STDMETHODIMP QueryInterface(REFIID riid, void **ppvObj);
  22. STDMETHODIMP_(ULONG) AddRef();
  23. STDMETHODIMP_(ULONG) Release();
  24. // IDropTarget methods.
  25. STDMETHODIMP DragEnter(IDataObject *pDataObj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect);
  26. STDMETHODIMP DragOver(DWORD grfKeyState, POINTL pt, DWORD *pdwEffect);
  27. STDMETHODIMP DragLeave();
  28. STDMETHODIMP Drop(IDataObject *pDataObj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect);
  29. protected:
  30. virtual ~CIDLDropTarget();
  31. HRESULT DragDropMenu(DWORD dwDefaultEffect, IDataObject *pdtobj, POINTL pt, DWORD *pdwEffect, HKEY hkeyProgID, HKEY hkeyBase, UINT idMenu, DWORD grfKeyState);
  32. HRESULT DragDropMenuEx(DRAGDROPMENUPARAM *pddm);
  33. private:
  34. LONG m_cRef;
  35. protected:
  36. HWND m_hwnd;
  37. LPITEMIDLIST m_pidl; // IDList to the target folder
  38. DWORD m_grfKeyStateLast; // for previous DragOver/Enter
  39. IDataObject *m_pdtobj;
  40. DWORD m_dwEffectLastReturned; // stashed effect that's returned by base class's dragover
  41. DWORD m_dwData; // DTID_*
  42. DWORD m_dwEffectPreferred; // if dwData & DTID_PREFERREDEFFECT
  43. };
  44. #endif