LearnJoo
2007-11-10 21:58:08 UTC
Hi
in this Code below, what change should I make for searching sub folders
also?
AnsiString MyStr="*.txt";
ListBox1->Clear();
ListBox1->Items->Add("All Text Files");
HANDLE hFile = NULL;
WIN32_FIND_DATA wfs = {NULL};
hFile=FindFirstFile(MyStr.c_str(),&wfs);
do{
if(INVALID_HANDLE_VALUE == hFile){NULL;}
else{
ListBox1->Items->Add(wfs.cFileName);
}
}
while(FindNextFile(hFile,&wfs)!=false);
Plus ! I want to keep full path in Listbox,
waiting for a help
Thanks
in this Code below, what change should I make for searching sub folders
also?
AnsiString MyStr="*.txt";
ListBox1->Clear();
ListBox1->Items->Add("All Text Files");
HANDLE hFile = NULL;
WIN32_FIND_DATA wfs = {NULL};
hFile=FindFirstFile(MyStr.c_str(),&wfs);
do{
if(INVALID_HANDLE_VALUE == hFile){NULL;}
else{
ListBox1->Items->Add(wfs.cFileName);
}
}
while(FindNextFile(hFile,&wfs)!=false);
Plus ! I want to keep full path in Listbox,
waiting for a help
Thanks