Tool to find the path of the project

Post Reply
User avatar
Otto
Posts: 6413
Joined: Fri Oct 07, 2005 7:07 pm
Has thanked: 28 times
Been thanked: 2 times
Contact:

Tool to find the path of the project

Post by Otto »

Hello,
attached you find a handy tool to find the path of the Project.
Best regards,
Otto


Code: Select all | Expand


// 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  

//----------------------------------------------------------------------------//

********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
karinha
Posts: 7948
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Been thanked: 3 times
Contact:

Re: Tool to find the path of the project

Post by karinha »

Sorry. ???????

Regards.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
Otto
Posts: 6413
Joined: Fri Oct 07, 2005 7:07 pm
Has thanked: 28 times
Been thanked: 2 times
Contact:

Re: Tool to find the path of the project

Post by Otto »

Hello,
maybe it is useful for you, too.
Best regards,
Otto

Image
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
karinha
Posts: 7948
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Been thanked: 3 times
Contact:

Re: Tool to find the path of the project

Post by karinha »

Unfortunately with my version, it does not work.

Image

Regards,
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
Otto
Posts: 6413
Joined: Fri Oct 07, 2005 7:07 pm
Has thanked: 28 times
Been thanked: 2 times
Contact:

Re: Tool to find the path of the project

Post by Otto »

Hello,
I would like to add this tool to to desktop or in the buttonbar of TotalCommander.
But I do not know what is missing that Tool-EXE is not opening automatically with the “Drag and Drop” info from the dropped file of File Manager.
Thank you in advance
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
Post Reply