Last active
September 21, 2023 16:54
-
-
Save user21944/77c062bf47600eba63cf76d3df0a7d26 to your computer and use it in GitHub Desktop.
winapi folders test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define WIN32_LEAN_AND_MEAN | |
#include <windows.h> | |
#include <stdio.h> | |
static int enter_directory(void) { | |
WIN32_FIND_DATA FindFileData; | |
HANDLE hFind = FindFirstFileA("./*", &FindFileData); | |
if (hFind == INVALID_HANDLE_VALUE) { | |
fputs("could not open directory\n", stderr); | |
return 1; | |
} | |
do puts(FindFileData.cFileName); while (FindNextFileA(hFind, &FindFileData)); | |
FindClose(hFind); | |
return 0; | |
} | |
int main(void) { | |
return enter_directory(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment