i've been trying all night and I can't figure out how place this code:
Code:
strcpy (FilePath, DirPath);
strcat (FilePath, FindData.cFileName);
DeleteFile(FilePath); // or remove(FilePath);
into this code:
Code:
WIN32_FIND_DATA FindData;
HANDLE hFind;
hFind = FindFirstFile(SearchPath, // Search path is the directory/filemask you want
&FindData);
if (hFind != INVALID_HANDLE_VALUE)
{
// Do whatever you want with the first file
while(FindNextFile(hFind,&FindData))
{
// Do whatever with the next.. and so on
}
FindClose(hFind); // Close the find handle
}
else
{
// There wern't any files
}
Could you please help me out here.
Thanks