In addition to Geoff's solution, from VFP 6 forward, you can address an open project as an object and it has a Files collection:
oProj = _VFP.ActiveProject
FOR EACH oFile IN oProj.Files
IF oFile.Type = "P"
* This is a prg.
?oFile.Name && includes the path, but you could parse it
ENDIF
ENDFOR
Obviously, you can do a lot more than just print out the name.
Tamar