filesize = GetFileSize(file, NULL);
file = CreateFile(filename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0);
DWORD filesize;
filesize = GetFileSize(file, NULL);
if(filesize != 0xFFFFFFFF) {
// do read or write of the file because you file is not empty
}