I'm using C++ with Windows 7. I'm trying FindFirstFile by time, and I want to find a file that is less than 20 seconds old. I have the find part I think, but I am having difficulty doing it by time. any help is appreciated. Thanks.
HANDLE hFile;
LPFILETIME lpCreationTime,
lpLastAccessTime,
lpLastWriteTime;
// Find the file.
hFile = FindFirstFile( *.txt,
GENERIC_READ,
0, NULL, OPEN_ALWAYS,
FILE_ATTRIBUTE_NORMAL, NULL );
GetFileTime(hFile, lpCreationTime <= currenttime);
DeleteFile(*.txt);
CloseHandle(hFile);
HANDLE hFile;
LPFILETIME lpCreationTime,
lpLastAccessTime,
lpLastWriteTime;
// Find the file.
hFile = FindFirstFile( *.txt,
GENERIC_READ,
0, NULL, OPEN_ALWAYS,
FILE_ATTRIBUTE_NORMAL, NULL );
GetFileTime(hFile, lpCreationTime <= currenttime);
DeleteFile(*.txt);
CloseHandle(hFile);