I have doubts whether FtpOpenFile function should be used at all.
Below is the link to a working code sample. The InternetReadFile API function is called in cycle each time reading a small portion of the remote file. Which makes a progress routine possible.
Using InternetSetFilePointer when resuming interrupted download from the Internethttp://www.news2news.com/vfp/?example=191API functions used:
CloseHandle
CreateFile
GetFileSize
InternetCloseHandle
InternetOpen
InternetOpenUrl
InternetReadFile
InternetSetFilePointer
OpenFile
SetFilePointer
WriteFile
pcRemotePath = "http://www.php.net/distributions/manual/"
pcFilename = "php_manual_es.chm"
...
phRemote = InternetOpenUrl (hInternet, pcRemotePath + pcFilename,;
"", 0, INTERNET_FLAG_NEED_FILE, 0)
...
IF InternetReadFile (phRemote, @lcBuffer,;
TransferBuffer, @lnBytesRead) <> 0
...
ENDIF