Ver Mensaje Individual
  #4  
Antiguo 03-12-2013
Avatar de ecfisa
ecfisa ecfisa is offline
Moderador
 
Registrado: dic 2005
Ubicación: Tres Arroyos, Argentina
Posts: 10.508
Reputación: 36
ecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to behold
Hola andres_89.

Creo que ahora entendí la idea... Fijate si te sirve de este modo:
Código:
#include <io.h>
#include <dir.h>

TStrings *FileNames;
int Contador=0;

void ListFiles(char *Dir, TStrings *TS)
{
  struct _finddata_t fdt;
  long hFile;
  char tmp[MAX_PATH];

  chdir(Dir);
  fdt.attrib = _A_SUBDIR;
  if ((hFile = _findfirst("*.*", &fdt) ) != -1) {
    do {
      if (fdt.attrib == _A_SUBDIR) {
        if (strcmp(fdt.name,".")!= 0 && strcmp(fdt.name,"..") != 0) {
          strcpy(tmp, Dir);
          strcat(tmp, "\\");
          strcat(tmp, fdt.name);
          ListFiles(tmp, TS);
        }
      }
      else
        TS->Add(String(fdt.name));
    } while (_findnext(hFile, &fdt) == 0);
    _findclose(hFile);
  };
}

void __fastcall TForm1::FormCreate(TObject *Sender)
{
  FileNames = new TStringList;

  ListFiles("C:\\UNA_CARPETA", FileNames);
  Timer1->Enabled = false;
  Timer1->Interval = 250;
}

void __fastcall TForm1::Button1Click(TObject *Sender)
{
  Timer1->Enabled = true;
}

void __fastcall TForm1::Timer1Timer(TObject *Sender)
{
  Timer1->Enabled = (Contador < FileNames->Count);
  if (Timer1->Enabled) {
    Label1->Caption = FileNames->Strings[Contador];
    Contador++;
  }
}

void __fastcall TForm1::FormDestroy(TObject *Sender)
{
  delete FileNames;
}
Saludos
__________________
Daniel Didriksen

Guía de estilo - Uso de las etiquetas - La otra guía de estilo ....
Responder Con Cita