Since you mentioned the Win32 API you might consider GetFileSize or GetFileSizeEx.