Paul,
Thank you for sharing. When I create my FPW's, I set the RESOURCE and TITLE as well.
Setting the RESOURCE protects the other environments if the FoxUser table corrupts. It also creates a unique history for that project in the Command window.
Setting the TITLE helps me find the different project in the Windows Task Bar.
Tracy Pearson PowerChurch Software
Paul H. Tarver wrote on 2017-06-16:
Back in May, I asked a question about running multiple instances of VFP.
I
know now it was kind of a dumb question, but the response from everyone
in
the group inspired me to work up a small program to do exactly what I
needed
done when setting up a new project. Since you all were part of my
solution I
thought I'd share. Granted, this is slapped together and there are
probably
a thousand different ways to make this better, so be gentle! J
The premise is to have a fast way to create a shortcut to a project as
well
as create a .FPW file at the same time. So I wrote this program, compiled
it
and added a short cut to my desktop so I can run it after a new project
file
is created in whatever project folder I want to use. It's designed to
work
on both 32 and 64 bit Windows and you can put anything you want between
the
Text..Endtext lines and it will be added to the .FPW file. The .FPW and
.LNK
files have the same name to keep it simple. Once a project is completed
and
I move it to my archive folders, I can re-run the program and choose the project file in the new storage folder and the shortcut and the .FPW are re-created to update the paths.
I've been using this for a couple of weeks now and it works great for
VFP9
and I THINK it will work with VFP6, but I haven't tried it yet. I chose
to
comment out the lines that reference the icon selection because the
default
was fine, but I left them in for future reference. The WScript.Shell code
to
actually create the shortcut I found in the Microsoft knowledgebase and I just updated the variable names.
*!********************************************************************
LOCAL lcArguments, lcConfigFPW, lcFPWFile, lcProjectFile, lcProjectPath, lcShortCutPath
LOCAL lcTargetPath, lcWorkingDir, loMyShortCut
lcProjectFile = GETFILE('PJX', '', 'Select', 0, 'Select project file...')
lcProjectPath = JUSTPATH(lcProjectFile)
IF !EMPTY(lcProjectFile)
TEXT TO lcConfigFPW TEXTMERGE NOSHOW SCREEN = OFF PATH = .\DATA; .\FORMS; .\GRAPHICS; .\LIBS; .\MENUS; .\PROGRAMS;.\REPORTS
DEFAULT = "<<lcProjectPath>>" COMMAND = MODIFY PROJECT "<<lcProjectFile>>" TMPFILES=c:\temp EDITWORK=c:\temp SORTWORK=c:\temp PROGWORK=c:\temp ENDTEXT DO CASE CASE DIRECTORY("C:\Program Files (x86)", 1) = .T. && Is
64-Bit
Operating System
lcFPWFile = ADDBS(ALLTRIM(lcProjectPath)) +'start-vfp9x64.fpw' lcShortCutPath = ADDBS(ALLTRIM(lcProjectPath)) + 'start-vfp9x64.lnk' lcTargetPath = "C:\Program Files (x86)\Microsoft Visual FoxPro 9\vfp9.exe"
lcIconLocation = "C:\Program Files (x86)\Microsoft
Visual
FoxPro 9\vfp9.exe" lcArguments = '-C' + '"' + lcFPWFile + '"'
lcWorkingDir = "C:\Program Files (x86)\Microsoft VisualFoxPro 9"
CASE DIRECTORY("C:\Program Files (x86)", 1) = .F. && Is
32-Bit
Operating System
lcFPWFile = ADDBS(ALLTRIM(lcProjectPath)) +'start-vfp9x32.fpw' lcShortCutPath = ADDBS(ALLTRIM(lcProjectPath)) + 'start-vfp9x32.lnk' lcTargetPath = "C:\Program Files\Microsoft Visual
FoxPro
9\vfp9.exe"
lcIconLocation = "C:\Program Files\Microsoft Visual
FoxPro
9\vfp9.exe" lcArguments = '-C' + '"' + lcFPWFile + '"'
lcWorkingDir = "C:\Program Files\Microsoft Visual
FoxPro
9"
ENDCASE STRTOFILE(lcConfigFPW, lcFPWFile) loWsh = CREATEOBJECT("WScript.Shell") loMyShortCut = loWsh.CreateShortcut(lcShortCutPath) loMyShortCut.WindowStyle = 7 && Minimized 0=Maximized 4=Normal
loMyShortcut.IconLocation = home() + "wizards\graphics\builder.ico" loMyShortCut.TargetPath = lcTargetPath loMyShortCut.Arguments = lcArguments loMyShortCut.WorkingDirectory = lcWorkingDir loMyShortCut.SAVEENDIF
RETURN
*!********************************************************************