From 5b39dc76f1bc82f941d5c800ab9f34407a06b53a Mon Sep 17 00:00:00 2001 From: Igor Pavlov <87184205+ip7z@users.noreply.github.com> Date: Wed, 21 Jun 2023 00:00:00 +0000 Subject: 23.01 --- CPP/Windows/Shell.h | 62 ++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 49 insertions(+), 13 deletions(-) (limited to 'CPP/Windows/Shell.h') diff --git a/CPP/Windows/Shell.h b/CPP/Windows/Shell.h index de91d3f..b4cdb30 100644 --- a/CPP/Windows/Shell.h +++ b/CPP/Windows/Shell.h @@ -1,17 +1,22 @@ // Windows/Shell.h -#ifndef __WINDOWS_SHELL_H -#define __WINDOWS_SHELL_H +#ifndef ZIP7_WINDOWS_SHELL_H +#define ZIP7_WINDOWS_SHELL_H +#include "../Common/Common.h" #include "../Common/MyWindows.h" +#if defined(__MINGW32__) || defined(__MINGW64__) +#include +#else #include +#endif #include "../Common/MyString.h" #include "Defs.h" -namespace NWindows{ -namespace NShell{ +namespace NWindows { +namespace NShell { ///////////////////////// // CItemIDList @@ -20,6 +25,7 @@ namespace NShell{ class CItemIDList { LPITEMIDLIST m_Object; + Z7_CLASS_NO_COPY(CItemIDList) public: CItemIDList(): m_Object(NULL) {} // CItemIDList(LPCITEMIDLIST itemIDList); @@ -49,6 +55,7 @@ public: ///////////////////////////// // CDrop +/* class CDrop { HDROP m_Object; @@ -63,22 +70,51 @@ public: operator HDROP() { return m_Object;} bool QueryPoint(LPPOINT point) { return BOOLToBool(::DragQueryPoint(m_Object, point)); } - void Finish() { ::DragFinish(m_Object); } - UINT QueryFile(UINT fileIndex, LPTSTR fileName, UINT fileNameSize) - { return ::DragQueryFile(m_Object, fileIndex, fileName, fileNameSize); } + void Finish() + { + ::DragFinish(m_Object); + } + UINT QueryFile(UINT fileIndex, LPTSTR fileName, UINT bufSize) + { return ::DragQueryFile(m_Object, fileIndex, fileName, bufSize); } #ifndef _UNICODE - UINT QueryFile(UINT fileIndex, LPWSTR fileName, UINT fileNameSize) - { return ::DragQueryFileW(m_Object, fileIndex, fileName, fileNameSize); } + UINT QueryFile(UINT fileIndex, LPWSTR fileName, UINT bufSize) + { return ::DragQueryFileW(m_Object, fileIndex, fileName, bufSize); } #endif UINT QueryCountOfFiles(); - UString QueryFileName(UINT fileIndex); + void QueryFileName(UINT fileIndex, UString &fileName); void QueryFileNames(UStringVector &fileNames); }; - +*/ #endif -///////////////////////////// -// Functions +struct CFileAttribs +{ + int FirstDirIndex; + // DWORD Sum; + // DWORD Product; + // CRecordVector Vals; + // CRecordVector IsDirVector; + + CFileAttribs() + { + Clear(); + } + + void Clear() + { + FirstDirIndex = -1; + // Sum = 0; + // Product = 0; + // IsDirVector.Clear(); + } +}; + + +/* read pathnames from HDROP or SHELLIDLIST. + The parser can return E_INVALIDARG, if there is some unexpected data in dataObject */ +HRESULT DataObject_GetData_HDROP_or_IDLIST_Names(IDataObject *dataObject, UStringVector &names); + +HRESULT DataObject_GetData_FILE_ATTRS(IDataObject *dataObject, CFileAttribs &attribs); bool GetPathFromIDList(LPCITEMIDLIST itemIDList, CSysString &path); bool BrowseForFolder(LPBROWSEINFO lpbi, CSysString &resultPath); -- cgit v1.2.3-55-g6feb