Réponse acceptée !
Salut,
"*.*" va te donner tous les fichiers presents dans le meme repertoire que ton prog il te suffit donc d'ajouter le path courant de ton exe avant la chaine presente dans cFileName..
Ex:
char szFilePath[MAX_PATH+4];
LPSTR lpFileName;
HANDLE hFind;
WIN32_FIND_DATA wFindData;
lpFileName = szFilePath + GetModuleFileName(0, szFilePath, MAX_PATH);
while(*lpFileName != '\\') lpFileName--;
lpFileName++;
hFind = FindFirstFile("*.*", &wFindData);
if(hFind == INVALID_HANDLE_VALUE) ;// Erreur
strcpy(lpFileName, wFindData.cFileName);
MessageBox(0, szFilePath, 0, 0x40);
while(FindNextFile(hFind, &wFindData))
{
strcpy(lpFileName, wFindData.cFileName);
MessageBox(0, szFilePath, 0, 0x40);
}
FindClose(hFind);
Neo_Fr
|