#include <iostream>
#include <stdlib.h>
#include <windows.h>
using namespace std;
void Szukaj(char *curdir)
{
WIN32_FIND_DATA wfd;
BOOL IsFile = TRUE;
HANDLE hFile;
char path[200];
SetCurrentDirectory(curdir);
hFile = FindFirstFile("*.*", &wfd);
while (IsFile)
{
char *sstr;
GetFullPathName(wfd.cFileName, 199, path, NULL);
if ((wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) && (wfd.cFileName[0] != '.'))
Szukaj(path);
if (!(wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) &&((sstr = strstr(path, "SzukanyPlik"))))
cout << path << endl;
IsFile = FindNextFile(hFile, &wfd);
}
if (curdir[0] > 3)
SetCurrentDirectory("..");
}
int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int nCmdShow)
{
Szukaj("C:\\");
system("PAUSE");
return 0;
}
Gdzie tutaj jest błąd? Program się zawiesza.