I am using using Autohotkey, WINAPI & DllCall GetFileSizeEx function provided by @jNizM from here https://github.com/jNizM/AHK_DllCall_WinAPI/blob/master/src/File%20Management%20Functions/GetFileSizeEx.ahk, which I converted to V2.
Code: Select all
GetFileSizeEx(File)
{
static FileSize, static init := VarSetStrCapacity(&FileSize, 1048576)
if ((hFile := DllCall("kernel32.dll\CreateFile", "Str", File, "UInt", 0x80000000, "UInt", 1, "Ptr", 0, "UInt", 3, "UInt", 0, "Ptr", 0)) = -1 )
return DllCall("kernel32.dll\GetLastError")
if !(DllCall("kernel32.dll\GetFileSizeEx", "UInt", hFile, "Uint",&FileSize))
return DllCall("kernel32.dll\GetLastError")
FileSize := NumGet(FileSize, 0, "Int64*")
DllCall("kernel32.dll\CloseHandle", "UInt", hFile)
return FileSize
}
Can anyone help?