CF_HDropAggregator.cpp 627 B

1234567891011121314151617181920212223242526272829303132
  1. #include "stdafx.h"
  2. #include ".\cf_hdropaggregator.h"
  3. CCF_HDropAggregator::CCF_HDropAggregator(void)
  4. {
  5. }
  6. CCF_HDropAggregator::~CCF_HDropAggregator(void)
  7. {
  8. }
  9. bool CCF_HDropAggregator::AddClip(LPVOID lpData, int nDataSize, int nPos, int nCount)
  10. {
  11. HDROP drop = (HDROP)GlobalLock((HDROP)lpData);
  12. int nNumFiles = DragQueryFile(drop, -1, NULL, 0);
  13. TCHAR file[MAX_PATH];
  14. for(int nFile = 0; nFile < nNumFiles; nFile++)
  15. {
  16. if(DragQueryFile(drop, nFile, file, sizeof(file)) > 0)
  17. {
  18. m_DropFiles.AddFile(file);
  19. }
  20. }
  21. return true;
  22. }
  23. HGLOBAL CCF_HDropAggregator::GetHGlobal()
  24. {
  25. return m_DropFiles.CreateCF_HDROPBuffer();
  26. }