Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how to make a .prg file modify instead of run

444 views
Skip to first unread message

LenB

unread,
Jan 6, 2002, 10:46:38 PM1/6/02
to
Hi all.
I am using VFP6, sp5. If I double click a .prg file in a Windows Explorer
window, VFP opens and _runs_ the program. I would like it to open the
program for editing instead. In Tools..Options..Projects I have "Project
Doubleclick Action" set to modify the file, but this seems to only affect
the Project Manager. In Explorer, View..Folder Options I see that .prg
files have an "open" action with "Use DDE" selected. Under DDE Message is
open("%1"). I tried changing that to edit("%1") and a few other creative
things but no go. Any ideas? A list of DDE Messages available maybe?

Thanks for any help.
Len


Fred Taylor

unread,
Jan 7, 2002, 2:38:04 AM1/7/02
to
VFP7 opens in edit mode and in the registry, it's listed this way:

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Applications\vfp7.exe\shell\open\command
="C:\Program Files\Microsoft Visual FoxPro 7\vfp7.exe" -SHELLOPEN "%1"

--

Fred
Microsoft Visual FoxPro MVP
Please respond only to the newsgroups so that all may benefit.

"LenB" <nor...@anywhere.com> wrote in message
news:eVih25ylBHA.2212@tkmsftngp05...

Jim Livermore

unread,
Jan 7, 2002, 4:35:34 AM1/7/02
to
And this has what to do with VFP6? Seriously, I'd like the answer to
this also.

--
Jim Livermore
J & J Electronics
These opinions are my own and that of the company - I am the company.
For targeting purposes: Lat: 42° 32' 34" N Lon: 75° 53' 42" W

David Dunetz

unread,
Jan 7, 2002, 10:18:12 AM1/7/02
to
Interesting. On my machine there is no such registry entry and VFP7 opens in
edit mode when I double click a PRG file.
--
David Dunetz
SweetWARE

"Fred Taylor" <fta...@mvps.org> wrote in message
news:efsWA40lBHA.396@tkmsftngp02...

Fred Taylor

unread,
Jan 7, 2002, 10:31:33 AM1/7/02
to
The registry key for VFP6 is similar, but it only has "-SHELL" at the end
not the "-SHELLOPEN". Since I'm not going to go through the cycle of VFP6/7
re-registration, only VFP7 kicks off when a .PRG is double clicked in
Explorer. Do these do things differently? I don't know, I can't test it.

--

Fred
Microsoft Visual FoxPro MVP
Please respond only to the newsgroups so that all may benefit.

"Jim Livermore" <jje...@odyssey.net> wrote in message
news:3C396BE6...@odyssey.net...

Fred Taylor

unread,
Jan 7, 2002, 10:33:13 AM1/7/02
to
Strange. What do you have for a registry entry then? And if you don't have
one, why not? I certainly didn't manually add it, the installation program
must have put it there.
--

Fred
Microsoft Visual FoxPro MVP
Please respond only to the newsgroups so that all may benefit.

"David Dunetz" <da...@sweetware.com> wrote in message
news:#dF6M94lBHA.1868@tkmsftngp03...

Jim Livermore

unread,
Jan 7, 2002, 11:06:45 AM1/7/02
to
Yep, after your post I explored a bit and saw the related keys. Being
registry challenged, I didn't try to mimic VFP7's key. I also
experimented with the file associations, creating an "Edit" and what are
best guesses for the rest. Best I can get out of VFP6 so far is
"Program.prg does not exist". What does your system show under
Tools|Folder Options|File Types (or whatever for your OS) for Visual
Fxopro Program? Maybe we can work this backwards.

Fred Taylor

unread,
Jan 7, 2002, 11:27:47 AM1/7/02
to
I try to avoid the registry myself. <bg>

OK, using the Tools/Folder Options what I see for .PRG for the Action open
is (W2K):

"C:\Program Files\Microsoft Visual FoxPro 7\vfp7.exe" -SHELLOPEN "%1"

Use DDE is checked
DDE Message: Open("%1")
Application: FoxPro
DDE Application Not Running:
Topic: System

For Action print:
"C:\Program Files\Microsoft Visual FoxPro 7\vfp7.exe" -SHELLPRINT "%1"
DDE Message: Print("%1")

For Action printto:
"C:\Program Files\Microsoft Visual FoxPro 7\vfp7.exe" -SHELLPRINTTO "%1"
DDE Message: SetPrinter("%2")Print("%1")

For Action Run:
"C:\Program Files\Microsoft Visual FoxPro 7\vfp7.exe" -SHELLRUN "%1"
Use DDE is not checked


Whether VFP6 can respond to these same actions or not, I don't know, as it's
never been a concern to me before.
--

Fred
Microsoft Visual FoxPro MVP
Please respond only to the newsgroups so that all may benefit.


"Jim Livermore" <jje...@odyssey.net> wrote in message

news:3C39C795...@odyssey.net...

David Dunetz

unread,
Jan 7, 2002, 11:45:41 AM1/7/02
to
The registry entry on Win98 is

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\VisualFoxPro.Application.7\shell\open\co
mmand

And the default data is

"C:\Program Files\Microsoft Visual FoxPro 7\vfp7.exe" -SHELLOPEN "%1"

