You can call GetFirstFile(), then GetNextFile() in a loop to read all the files. The sndplay sample project (..\CVI\samples\sdk\audio\sndplay.prj) that ships with CVI has the following function.
/*---------------------------------------------------------------------------*/
/* Fill in the listbox with all of the sound files in the given directory. */
/*---------------------------------------------------------------------------*/
int FillListBoxWithWavsInDir(int panel, int listbox, char *directory)
{
char fileSpec[MAX_PATHNAME_LEN];
char fileName[MAX_FILENAME_LEN];
char fullPath[MAX_PATHNAME_LEN];
ClearListCtrl (panel, listbox);
MakePathname (directory, "*.wav", fileSpec);
if (GetFirstFile (fileSpec, 1, 0, 0, 0, 0, 0, fileName) == 0)
{
do
{
MakePathname (directory, fileName, fullPath);
InsertListItem (panel, listbox, -1, fileName, fullPath);
}
while (GetNextFile (fileName) == 0);
}
return 0;
}
For the CVI menu, goto Library >> Utility >> File Utilities (with flatten not selected).