Look into the Windows API. If I remember right the directory functions have names like FindFirstFile, FindNextFile and so on.