#include <windows.h> void __fastcall TForm1::Button1Click(TObject *Sender)
{
char acPath[MAX_PATH];
DWORD dwSize = 0;
GetModuleFileName(NULL,acPath, sizeof(acPath)/sizeof(char));
FILETIME CreationTime; // address of creation time
FILETIME LastAccessTime; // address of last access time
FILETIME LastWriteTime; // address of last write time
HANDLE hFile = CreateFile("C:\\1.xlsx", GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
GetFileTime(hFile, &CreationTime, &LastAccessTime, &LastWriteTime);
dwSize = GetFileSize(hFile,NULL);
CloseHandle(hFile);
SYSTEMTIME st;
FileTimeToSystemTime(&CreationTime,&st);
char acMsgText[1024];
wsprintf(acMsgText,"Year: %d Month: %d Day: %d HH:MM:SS %d:%d:%d Size:%d",
st.wYear,st.wMonth,st.wDay,st.wHour,st.wMinute,st.wSecond,dwSize);
//MessageBox(NULL,acMsgText,"The time is", MB_OK);
ShowMessage(dwSize);
}