- #define _WIN32_WINNT 0x0300
- #include <windows.h>
- #include <stdio.h>
- #include <string.h>
- #include <conio.h>
- #include <shlobj.h>
- #define PATH 0x104
- #include <shlwapi.h>
- #pragma comment(lib,"shlwapi.lib")
-
- WIN32_FIND_DATA FileData;
- HANDLE hSearch,fc;
- DWORD dwAttrs;
- BOOL fFinished = FALSE;
- HDC hdc;
- CONSOLE_SCREEN_BUFFER_INFO csbiInfo;
-
- char path[PATH];
- char buffer[0x64];
- char Buffer1[PATH];
- char Buffer[PATH];
- char szHome[PATH];
- char Result[PATH];
- char szNewPath[PATH];
- int x=0x00;
-
- void logo(){
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 0x0b);
- printf("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»\nº Example de couleur texte Conosle º\nº Votre nom de compagnie º\nº Adresse º\nº http://www.monsiteweb.com º\nÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ\n");
- }
-
- void ScanneFolder(char * dossier){
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 0x0a);
- hSearch = FindFirstFile("*.*", &FileData);
- if (hSearch == INVALID_HANDLE_VALUE) { printf("Aucun fichier trouv‚."); return;}
- while (!fFinished) {
- sprintf(szNewPath,"%s\\%s", dossier,FileData.cFileName); //chemin complet
- x++; //incremente valeur de x
- GetShortPathName(szNewPath,Buffer1,256);
- PathCompactPath(hdc,szNewPath,200); //compactage de texte pur n'afficher que 200 pixels
- printf("%.3d\t%s\t%s\n",x,szNewPath,Buffer1); // affiche le resultat
- if (!FindNextFile(hSearch, &FileData)) {
- if (GetLastError() == ERROR_NO_MORE_FILES) {
- printf("‚num‚ration termin‚e.");
- fFinished = TRUE;
- } else {
- printf("ERREUR: Impossible de trouver le fichier suivant .");
- return;
- }
- }
- }
- FindClose(hSearch);
- CloseHandle(fc);
- }
-
- int main(){
- logo();
- SetConsoleTitle("Titre de l'application");
- GetCurrentDirectory(256,szHome);
- ScanneFolder(szHome) ;
- Sleep(5000); //utile pour retarder la fermeture 1s =1000
- return 0;
- }
#define _WIN32_WINNT 0x0300
#include <windows.h>
#include <stdio.h>
#include <string.h>
#include <conio.h>
#include <shlobj.h>
#define PATH 0x104
#include <shlwapi.h>
#pragma comment(lib,"shlwapi.lib")
WIN32_FIND_DATA FileData;
HANDLE hSearch,fc;
DWORD dwAttrs;
BOOL fFinished = FALSE;
HDC hdc;
CONSOLE_SCREEN_BUFFER_INFO csbiInfo;
char path[PATH];
char buffer[0x64];
char Buffer1[PATH];
char Buffer[PATH];
char szHome[PATH];
char Result[PATH];
char szNewPath[PATH];
int x=0x00;
void logo(){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 0x0b);
printf("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»\nº Example de couleur texte Conosle º\nº Votre nom de compagnie º\nº Adresse º\nº http://www.monsiteweb.com º\nÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ\n");
}
void ScanneFolder(char * dossier){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 0x0a);
hSearch = FindFirstFile("*.*", &FileData);
if (hSearch == INVALID_HANDLE_VALUE) { printf("Aucun fichier trouv‚."); return;}
while (!fFinished) {
sprintf(szNewPath,"%s\\%s", dossier,FileData.cFileName); //chemin complet
x++; //incremente valeur de x
GetShortPathName(szNewPath,Buffer1,256);
PathCompactPath(hdc,szNewPath,200); //compactage de texte pur n'afficher que 200 pixels
printf("%.3d\t%s\t%s\n",x,szNewPath,Buffer1); // affiche le resultat
if (!FindNextFile(hSearch, &FileData)) {
if (GetLastError() == ERROR_NO_MORE_FILES) {
printf("‚num‚ration termin‚e.");
fFinished = TRUE;
} else {
printf("ERREUR: Impossible de trouver le fichier suivant .");
return;
}
}
}
FindClose(hSearch);
CloseHandle(fc);
}
int main(){
logo();
SetConsoleTitle("Titre de l'application");
GetCurrentDirectory(256,szHome);
ScanneFolder(szHome) ;
Sleep(5000); //utile pour retarder la fermeture 1s =1000
return 0;
}