title: recursive file search
body: <p>I'm trying to figure out how to work this thing out .. For some reason, it ends at a certain point.. I'm not very good at recursion and I'm sure the problem lies somewhere there.. </p>
  
  <p>Also, even if I checked for cFileName != "..", it still shows up at the end, not sure why but the "." doesn't show up anymore.. </p>
  
  <pre><code>void find_files( wstring wrkdir )
  {
      wstring temp;
  
      temp = wrkdir + L"\\" + L"*"; 
      fHandle = FindFirstFile( temp.c_str(), &amp;file_data );
  
      if( fHandle == INVALID_HANDLE_VALUE )
      {
           return;
      }
      else 
      { 
          while( FindNextFile( fHandle, &amp;file_data ) ) 
          {
              if( file_data.dwFileAttributes == FILE_ATTRIBUTE_DIRECTORY &amp;&amp;
                  wcscmp(file_data.cFileName, L".") != 0 &amp;&amp; 
                          wcscmp(file_data.cFileName, L"..") != 0 )
              {
                  find_files( wrkdir + L"\\" + file_data.cFileName  );
              }
              else if( file_data.dwFileAttributes != FILE_ATTRIBUTE_HIDDEN &amp;&amp; 
                   file_data.dwFileAttributes != FILE_ATTRIBUTE_SYSTEM  )
              {
                  results &lt;&lt; wrkdir &lt;&lt; "\\" &lt;&lt; file_data.cFileName &lt;&lt; endl;
              }
          }
      }
  }
  </code></pre>
  
  <p>After changing those, the program doesn't enumerate the remaining files left.. </p>
  
  <p>For example, if there is a sub folder named test, it enumerates everything inside test but doesn't finish enumerating the files inside the original directory specified.</p>