Tag Archives: winapi

Find files in a file directory

If you want to open or read files in a file directory you can use the following example to find the filenames.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
  static void showFileName(Args _args)
  {
      int           handle;
      FilePath      filePath;
      FileName      FileName;
      ;
 
      filepath = "c:\\windows";
 
      [handle,filename] = 
       WinAPI::findFirstFile(filepath + "\\*.*");
 
      while (filename != "")
      {
          info(filepath + "\\" + filename);
          filename = WinAPI::findNextFile(handle);
      }
 
      WinAPI::findClose(handle);
  }