Find all directories and make sure found entries are directories

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2666 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2003-06-22 13:44:02 +00:00
parent 63a1f7a0e3
commit 9adf1acb50
2 changed files with 19 additions and 12 deletions

View file

@ -334,20 +334,27 @@ void AddFolderFromReg(HKEY rootKey)
RegCloseKey(hKey); RegCloseKey(hKey);
} }
lstrcat(buf, "\\*."); lstrcat(buf, "\\*.*");
hSearch = FindFirstFile(buf, &FileData); hSearch = FindFirstFile(buf, &FileData);
if (hSearch != INVALID_HANDLE_VALUE) do if (hSearch != INVALID_HANDLE_VALUE)
{ {
if (*(WORD*)FileData.cFileName != *(WORD*)".") do
{ {
if (*(WORD*)FileData.cFileName != *(WORD*)".." || FileData.cFileName[2]) if (FileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
{ {
if (SendMessage(hwDirList, LB_FINDSTRINGEXACT, -1, (LPARAM)FileData.cFileName) == LB_ERR) if (*(WORD*)FileData.cFileName != *(WORD*)".")
SendMessage(hwDirList, LB_ADDSTRING, 0, (LPARAM)FileData.cFileName); {
/*idx = */ if (*(WORD*)FileData.cFileName != *(WORD*)".." || FileData.cFileName[2])
/*SendMessage(hwDirList, LB_SETITEMDATA, (WPARAM)idx, {
(LPARAM)ExtractAssociatedIcon(g_hInstance, FileData.cFileName, (WORD*)&idx));*/ if (SendMessage(hwDirList, LB_FINDSTRINGEXACT, -1, (LPARAM)FileData.cFileName) == LB_ERR)
} SendMessage(hwDirList, LB_ADDSTRING, 0, (LPARAM)FileData.cFileName);
} /*idx = */
} while (FindNextFile(hSearch, &FileData)); /*SendMessage(hwDirList, LB_SETITEMDATA, (WPARAM)idx,
(LPARAM)ExtractAssociatedIcon(g_hInstance, FileData.cFileName, (WORD*)&idx));*/
}
}
}
} while (FindNextFile(hSearch, &FileData));
FindClose(hSearch);
}
} }

Binary file not shown.