Author: akhaldi Date: Sat Mar 14 12:18:33 2015 New Revision: 66689
URL: http://svn.reactos.org/svn/reactos?rev=66689&view=rev Log: [SHELL32] Show/Hide hidden files/folders through registry. By Lee Schroeder. CORE-9207
Modified: trunk/reactos/boot/bootdata/hivedef.inf trunk/reactos/dll/win32/shell32/CDefView.cpp
Modified: trunk/reactos/boot/bootdata/hivedef.inf URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/hivedef.inf?r... ============================================================================== --- trunk/reactos/boot/bootdata/hivedef.inf [iso-8859-1] (original) +++ trunk/reactos/boot/bootdata/hivedef.inf [iso-8859-1] Sat Mar 14 12:18:33 2015 @@ -1842,6 +1842,7 @@ HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced","ListviewShadow",0x00010001,0x00000001 HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced","HideFileExt",0x00010001,0x00000000 HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced","StartMenuLogoff",0x00010001,0x00000001 +HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced","Hidden",0x00010003,1
; default shell HKCU,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon",,0x00000012
Modified: trunk/reactos/dll/win32/shell32/CDefView.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CDefView.... ============================================================================== --- trunk/reactos/dll/win32/shell32/CDefView.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/CDefView.cpp [iso-8859-1] Sat Mar 14 12:18:33 2015 @@ -860,16 +860,34 @@ HRESULT CDefView::FillList() { CComPtr<IEnumIDList> pEnumIDList; - PITEMID_CHILD pidl; - DWORD dwFetched; - HRESULT hRes; - HDPA hdpa; + PITEMID_CHILD pidl; + DWORD dwFetched; + HRESULT hRes; + HDPA hdpa; + HKEY hKey; + DWORD dFlags = SHCONTF_NONFOLDERS | SHCONTF_FOLDERS;
TRACE("%p\n", this);
- /* get the itemlist from the shfolder*/ - /* FIXME: make showing hidden files a setting. */ - hRes = m_pSFParent->EnumObjects(m_hWnd, SHCONTF_NONFOLDERS | SHCONTF_FOLDERS | SHCONTF_INCLUDEHIDDEN, &pEnumIDList); + /* determine if there is a setting to show all the hidden files/folders */ + if (RegOpenKeyExW(HKEY_CURRENT_USER, L"Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", 0, KEY_QUERY_VALUE, &hKey) == ERROR_SUCCESS) + { + DWORD dataLength, flagVal; + + dataLength = sizeof(flagVal); + if (RegQueryValueExW(hKey, L"Hidden", NULL, NULL, (LPBYTE)&flagVal, &dataLength) == ERROR_SUCCESS) + { + /* if the value is 1, then show all hidden files/folders */ + if (flagVal == 1) + dFlags |= SHCONTF_INCLUDEHIDDEN; + } + + /* close the key */ + RegCloseKey(hKey); + } + + /* get the itemlist from the shfolder */ + hRes = m_pSFParent->EnumObjects(m_hWnd, dFlags, &pEnumIDList); if (hRes != S_OK) { if (hRes == S_FALSE)