>>I'm not quite sure if it will let you do that
Heres a program i have that does it. Its a few months old so ignore the comments lol.
Code:
#include <iostream>
#include <windows.h>
#include <string>
#include <stdlib.h>
using namespace std;
int find_files();
/* Define our STD's*/
using std::string;
using std::cout;
using std::cin;
using std::endl;
int main(int argc,char** argv)
{
find_files();
system("pause");
return 0;
}
int find_files()
{
/* Holds information found*/
WIN32_FIND_DATA wfd;
/* Holds directory*/
string str,extension;
str = "";
/* Counts files found*/
int i = 0;
/* Prompt user for directory*/
cout<< "Enter Directory: ";
cin>>str;
cout<< "Enter the extentions type in format: *.ext* and press enter: ";
cin>>extension;
extension = "\\" + extension;
/* Outout empty line*/
cout<<"\n";
/* Indicates we want mp3 files*/
str += extension;
/* Find first file*/
HANDLE hFile = FindFirstFile(str.c_str(),&wfd);
/* Aborts on error*/
if(hFile ==INVALID_HANDLE_VALUE)
{
cout<<"No files found or invalid directory\n";
return 1;
}
do
{
/* out files*/
cout<<wfd.cFileName<<endl;
/* Increment counter*/
i++;
}
/* Get the rest of the files*/
while(FindNextFile(hFile,&wfd));
/* Output # of found files*/
cout<<"\nFound "<<i<<" Files.\n"<<endl;
/* Clean up*/
FindClose(hFile);
return 0;
}