CALLBACK/CODEPTRADDRESS FunctionWindows

CODEPTR (or CALLBACK) will return the absolute address of a SUB or FUNCTION.

Syntax: CODEPTR(MySUB)

SUB MySUB
END SUB
A& = CODEPTR(MySUB)

Details:
Use this function for CALLBACK routines, i.e., when your program responds to Windows messages and calls your function).  Note - there is only ONE CALLBACK/CODEPTR allowed for each function that uses the same number of parameters.  So not all cases may be implemented unless you use caution. It cannot be set to a a virtual Sub/Function address like a virtual table in C/C++.

Examples:
FUNCTION One (A as LONG) AS LONG
....
END FUNCTION

FUNCTION Two (A as LONG, B as LONG) AS LONG
....
END FUNCTION

FUNCTION Two2 (A as LONG, B as LONG) AS LONG
....
END FUNCTION
In this case CODEPTR(One) is different from CODEPTR(Two)
BUT, the address of CODEPTR(Two) is the same as CODEPTR(Two2)  and only the last function declared is called! Since WndProc uses four parameters you can only have one WndProc per application:
pOldProc = SetWindowLong(Myhandle,GWL_WNDPROC, CODEPTR(Form.WndProc). 

There is a fix using the Callback forwarder code by Jacques Philip. 
See the function gRQ2_SetNewCallBack in RapidQ2 for examples on how to do this