AnsiString Dir="C:\\Test"
WIN32_FIND_DATA FindFileData;
HANDLE hFind = INVALID_HANDLE_VALUE;
char DirSpec[MAX_PATH + 1];
DWORD dwError;
strncpy (DirSpec, Dir.c_str(), Dir.Length()+1);
strncat (DirSpec, "\\*", 3);
hFind = FindFirstFile(DirSpec, &FindFileData);
if(hFind != INVALID_HANDLE_VALUE)
{do
if(FindFileData.dwFileAttributes==FILE_ATTRIBUTE_DIRECTORY)
{String Name=FindFileData.cFileName;
ShowMessage(Name);}
while (FindNextFile(hFind, &FindFileData)!=0);
FindClose(hFind);}