Author: gadamopoulos
Date: Mon Jun 12 18:38:26 2017
New Revision: 75013
URL:
http://svn.reactos.org/svn/reactos?rev=75013&view=rev
Log:
[SHELL32] -Add Comments as the 2nd column in CDesktopFolder, CDrivesFolder and CRegFolder.
Add Type as the 3rd column in CRegFolder. This is not entirely correct. Our columns
support is rudimentary, however we now show the comments stuff in the right place and the
reg folder items have a type.
Modified:
trunk/reactos/dll/win32/shell32/folders/CDesktopFolder.cpp
trunk/reactos/dll/win32/shell32/folders/CDrivesFolder.cpp
trunk/reactos/dll/win32/shell32/folders/CFSFolder.cpp
trunk/reactos/dll/win32/shell32/folders/CRegFolder.cpp
Modified: trunk/reactos/dll/win32/shell32/folders/CDesktopFolder.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
==============================================================================
--- trunk/reactos/dll/win32/shell32/folders/CDesktopFolder.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/folders/CDesktopFolder.cpp [iso-8859-1] Mon Jun 12
18:38:26 2017
@@ -64,12 +64,14 @@
static const shvheader DesktopSFHeader[] = {
{IDS_SHV_COLUMN_NAME, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_LEFT,
15},
+ {IDS_SHV_COLUMN_COMMENTS, SHCOLSTATE_TYPE_STR, LVCFMT_LEFT, 10},
+ {IDS_SHV_COLUMN_TYPE, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_LEFT,
10},
{IDS_SHV_COLUMN_SIZE, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT,
10},
- {IDS_SHV_COLUMN_TYPE, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_LEFT,
10},
{IDS_SHV_COLUMN_MODIFIED, SHCOLSTATE_TYPE_DATE | SHCOLSTATE_ONBYDEFAULT, LVCFMT_LEFT,
12},
+ {IDS_SHV_COLUMN_ATTRIBUTES, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT,
LVCFMT_LEFT, 10}
};
-#define DESKTOPSHELLVIEWCOLUMNS 4
+#define DESKTOPSHELLVIEWCOLUMNS 6
static const DWORD dwDesktopAttributes =
SFGAO_HASSUBFOLDER | SFGAO_FILESYSTEM | SFGAO_FOLDER | SFGAO_FILESYSANCESTOR |
Modified: trunk/reactos/dll/win32/shell32/folders/CDrivesFolder.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
==============================================================================
--- trunk/reactos/dll/win32/shell32/folders/CDrivesFolder.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/folders/CDrivesFolder.cpp [iso-8859-1] Mon Jun 12
18:38:26 2017
@@ -183,12 +183,13 @@
static const shvheader MyComputerSFHeader[] = {
{IDS_SHV_COLUMN_NAME, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_LEFT,
15},
+ {IDS_SHV_COLUMN_COMMENTS, SHCOLSTATE_TYPE_STR, LVCFMT_LEFT, 10},
{IDS_SHV_COLUMN_TYPE, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_LEFT,
10},
{IDS_SHV_COLUMN_DISK_CAPACITY, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT,
LVCFMT_RIGHT, 10},
{IDS_SHV_COLUMN_DISK_AVAILABLE, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT,
LVCFMT_RIGHT, 10},
};
-#define MYCOMPUTERSHELLVIEWCOLUMNS 4
+#define MYCOMPUTERSHELLVIEWCOLUMNS 5
static const DWORD dwComputerAttributes =
SFGAO_CANRENAME | SFGAO_CANDELETE | SFGAO_HASPROPSHEET | SFGAO_DROPTARGET |
@@ -460,13 +461,16 @@
hres = MAKE_COMPARE_HRESULT(result);
break;
}
- case 1: /* Type */
+ case 1: /* comments */
+ hres = MAKE_COMPARE_HRESULT(0);
+ break;
+ case 2: /* Type */
{
/* We want to return immediately because SHELL32_CompareDetails also compares
children. */
return SHELL32_CompareDetails(this, lParam, pidl1, pidl2);
}
- case 2: /* Size */
- case 3: /* Size Available */
+ case 3: /* Size */
+ case 4: /* Size Available */
{
ULARGE_INTEGER Drive1Available, Drive1Total, Drive2Available, Drive2Total;
@@ -481,7 +485,7 @@
Drive2Available.QuadPart = Drive2Total.QuadPart = 0;
LARGE_INTEGER Diff;
- if (lParam == 2) /* Size */
+ if (lParam == 3) /* Size */
Diff.QuadPart = Drive1Total.QuadPart - Drive2Total.QuadPart;
else /* Size available */
Diff.QuadPart = Drive1Available.QuadPart - Drive2Available.QuadPart;
@@ -842,11 +846,14 @@
case 0: /* name */
hr = GetDisplayNameOf(pidl, SHGDN_NORMAL | SHGDN_INFOLDER,
&psd->str);
break;
- case 1: /* type */
+ case 1: /* FIXME: comments */
+ hr = SHSetStrRet(&psd->str, "");
+ break;
+ case 2: /* type */
hr = SHSetStrRet(&psd->str, iDriveTypeIds[DriveType]);
break;
- case 2: /* total size */
- case 3: /* free size */
+ case 3: /* total size */
+ case 4: /* free size */
psd->str.cStr[0] = 0x00;
psd->str.uType = STRRET_CSTR;
if (GetVolumeInformationA(pszDrive, NULL, 0, NULL, NULL, NULL, NULL, 0))
Modified: trunk/reactos/dll/win32/shell32/folders/CFSFolder.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
==============================================================================
--- trunk/reactos/dll/win32/shell32/folders/CFSFolder.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/folders/CFSFolder.cpp [iso-8859-1] Mon Jun 12 18:38:26
2017
@@ -81,13 +81,14 @@
static const shvheader GenericSFHeader[] = {
{IDS_SHV_COLUMN_NAME, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_LEFT,
15},
+ {IDS_SHV_COLUMN_COMMENTS, SHCOLSTATE_TYPE_STR, LVCFMT_LEFT, 0},
+ {IDS_SHV_COLUMN_TYPE, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_LEFT,
10},
{IDS_SHV_COLUMN_SIZE, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT,
10},
- {IDS_SHV_COLUMN_TYPE, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_LEFT,
10},
{IDS_SHV_COLUMN_MODIFIED, SHCOLSTATE_TYPE_DATE | SHCOLSTATE_ONBYDEFAULT, LVCFMT_LEFT,
12},
{IDS_SHV_COLUMN_ATTRIBUTES, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT,
LVCFMT_LEFT, 10}
};
-#define GENERICSHELLVIEWCOLUMNS 5
+#define GENERICSHELLVIEWCOLUMNS 6
/**************************************************************************
* SHELL32_CreatePidlFromBindCtx [internal]
@@ -328,20 +329,23 @@
case 0: /* Name */
result = wcsicmp(pDataW1->wszName, pDataW2->wszName);
break;
+ case 1: /* Comments */
+ result = 0;
+ break;
case 2: /* Type */
pExtension1 = PathFindExtensionW(pDataW1->wszName);
pExtension2 = PathFindExtensionW(pDataW2->wszName);
result = wcsicmp(pExtension1, pExtension2);
break;
- case 1: /* Size */
+ case 3: /* Size */
result = pData1->u.file.dwFileSize - pData2->u.file.dwFileSize;
break;
- case 3: /* Modified */
+ case 4: /* Modified */
result = pData1->u.file.uFileDate - pData2->u.file.uFileDate;
if (result == 0)
result = pData1->u.file.uFileTime - pData2->u.file.uFileTime;
break;
- case 4: /* Attributes */
+ case 5: /* Attributes */
return SHELL32_CompareDetails(this, lParam, pidl1, pidl2);
}
@@ -825,19 +829,21 @@
switch (iColumn)
{
case 0: /* name */
- hr = GetDisplayNameOf (pidl,
- SHGDN_NORMAL | SHGDN_INFOLDER, &psd->str);
+ hr = GetDisplayNameOf (pidl, SHGDN_NORMAL | SHGDN_INFOLDER,
&psd->str);
break;
- case 1: /* size */
- _ILGetFileSize(pidl, psd->str.cStr, MAX_PATH);
+ case 1: /* FIXME: comments */
+ psd->str.cStr[0] = 0;
break;
case 2: /* type */
_ILGetFileType(pidl, psd->str.cStr, MAX_PATH);
break;
- case 3: /* date */
+ case 3: /* size */
+ _ILGetFileSize(pidl, psd->str.cStr, MAX_PATH);
+ break;
+ case 4: /* date */
_ILGetFileDate(pidl, psd->str.cStr, MAX_PATH);
break;
- case 4: /* attributes */
+ case 5: /* attributes */
_ILGetFileAttributes(pidl, psd->str.cStr, MAX_PATH);
break;
}
Modified: trunk/reactos/dll/win32/shell32/folders/CRegFolder.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
==============================================================================
--- trunk/reactos/dll/win32/shell32/folders/CRegFolder.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/folders/CRegFolder.cpp [iso-8859-1] Mon Jun 12
18:38:26 2017
@@ -637,7 +637,7 @@
HRESULT WINAPI CRegFolder::GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS
*psd)
{
- if (!psd || iColumn >= 2)
+ if (!psd)
return E_INVALIDARG;
GUID const *clsid = _ILGetGUIDPointer (pidl);
@@ -646,22 +646,33 @@
{
ERR("Pidl is not reg item!\n");
return E_INVALIDARG;
+ }
+
+ if (iColumn >= 3)
+ {
+ /* Return an empty string when we area asked for a column we don't support.
+ Only the regfolder is supposed to do this as it supports less columns
compared to other folder
+ and its contents are supposed to be presented alongside items that support
more columns. */
+ return SHSetStrRet(&psd->str, "");
}
switch(iColumn)
{
case 0: /* name */
return GetDisplayNameOf(pidl, SHGDN_NORMAL | SHGDN_INFOLDER,
&psd->str);
- case 1: /* comment */
+ case 1: /* comments */
HKEY hKey;
- if (HCR_RegOpenClassIDKey(*clsid, &hKey))
- {
- psd->str.cStr[0] = 0x00;
- psd->str.uType = STRRET_CSTR;
- RegLoadMUIStringA(hKey, "InfoTip", psd->str.cStr, MAX_PATH,
NULL, 0, NULL);
- RegCloseKey(hKey);
- return S_OK;
- }
+ if (!HCR_RegOpenClassIDKey(*clsid, &hKey))
+ return SHSetStrRet(&psd->str, "");
+
+ psd->str.cStr[0] = 0x00;
+ psd->str.uType = STRRET_CSTR;
+ RegLoadMUIStringA(hKey, "InfoTip", psd->str.cStr, MAX_PATH,
NULL, 0, NULL);
+ RegCloseKey(hKey);
+ return S_OK;
+ case 2: /* type */
+ //return SHSetStrRet(&psd->str, resource_id); /* FIXME: translate */
+ return SHSetStrRet(&psd->str, "System Folder");
}
return E_FAIL;
}