PlanetSquires Forums

Support Forums => General Board => Topic started by: Rolf Brandt on July 07, 2011, 01:48:27 PM

Title: FF3Xplore - Open an explorer window at the current FF3 project path
Post by: Rolf Brandt on July 07, 2011, 01:48:27 PM
FF3 can open a DOS box at the path of the currently opened projet. I like that. But sometime I would like an explorer window instead  Here are a few lines of code and a little tool that will do just that.

Add FF3Xplore to the UserTools and whenever you call it from the FF3 Tools menu it will open an explorer window for the current FF3 project path.

#COMPILE EXE
#INCLUDE "WIN32API.INC"

FUNCTION PBMAIN()
LOCAL res           AS DWORD
LOCAL winCaption    AS ASCIIZ * %Max_Path
LOCAL fPath         AS STRING
LOCAL x             AS LONG

res = GetForegroundWindow()
getwindowtext(res,winCaption,%Max_Path)
fPath = MID$(winCaption,INSTR(-1,winCaption,"[") + 1)
fPath = LEFT$(fPath,INSTR(-1,fPath,"\"))

x = SHELL("explorer.exe " & fPath,1)
END FUNCTION

Title: Re: FF3Xplore - Open an explorer window at the current FF3 project path
Post by: Roger Garstang on July 18, 2011, 05:12:25 PM
Sometimes titlebar text gets cropped, and GetWindowText calls one of two ways depending on who owns the window either getting the Caption Text or the Text of the Window.  Did passing it <R> for it to open an Explorer window in not work?
Title: Re: FF3Xplore - Open an explorer window at the current FF3 project path
Post by: John Montenigro on December 04, 2012, 04:42:29 PM
Thank you for this useful tool.

Here's a little variation I made in order to run a command-prompt command...

Use it or adapt it as you see fit!


#Compile Exe "c:\tools\FF3_CommandLine.exe"
#Include "WIN32API.INC"

Function PBMain()
   Local Res           As Dword
   Local winCaption    As AsciiZ * %Max_Path
   Local fPath         As String
   Local x             As Long
   Local CmdLine       As String

   Res = GetForegroundWindow()
   getwindowtext(Res,winCaption,%Max_Path)
   fPath = Mid$(winCaption,InStr(-1,winCaption,"[") + 1)
   fPath = Left$(fPath,InStr(-1,fPath,"\"))

   'pop up an inputbox and get the command
   'CmdLine = inputbox$("Enter commandline: ","Run a CommandLine", "dir *.*")
   CmdLine = InputBox$("Enter commandline: ","Run a CommandLine", "copy *_BAK*.* "  & $Dq & ".\older stuff" & $Dq)

   ChDrive fPath
   ChDir   fPath
   Shell Environ$("COMSPEC") + " /K " & CmdLine

End Function