attached you find a handy tool to find the path of the Project.
Best regards,
Otto
- Code: Select all Expand view
// to find the path of the project
// open the Windows File Manager and Drag and Drop a file over this window
#include "FiveWin.ch"
static oWnd
static cResultPath := ""
//----------------------------------------------------------------------------//
function Main()
DEFINE WINDOW oWnd TITLE "Droping Files from FileManager to find path of project"
@ 10,10 ;
BTNBMP ;
PROMPT "Path to Clipboard" ;
OF oWnd ;
ACTION CopyToClipboard( cResultPath )
ACTIVATE WINDOW oWnd ;
ON DROPFILES PaintTheName( nRow, nCol, aFiles )
return nil
//----------------------------------------------------------------------------//
function PaintTheName( nRow, nCol, aFiles )
local cName, cResult := ""
local n := 1
while ! Empty( cName := StrToken( aFiles[ 1 ], n++, "\" ) )
if "~" $ cName
cName = SFN2LFN( cResult + cName )
endif
cResult += cName + "\"
end
cResult = SubStr( cResult, 1, Len( cResult ) - 1 )
oWnd:Say( nRow, nCol, cResult,,,, .t. ) // Say in pixels
cResultPath := PrjPath( cResult )
if "~" $ cResultPath
cResultPath = SFN2LFN( cResultPath )
endif
oWnd:Say( nRow + 50, nCol, "Project path: " + cResultPath,,,, .t. )
return nil
//----------------------------------------------------------------------------//
function PrjPath( cExe )
local cBuf, nAt
if Empty( cExe )
return nil
endif
cBuf := MEMOREAD( cExe )
cBuf := AfterAtNum( "(_INITSTATICS", cBuf, 1 )
cBuf := AfterAtNum( Chr( 0 ), cBuf, 1 )
cBuf := BeforAtNum( Chr( 0 ), cBuf, 1 )
return cBuf
//----------------------------------------------------------------------------//
function CopyToClipboard( cText )
local oClip := TClipBoard():New()
if oClip:Open()
oClip:SetText( cText )
oClip:Close()
endif
oClip:End()
return nil
//----------------------------------------------------------------------------//