I have noticed this about PowerPro and its current dir setting:
If I start PowerPro from a Windows shortcut whose "Start in:"
field is blank, some of my menus don't work. Specifically:
*Menu Folder shortcuts/printers
*Menu Folder shortcuts/admintools
make empty menus.
The folder /shortcuts/ is a subfolder of /PowerPro/
and it has several subfolders like those shown above.
If I start PowerPro from a shortcut whose "Start In:" field
contains: c:\shells\powerpro
then those submenus do work.
My conclusion from that is: the currentdir of the running
PowerPro program is important sometimes.
Some programs (such as some file managers maybe, and also
some editors and wordprocessors) change their currentdir
while they are running, for example to match a file manager's
currently viewed folder, or with an editor if it changes the
directory initially shown by the SaveAs command to match
the directory of the current document.
Also cmd.exe changes its currentdir just like the dos boxes
do in Win95/98.
Other programs never change their current directory.
I get the impression that powerpro.exe never changes its
currentdir during the same run of the program - otherwise
my menus described above would stop working.
You should be able to find the currentdir of powerpro.exe
by using var = currentdir
which help describes as "path to working folder of current
foreground window" -- except that powerpro is reluctant to
consider itself to be the foreground window. Usually for any
function about the foreground window, pp first restores focus
to what was foreground before you clicked its bar button.
That's for the good reason that the user is usually enquiring
about what was active just before, not about Powerpro itself.
The currentdir function doesn't allow a parameter to specify
which program's currentdir you are asking about.
sgp found a way to force it:
> local x=win.handle("active")
> win.show("=powerpro")
> win.debug(currentdir)
> win.show(x)
and complained:
> it works but it isn't ideal because it's temporarily steeling
> focus from the active window. Any suggestions?
I suggest your script MUST force PowerPro to steal focus,
otherwise it would not work because currentdir would be
referring to another app.
IMHO, sgp is right to say that David's:
> Local pproexefolder FILE.folder(WINDOW("exefullpath","=powerpro"))
is not necessarily the same as currentdir. In the case of PowerPro,
it just happens to coincide usually because PP is usually started
by a shortcut which has Command: c:\path to\powerpro.exe
and Start in: c:\<exactly the same path>
but it doesn't have to be so. For example you could make the
shortcut's "Start In:" field be c:\otherfolder
if you want relative paths in commands to have a different root.
Finally:
There is not much reason for enquiring about PP's currentdir.
Provided all your shortcuts for starting PP have the same
setting for "Start in:", you can depend upon that remaining
the currentdir -- unless I am wrong and PowerPro is capable
of changing its currentdir during the same run of the program,
which I think it never does.
------------------------ Yahoo! Groups Sponsor --------------------~-->
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/JV_rlB/TM
--------------------------------------------------------------------~->
Attention: PowerPro's Web site has moved: http://www.ppro.org
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/power-pro/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/