Windows API help with CopyFileExA() and Callback to show Progress

I’ve only used copyfileA in some template Dll’s to move files around so far, but I can see CopyFileEx has the same two parameters as CopyFileA

BOOL CopyFileExA(
  [in]           LPCSTR             lpExistingFileName,
  [in]           LPCSTR             lpNewFileName,

CopyFileA function (winbase.h) - Win32 apps | Microsoft Docs

BOOL CopyFileA(
  [in] LPCSTR lpExistingFileName,
  [in] LPCSTR lpNewFileName,

some hints
lp = Long Pointer which is a Long in Clarion.
another way of expressing a long point is to use the *before the data type, most will be familiar with *cstring as a parameter, but you could do *long, and others.
It boils down to do you want clarion to do this for you
Loc:Address1 long
Loc:Address2 long
Loc:Bool bool
Loc:ReturnValueBool bool
Loc:Cstring1 cstring(1000)
Loc:Cstring2 cstring(1000)
Loc:ReturnValueBool = CopyFileA(Loc:Address1,Loc:Address2,Loc:Bool)
Peek(loc:Address1,Loc:cstring1)
Peek(loc:Address2,Loc:cstring2)

TLDR * = Peek(LongPointer,DestinationVariable)

As this is attached to a Cstr
[MS-DTYP]: LPCSTR | Microsoft Docs

its a CONST in the clarion parameter and it say in the description its a null terminated string of ansi characters. So as its null terminated you would need to use a Clarion cstring as that is also null terminated.

So you have two ways to do the api prototype in Clarion
CopyFileA(long,long,bool),Bool,Pascal,Name(‘CopyFileA’)
or
CopyFileA(CONST *cstring, CONST *cstring,bool),bool,Pascal,Name(‘CopyFileA’)
In clarion CONST tells clarion the parameter being passed by address can not be changed, its treated as a read only a parameter. However you can leave the CONST out of the prototype so it looks like this
CopyFileA(*cstring, *cstring,bool),bool,Pascal,Name(‘CopyFileA’)

Personally I’d get copyFileA working first and then try the CopyFileExA.

Common windows data types can be found here
[MS-DTYP]: Common Data Types | Microsoft Docs

Common windows base types can be found here
[MS-DTYP]: Common Base Types | Microsoft Docs
so it should be possible to work out what data type you need or group structure you need to make if you are getting into 64bit territory.

and for callbacks, this might help you

fwiw.