Skip to content

Instantly share code, notes, and snippets.

@user21944
Last active September 21, 2023 16:54
Show Gist options
  • Save user21944/77c062bf47600eba63cf76d3df0a7d26 to your computer and use it in GitHub Desktop.
Save user21944/77c062bf47600eba63cf76d3df0a7d26 to your computer and use it in GitHub Desktop.
winapi folders test
#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