Tool to find the path of the project

Tool to find the path of the project

Postby Otto » Mon Apr 09, 2018 6:39 am

Hello,
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  

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

********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm

Re: Tool to find the path of the project

Postby karinha » Mon Apr 09, 2018 2:52 pm

Sorry. ???????

Regards.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7813
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Tool to find the path of the project

Postby Otto » Mon Apr 09, 2018 5:02 pm

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
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm

Re: Tool to find the path of the project

Postby karinha » Mon Apr 09, 2018 5:43 pm

Unfortunately with my version, it does not work.

Image

Regards,
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7813
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Tool to find the path of the project

Postby Otto » Fri Jun 01, 2018 8:41 am

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
********************************************************************
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 87 guests