GetLastError returns ERROR_FILE_NOT_FOUND, although the folder contains files that fall under the mask. What is the problem? I would be grateful for the help!
#include <windows.h> #include <stdio.h> LPWSTR fileName = L"*.exe"; LPWIN32_FIND_DATAW data32; HANDLE fileHandle; int main(){ fileHandle = FindFirstFileW(fileName, data32); printf("%08x\n", GetLastError()); if(fileHandle != 0){ while(FindNextFileW(fileHandle, data32)){ MessageBoxW(0, data32->cFileName, L"File Found!", 0); } } FindClose(fileHandle); system("pause"); return 0; }
Debug*.exe, butDebug\*.exe. And in general, the path should always be indicated. - freim 4:05 pm