09-15-2022, 02:39 AM
(09-15-2022, 02:06 AM)eoredson Wrote: " I haven't checked but does this work in 64 bit or is this code 32 bit only as it currently stands? If it is 32 bit only then you'll need to adjust your TYPE definitions so it will work in 64."On 64-bit, some the fields which are "_UNSIGNED LONG" (32-bit) might have to be changed to "_UNSIGNED _INTEGER64". That is to match the function parameters of type "_OFFSET" which are going to be 64-bit pointers. Like I've noticed from part of the code below.
Could you be more specific when you meant to adjust your TYPE?
Erik.
Code: (Select All)
TYPE WIN32_FIND_DATAA
dwFileAttributes AS _UNSIGNED LONG
ftCreationTime AS FILETIME
ftLastAccessTime AS FILETIME
ftLastWriteTime AS FILETIME
nFileSizeHigh AS _UNSIGNED LONG
nFileSizeLow AS _UNSIGNED LONG
dwReserved0 AS _UNSIGNED LONG
dwReserved1 AS _UNSIGNED LONG
cFileName AS STRING * MAX_PATH
cAlternateFileName AS STRING * 14
END TYPE
' declare external libraries.
DECLARE DYNAMIC LIBRARY "kernel32"
FUNCTION DeleteFileA% (F$)
FUNCTION FindFirstFileA~%& (BYVAL lpFileName~%&, BYVAL lpFindFileData~%&)
FUNCTION FindNextFileA& (BYVAL hFindFile~%&, BYVAL lpFindFileData~%&)
FUNCTION FindClose& (BYVAL hFindFile~%&)
FUNCTION RemoveDirectoryA% (F$)
END DECLARE