read configuration of hidden file extensions from registry

svn path=/trunk/; revision=7453
This commit is contained in:
Martin Fuchs 2004-01-04 21:23:08 +00:00
parent 42a645bad5
commit 73990aee98
3 changed files with 22 additions and 11 deletions

View file

@ -41,7 +41,7 @@ FONT 8, "Helv"
CONTROL "", 12298, "COMBOBOX", WS_GROUP | WS_VSCROLL | WS_VISIBLE | CBS_DISABLENOSCROLL | CBS_AUTOHSCROLL | CBS_DROPDOWN, 36, 37, 183, 100
DEFPUSHBUTTON "OK", IDOK, 62, 63, 50, 14, WS_TABSTOP
PUSHBUTTON "Löschen", IDCANCEL, 116, 63, 50, 14, WS_TABSTOP
PUSHBUTTON "&Schmökern...", 12288, 170, 63, 50, 14, WS_TABSTOP
PUSHBUTTON "&Suchen...", 12288, 170, 63, 50, 14, WS_TABSTOP
}
/* Namen der Header für die Shellviews */

View file

@ -19,7 +19,7 @@
*
* NOTES
* Nearly complete informations about the binary formats
* of .lnk files avaiable at http://www.wotsit.org
* of .lnk files available at http://www.wotsit.org
*
*/

View file

@ -602,22 +602,33 @@ void _FS_ProcessDisplayFilename(LPSTR szPath, DWORD dwFlags)
DWORD dwDataSize = sizeof (DWORD);
BOOL doHide = FALSE; /* The default value is FALSE (win98 at least) */
LPSTR ext = PathFindExtensionA(szPath);
if (ext) {
if (!strcasecmp(ext,".lnk") || !strcasecmp(ext,".url")) /*FIXME read from registry */
doHide = TRUE;
}
/* XXX should it do this only for known file types? -- that would make it even slower! */
/* XXX That's what the prompt says!! */
if (!doHide && !RegCreateKeyExA (HKEY_CURRENT_USER,
if (!RegCreateKeyExA (HKEY_CURRENT_USER,
"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
0, 0, 0, KEY_ALL_ACCESS, 0, &hKey, 0)) {
if (!RegQueryValueExA (hKey, "HideFileExt", 0, 0, (LPBYTE) & dwData, &dwDataSize))
doHide = dwData;
RegCloseKey (hKey);
}
if (!doHide) {
LPSTR ext = PathFindExtensionA(szPath);
if (ext) {
HKEY hkey;
char classname[MAX_PATH];
LONG classlen = MAX_PATH;
if (!RegQueryValueA(HKEY_CLASSES_ROOT, ext, classname, &classlen))
if (!RegOpenKeyA(HKEY_CLASSES_ROOT, classname, &hkey)) {
if (!RegQueryValueExA(hkey, "NeverShowExt", 0, NULL, NULL, NULL))
doHide = TRUE;
RegCloseKey(hkey);
}
}
}
if (doHide && szPath[0] != '.')
PathRemoveExtensionA (szPath);
}