Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
#include <windows.h>
...
const char p[] = "A:\\*.txt";
...
WIN32_FIND_DATA info;
HANDLE h;
if ((h = FindFirstFile(p,&info)) != INVALID_HANDLE_VALUE)
{
do
{
// Now file name C-string is in info.cFileName array
...
} while(FindNextFile(h,&info));
FindClose(h);
}
else ... // No such files.
class DirList {...}; // Invent file names collector.
...
int ScanDir(const char* dir, DirList& dl)
{
int n = 0; // Number of files scanned.
char* pattern = new char[_MAX_PATH];
// todo: Make dir\*.* pattern to scan ALL files and dirs
WIN32_FIND_DATA info;
HANDLE h;
if ((h = ... // see above
{
do
{
if (info.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)
{
// Make dir\info.cFileName in p (subdir name)
n += ScanDir(p,dl);
}
else if (it's a TEXT file - check info.cFileName)
{
++n;
dl.add(info.cFileName);
}
while (... see above);
... CloseHandle etc - see above
}
delete [] pattern;
return n;
}