>I thought of you when a ProFox list buddy asked this question.
>
>He wants to add a choice to the Explorer right-click menu which will bring up VFP with the PRG file open and ready to edit.
>
>I can add the "Edit" choice to the right-click menu through the Folder Options. I can make "Edit" run VFP, but it comes up with the chosen PRG file running - not ready to edit.
>
>I can also add the "Edit" choice to the right-click menu and make it bring up Notepad with the PRG file open and ready to edit.
>
>It looks like I need to put the correct little codes in the place where it says DDE Message and has Open("%1") (which runs, not opens.)
AFAIK, there's no default DDE access to the editor, but what I do works well enough. I create a tiny .PRG that gets dropped in the VFP home directory:
LPARAMETER cFileToEdit
IF TYPE('cFileToEdit') = 'C' AND FILE(cFileToEdit)
MODI COMM (cFileToEdit) NOWAIT
ENDIF
In the registry, I add the following to have VFP open the file:
"D:\Program Files\Microsoft Visual Studio\VFP98\VFP6" "D:\Program Files\Microsoft Visual Studio\VFP98\TinyEdit" "%1"
Substitute the actual path for VFP for
Program Files\Microsoft Visual Studio\VFP98\ on your target system.
This will start a copy of VFP, firing up TinyEdit.PRG against the file you right-clicked. Each time it starts a new instance of VFP, where DDE access would rely on an existing copy of VFP that was running to start the edit session if it were accessible through DDE. You could also create an alternative DDE server, but it's more effort than it's worth from my POV.
My actual TinyEdit is a bit more complex than this, since I check to see if there's anything that needs to be run in my developer configuration; for me, this means assigning some my standard work environment and initializing SDT, which I check for in the registry. This makes my TinyEdit not so tiny, the one above works fine.