1 2 3 4 5 6 7 8 9 10 11 12 | WIN32_FIND_DATA FindData; HANDLE FindHandle = FindFirstFile("*.*", &FindData); if (FindHandle != INVALID_HANDLE_VALUE) { do { // Process the file } while (FindNextFile(FindHandle, &FindData)); FindClose(FindHandle); } |
1 2 3 4 5 6 7 8 9 10 11 | HANDLE Handle; WIN32_FIND_DATA FindData; BOOL MoreFiles = TRUE; for (Handle = FindFirstFile(Pattern, &FindData); Handle != INVALID_HANDLE_VALUE && MoreFiles; MoreFiles = FindNextFile(Handle, &FindData)) { // Process the file } FindClose(Handle); |
1 2 3 4 5 6 7 | WIN32_FIND_DATA FindData; for (HANDLE Handle = FindFirstFile(Pattern, &FindData); Handle != INVALID_HANDLE_VALUE; Handle = FindNextFile(Handle, &FindData) ? Handle : FindClose(Handle), INVALID_FILE_HANDLE) { // ... } |