The DDE actions in the Folder Options for Win98 are the same as you
described in the other message thread.
--
David Dunetz
SweetWARE

"Fred Taylor" <fta...@mvps.org> wrote in message

news:OpkjgB5lBHA.2212@tkmsftngp02...

Fred Taylor

unread,
Jan 7, 2002, 12:15:00 PM1/7/02
to
That entry is also in W2K. Sigh, I wish I understood just what the registry
was really trying to accomplish. There seems to be an afwul lot of
redundant things in there. My guess would be this entry is for Automation
(oFox = CREATEOBJECT("VisualFoxPro.Application").
--

Fred
Microsoft Visual FoxPro MVP
Please respond only to the newsgroups so that all may benefit.


"David Dunetz" <da...@sweetware.com> wrote in message

news:e4cFJu5lBHA.2188@tkmsftngp03...

Jim Livermore

unread,
Jan 7, 2002, 12:19:55 PM1/7/02
to
Well, I'm agonna find out. Stand by for a reinstall :>)

Jim Livermore

unread,
Jan 7, 2002, 12:44:06 PM1/7/02
to
Ugh. Well, not too much damage and I was able to recover somewhat. Looks
like some smarts were added to the VFP7 loader. No matter what I try,
VFP6 just bitches about can't find (pickone).prg and still runs the
.prg. Sigh. Another reason to upgrade? :>)

Jim Livermore wrote:
>
> Well, I'm agonna find out. Stand by for a reinstall :>)
>

--

Fred Taylor

unread,
Jan 7, 2002, 1:33:09 PM1/7/02
to
You, sir, are a far braver soul than I. Glad it wasn't too painful. <s>

And yes, it would be a good time to upgrade. Lots of cool things in VFP7
that I'd have a hard time living without.
--

Fred
Microsoft Visual FoxPro MVP
Please respond only to the newsgroups so that all may benefit.

"Jim Livermore" <jje...@odyssey.net> wrote in message

news:3C39DE66...@odyssey.net...

David Dunetz

unread,
Jan 7, 2002, 2:02:34 PM1/7/02
to
Actually the automation information is listed in at least 2 other places.
First Windows has to find the ClassID from the ProgId supplied by
CreateObject(), then it looks up the ClassID to get the other information it
needs (such as threading model, etc.)

If you are interested I can dig up the exact keys where this information is
stored.
--
David Dunetz
SweetWARE

"Fred Taylor" <fta...@mvps.org> wrote in message

news:ulayX65lBHA.1644@tkmsftngp05...

LenB

unread,
Jan 7, 2002, 3:32:25 PM1/7/02
to
Thanks for all the help guys. After reading your responses, I tried several
different things. Some other new things I have learned.
In a dos window in the folder with vfp6.exe, if I type vfp6.exe -SHELL
c:\data\test\text.prg , it opens a new instance of VFP and runs the program.
If I leave out the -SHELL, it reuses an existing instance if one is open.
Taking the -SHELL out of the "File Types..." dialog makes no difference. It
always reuses an existing instance, making me think it isn't recognizing
the -SHELL directive, except...
If I uncheck "Use DDE", it doesn't matter whether I use -SHELL "%1" or just
"%1" for the command, it creates a new instance and runs the program.
Using -SHELLOPEN always causes an error, so it must be a new vfp7 thing.

If I double click on a .prg that has an error, it runs up to the error, then
leaves the edit window open. aha! a cheap workaround. Leave an error on
the first line of the program! Not sure I like it.

Again thanks for all the help. I am leaving this one as it is. Back to
work.

Len


"Jim Livermore" <jje...@odyssey.net> wrote in message

news:3C39DE66...@odyssey.net...

Fred Taylor

unread,
Jan 7, 2002, 5:14:01 PM1/7/02
to
I'm interested, but I don't know that I really need it. Someday, I *will*
take the time to learn some of the ins-and-outs of the registry. Probably
just in time for it all to be made obsolete by .NET. <s>

--

Fred
Microsoft Visual FoxPro MVP
Please respond only to the newsgroups so that all may benefit.

"David Dunetz" <da...@sweetware.com> wrote in message

news:eEV3M36lBHA.708@tkmsftngp03...

Jim Livermore

unread,
Jan 8, 2002, 3:06:31 AM1/8/02
to
LenB wrote:
>
> If I double click on a .prg that has an error, it runs up to the error, then
> leaves the edit window open. aha! a cheap workaround. Leave an error on
> the first line of the program! Not sure I like it.

LOL! Cheap workaround indeed! Thanks for the tip!



> Again thanks for all the help. I am leaving this one as it is. Back to
> work.
>
> Len
>

--

Newspost

unread,
Jan 8, 2002, 12:03:45 PM1/8/02
to
If you have VFP open, you can drag the .Prg into the command window.

"Jim Livermore" <jje...@odyssey.net> wrote in message

news:3C3AA887...@odyssey.net...

Jim Livermore

unread,
Jan 8, 2002, 1:46:19 PM1/8/02
to
Cute! More windows to fart around with. sigh...

Newspost wrote:
>
> If you have VFP open, you can drag the .Prg into the command window.
>

--

0 new messages