0 Members and 1 Guest are viewing this topic.
/* FindFiles Dev_c++ example by Rbraz*/#include <windows.h>#include <winbase.h>#include <iostream>using namespace std;void FindFiles(char *path){ WIN32_FIND_DATA fileinfo; // file information struct HANDLE search = FindFirstFile(path, &fileinfo); if(INVALID_HANDLE_VALUE == search) return; do { cout << "FileName = " << fileinfo.cFileName << endl; // Here you can do whatever you want with "fileinfo.cFileName" (display. save etc...) } while (FindNextFile(search, &fileinfo)); FindClose(search);}int main(int argc, char *argv[]){ FindFiles("*"); // Search in the same path of your executable // FindFiles("c:\\*"); // Search in another path system("PAUSE"); return EXIT_SUCCESS;}