Facebook
From Innocent Pelican, 3 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 50
  1. #include <Windows.h>
  2. #include <iostream>
  3. #include <tchar.h>
  4.                 int _tmain(int argc, TCHAR * argv[]) {
  5.                         WIN32_FIND_DATA x;
  6.                         SYSTEMTIME sTime;
  7.                         HANDLE h = FindFirstFile(_T(".*"), &x);
  8.                         std::wcout << "First file is: " << x.cFileName << " :: ";
  9.                         std::wcout << x.nFileSizeLow << " :: ";
  10.                         FileTimeToSystemTime(&x.ftCreationTime, &sTime);
  11.                         std::cout << sTime.wHour << ":" << sTime.wMinute << ":" << sTime.wSecond << std::endl;
  12.  
  13.                         while (FindNextFile(h, &x) != 0)
  14.                         {
  15.                                 std::wcout << "Next file is: " << x.cFileName << " :: ";
  16.                                 std::wcout << x.nFileSizeLow << " :: ";
  17.                                 FileTimeToSystemTime(&x.ftCreationTime, &sTime);
  18.                                 std::cout << sTime.wHour << ":" << sTime.wMinute << ":" << sTime.wSecond << std::endl;
  19.                         }
  20.                         FindClose(h);
  21.                         return 0;
  22.                 }
  23.  
  24.         }
  25.         FindClose(h);
  26.  
  27.         return 0;
  28. }