diff options
Diffstat (limited to '')
-rw-r--r-- | CPP/Windows/Shell.h | 62 |
1 files changed, 49 insertions, 13 deletions
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 @@ | |||
1 | // Windows/Shell.h | 1 | // Windows/Shell.h |
2 | 2 | ||
3 | #ifndef __WINDOWS_SHELL_H | 3 | #ifndef ZIP7_WINDOWS_SHELL_H |
4 | #define __WINDOWS_SHELL_H | 4 | #define ZIP7_WINDOWS_SHELL_H |
5 | 5 | ||
6 | #include "../Common/Common.h" | ||
6 | #include "../Common/MyWindows.h" | 7 | #include "../Common/MyWindows.h" |
8 | #if defined(__MINGW32__) || defined(__MINGW64__) | ||
9 | #include <shlobj.h> | ||
10 | #else | ||
7 | #include <ShlObj.h> | 11 | #include <ShlObj.h> |
12 | #endif | ||
8 | 13 | ||
9 | #include "../Common/MyString.h" | 14 | #include "../Common/MyString.h" |
10 | 15 | ||
11 | #include "Defs.h" | 16 | #include "Defs.h" |
12 | 17 | ||
13 | namespace NWindows{ | 18 | namespace NWindows { |
14 | namespace NShell{ | 19 | namespace NShell { |
15 | 20 | ||
16 | ///////////////////////// | 21 | ///////////////////////// |
17 | // CItemIDList | 22 | // CItemIDList |
@@ -20,6 +25,7 @@ namespace NShell{ | |||
20 | class CItemIDList | 25 | class CItemIDList |
21 | { | 26 | { |
22 | LPITEMIDLIST m_Object; | 27 | LPITEMIDLIST m_Object; |
28 | Z7_CLASS_NO_COPY(CItemIDList) | ||
23 | public: | 29 | public: |
24 | CItemIDList(): m_Object(NULL) {} | 30 | CItemIDList(): m_Object(NULL) {} |
25 | // CItemIDList(LPCITEMIDLIST itemIDList); | 31 | // CItemIDList(LPCITEMIDLIST itemIDList); |
@@ -49,6 +55,7 @@ public: | |||
49 | ///////////////////////////// | 55 | ///////////////////////////// |
50 | // CDrop | 56 | // CDrop |
51 | 57 | ||
58 | /* | ||
52 | class CDrop | 59 | class CDrop |
53 | { | 60 | { |
54 | HDROP m_Object; | 61 | HDROP m_Object; |
@@ -63,22 +70,51 @@ public: | |||
63 | operator HDROP() { return m_Object;} | 70 | operator HDROP() { return m_Object;} |
64 | bool QueryPoint(LPPOINT point) | 71 | bool QueryPoint(LPPOINT point) |
65 | { return BOOLToBool(::DragQueryPoint(m_Object, point)); } | 72 | { return BOOLToBool(::DragQueryPoint(m_Object, point)); } |
66 | void Finish() { ::DragFinish(m_Object); } | 73 | void Finish() |
67 | UINT QueryFile(UINT fileIndex, LPTSTR fileName, UINT fileNameSize) | 74 | { |
68 | { return ::DragQueryFile(m_Object, fileIndex, fileName, fileNameSize); } | 75 | ::DragFinish(m_Object); |
76 | } | ||
77 | UINT QueryFile(UINT fileIndex, LPTSTR fileName, UINT bufSize) | ||
78 | { return ::DragQueryFile(m_Object, fileIndex, fileName, bufSize); } | ||
69 | #ifndef _UNICODE | 79 | #ifndef _UNICODE |
70 | UINT QueryFile(UINT fileIndex, LPWSTR fileName, UINT fileNameSize) | 80 | UINT QueryFile(UINT fileIndex, LPWSTR fileName, UINT bufSize) |
71 | { return ::DragQueryFileW(m_Object, fileIndex, fileName, fileNameSize); } | 81 | { return ::DragQueryFileW(m_Object, fileIndex, fileName, bufSize); } |
72 | #endif | 82 | #endif |
73 | UINT QueryCountOfFiles(); | 83 | UINT QueryCountOfFiles(); |
74 | UString QueryFileName(UINT fileIndex); | 84 | void QueryFileName(UINT fileIndex, UString &fileName); |
75 | void QueryFileNames(UStringVector &fileNames); | 85 | void QueryFileNames(UStringVector &fileNames); |
76 | }; | 86 | }; |
77 | 87 | */ | |
78 | #endif | 88 | #endif |
79 | 89 | ||
80 | ///////////////////////////// | 90 | struct CFileAttribs |
81 | // Functions | 91 | { |
92 | int FirstDirIndex; | ||
93 | // DWORD Sum; | ||
94 | // DWORD Product; | ||
95 | // CRecordVector<DWORD> Vals; | ||
96 | // CRecordVector<bool> IsDirVector; | ||
97 | |||
98 | CFileAttribs() | ||
99 | { | ||
100 | Clear(); | ||
101 | } | ||
102 | |||
103 | void Clear() | ||
104 | { | ||
105 | FirstDirIndex = -1; | ||
106 | // Sum = 0; | ||
107 | // Product = 0; | ||
108 | // IsDirVector.Clear(); | ||
109 | } | ||
110 | }; | ||
111 | |||
112 | |||
113 | /* read pathnames from HDROP or SHELLIDLIST. | ||
114 | The parser can return E_INVALIDARG, if there is some unexpected data in dataObject */ | ||
115 | HRESULT DataObject_GetData_HDROP_or_IDLIST_Names(IDataObject *dataObject, UStringVector &names); | ||
116 | |||
117 | HRESULT DataObject_GetData_FILE_ATTRS(IDataObject *dataObject, CFileAttribs &attribs); | ||
82 | 118 | ||
83 | bool GetPathFromIDList(LPCITEMIDLIST itemIDList, CSysString &path); | 119 | bool GetPathFromIDList(LPCITEMIDLIST itemIDList, CSysString &path); |
84 | bool BrowseForFolder(LPBROWSEINFO lpbi, CSysString &resultPath); | 120 | bool BrowseForFolder(LPBROWSEINFO lpbi, CSysString &resultPath); |