In fact I did not use any API functions. It is done by couple lines of simple code, that you can see below. This code I used to use in my App
FRX2ANY.ZIP in order to extract BMP image from Gen field into file. If you will find something that can be improved, let me know.
Best wishes
*****************************************************************************
LPARAMETERS tcGenFldName
LOCAL lnInHandle
LOCAL lnOutHandle
LOCAL lnFileLen
LOCAL lcTmpFile
LOCAL lcBmpFile
LOCAL lcString
LOCAL loResult
LOCAL lcOldComp
lcTmpFile = ADDBS(SYS(2023)) + SYS(2015)
lcBmpFile = ADDBS(THIS.cReportPath) + SYS(2015) + '.BMP'
COPY TO (lcTmpFile) FIELDS (tcGenFldName) NEXT 1
lnInHandle = FOPEN(lcTmpFile + '.FPT')
lnOutHandle = FCREATE(lcBmpFile)
IF lnInHandle >0 AND lnOutHandle > 0
lnFileLen = FSEEK(lnInHandle, 0, 2)
= FSEEK(lnInHandle, 0)
lcString = FREAD(lnInHandle, lnFileLen)
lcString = RIGHT(lcString, LEN(lcString) - 599)
=FWRITE(lnOutHandle, lcString)
ELSE
lcBmpFile = ''
ENDIF
=FCLOSE(lnInHandle)
=FCLOSE(lnOutHandle)
IF FILE(lcTmpFile + '.FPT')
DELETE FILE (lcTmpFile + '.*')
ENDIF
RETURN lcBmpFile
******************************************************************************