Write an application that can browse directories, run any EXE file and forcibly close it after the time specified by the user. I can't find files with exe extension
String S; //Структура описывает файл WIN32_FIND_DATA FindFileData; //дескриптор потока HANDLE hf=FindFirstFile((Form5->Edit2->Text).c_str(), &FindFileData);//путь указываем где искать INT i=0; if (hf==INVALID_HANDLE_VALUE) { ShowMessage("Папка не найдена"); return 1; } do { if (strstr((char*)FindFileData.cFileName,".exe") != NULL)//не работает условие..файлы есть но не находит { S=Form5->ListBox1->Items->Strings[Form5->ListBox1->ItemIndex]; ShowMessage("Нашел"); } } while (FindNextFile(hf, &FindFileData)); FindClose(hf); The condition if (strstr((char*)FindFileData.cFileName,".exe") != NULL) does not work, although there are files.