FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour OT: TS.exe ( text find ) utility replacement
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
OT: TS.exe ( text find ) utility replacement
Posted: Thu Jul 30, 2015 12:24 PM

To All

There are some 16 bit tools I truly enjoy and one of them is Ts.Exe from the old Norton utilities. I use it all the time to find snippets of text I wish to find in my *.prg's. I have looked over the internet and can not seem to find a suitable 32 bit replacement.

Anyone have any suggestions ?

Rick Lipkin

Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: OT: TS.exe ( text find ) utility replacement
Posted: Thu Jul 30, 2015 12:26 PM

Rick, Total Commander?

Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noci贸n del tiempo

El secreto de la felicidad no est谩 en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: OT: TS.exe ( text find ) utility replacement
Posted: Thu Jul 30, 2015 12:43 PM

Cristobal

Thank you for your kind suggestion .. Total Commander is a bit too complicated for me .. it was so nice with Ts.exe that it actually showed you the line of text it found with the line number and filename.

Thanks
Rick Lipkin

Posts: 159
Joined: Wed Mar 28, 2007 01:19 PM
Re: OT: TS.exe ( text find ) utility replacement
Posted: Thu Jul 30, 2015 01:41 PM

Hi, I use the DOS Command FINDSTR
Example: FINDSTR /i /n /c:"hello world" *.prg
HTH
Euclides

Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: OT: TS.exe ( text find ) utility replacement
Posted: Thu Jul 30, 2015 01:51 PM
Hello Rick, use xDevStudio

http://www.vailton.com.br/




Regards,
Jo茫o Santos - S茫o Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: OT: TS.exe ( text find ) utility replacement
Posted: Thu Jul 30, 2015 02:13 PM

To All

Had to bite the bullet and load DosBox .. was hoping for another solution ... Still open to other options.

Thanks
Rick Lipkin

Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
Re: OT: TS.exe ( text find ) utility replacement
Posted: Thu Jul 30, 2015 02:17 PM

Rick:

You've seen MED CX?

http://www.med-editor.com/indexus.html

Menu FIND sub men煤 FIND IN FILES ...

Regards

SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: OT: TS.exe ( text find ) utility replacement
Posted: Thu Jul 30, 2015 02:43 PM

Armando

Thank you for your reply .. I am looking for a Command line prompt utility that I can run that will scan all *.filetype for a specific test string within the .prg

Rick Lipkin

Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: OT: TS.exe ( text find ) utility replacement
Posted: Thu Jul 30, 2015 03:15 PM
Rick,

This is not a command line program but it does what you want and very well. I have been using it for years.

Copernic Desktop Search http://www.copernic.com/en/products/desktop-search/features/

There is a free 30 day trial version so you have nothing to loose by trying it.

Regards,
James
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: OT: TS.exe ( text find ) utility replacement
Posted: Thu Jul 30, 2015 03:44 PM

Rick,

I forgot to mention that Copernic Search indexes everything when the computer is idle so searches are extremely fast, since it just searches it's own index.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 670
Joined: Wed Oct 19, 2005 06:41 PM
Re: OT: TS.exe ( text find ) utility replacement
Posted: Thu Jul 30, 2015 03:54 PM
Rick Good Morning
I Use this little utility i Wrote in harbour for my own use
Code (fw): Select all Collapse
#define  CRLF  chr(13) + chr(10)

function main( cSearch, cText, cPar )

    local aFiles
    local i
    local j
    local cFile
    local cTextInFile
    local aLines
    local CntLines
    local aResult
    local cResult
    local lBrowse       := .f.

    if empty( cSearch )
        cSearch = '*.*'
    end

    if !empty( cPar )
        cPar = lower ( alltrim( cPar ) )
    else
        cPar = ''
    end

    if !empty( cPar )
        cPar = strtran( cPar, '-', '' )
        do case
            case cPar == 'browse'
                lBrowse = .t.
        end
    end

    if empty( cText )
        help()
        quit
    end

    cText = alltrim( cText )
    if left( cText, 1 ) == '"' .or. left( cText, 1 ) == "'"
        ctext = substr( cText, 2 )
    end

    if right( cText, 1 ) == '"' .or. right( cText, 1 ) == "'"
        ctext = substr( cText, 1, len( ctext ) - 1 )
    end

    //? ctext

    aFiles = directory( cSearch )

    if len( aFiles ) == 0
        ? 'no se hallan archivos con el criterio ' + cSearch
        return nil
    end

    CntLines = 0

    //alert( str( len( aFiles ) ) )
    cls
    cResult = ''
    for i = 1 to len( aFiles )
        cFile       = aFiles[ i, 1 ]
        cTextInFile = memoread( cFile )
        aLines      = hb_aTokens( cTextInFile, CRLF )
        for j = 1 to len( aLines )
            if lower(ctext) $ lower( aLines[ j ] )
                if !lbrowse
                    ? cFile, str( j, 5 ), aLines[ j ]
                end
                cResult += cFile + ' ' + str( j, 5 )+ ' ' + aLines[ j ] + CRLF
                ++CntLines
                if CntLines > 21 .and. !lbrowse
                    inkey( 0)
                    cls
                    CntLines = 0
                end
            end
        next
    next

    if lbrowse
        memoedit( cResult, 0, 0, maxrow(), maxcol() )
    end


return nil


function help()

    ? 'utilitarios para grupo JoseNet'
    ? "Copyright ( c ) Wilson 'W' Gamboa A"
    ? "todos los derechos reservados"
    ? "no se da garantia de su uso  "
    ? "si le es util uselo bajo su propio riesgo"
    ? 'ts buscador de datos dentro de archivos'
    ? 'forma de invocarle'
    ? 'ts *.* "hola" '
    ? 'donde *.* es el patron de archivos a analizar'
    ? 'donde "hola" es el texto a buscar en el archivo'
    ? 'este utilitario solo sirve para archvos de texto'
    ? 'la salida tiene el formato '
    ? 'archivo linea texto de la linea'
    ? 'cada 22 lineas se para y debemos digitar una tecla'
    ? 'para continuar en la siguiente pagina'

return nil


Best regards
Wilson
Wilson 'W' Gamboa A
Wilson.josenet@gmail.com
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: OT: TS.exe ( text find ) utility replacement
Posted: Thu Jul 30, 2015 05:34 PM

James and Wilson

Thank you both for your suggestions !

Rick Lipkin

Posts: 476
Joined: Sat Feb 03, 2007 06:36 AM
Re: OT: TS.exe ( text find ) utility replacement
Posted: Thu Jul 30, 2015 09:25 PM
Also, you can use: fileseek
https://www.fileseek.ca/

It's free.

Best regards.

Carlos.
Posts: 195
Joined: Sun Jul 22, 2012 07:01 PM
Re: OT: TS.exe ( text find ) utility replacement
Posted: Fri Jul 31, 2015 12:20 AM

Rick,

I don't know ts.exe and have never used it myself, but this utility purports to be a modern remake.

http://gverkade.home.xs4all.nl/ts/

Robb

Posts: 145
Joined: Wed Nov 03, 2010 09:16 AM
Re: OT: TS.exe ( text find ) utility replacement
Posted: Fri Jul 31, 2015 07:00 AM
Hi
This code is a sample.

Code (fw): Select all Collapse
#include "fivewin.ch"
#include "Directry.ch"

#define ODT_MENU 聽 聽 聽 聽1
#define ODT_LISTBOX 聽 聽 2
#define ODT_COMBOBOX 聽 聽3
#define ODT_BUTTON 聽 聽 聽4
#define ODA_DRAWENTIRE 聽0x0001
#define ODA_SELECT 聽 聽 聽0x0002
#define ODA_FOCUS 聽 聽 聽 0x0004
#define ODS_SELECTED 聽 聽0x0001
#define ODS_GRAYED 聽 聽 聽0x0002
#define ODS_DISABLED 聽 聽0x0004
#define ODS_CHECKED 聽 聽 0x0008
#define ODS_FOCUS 聽 聽 聽 0x0010
#define ODS_DEFAULT 聽 聽 聽 聽 0x0020
#define ODS_COMBOBOXEDIT 聽 聽0x1000

#define COLOR_HIGHLIGHTTEXT 聽14
#define COLOR_HIGHLIGHT 聽 聽 聽13

#define ETO_OPAQUE 聽 聽 聽 聽 聽 聽 聽 聽 聽 0x0002
#define ETO_CLIPPED 聽 聽 聽 聽 聽 聽 聽 聽 聽0x0004

#define DT_TOP 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽0x00000000
#define DT_LEFT 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 0x00000000
#define DT_CENTER 聽 聽 聽 聽 聽 聽 聽 聽 聽 0x00000001
#define DT_RIGHT 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽0x00000002
#define DT_VCENTER 聽 聽 聽 聽 聽 聽 聽 聽 聽0x00000004
#define DT_BOTTOM 聽 聽 聽 聽 聽 聽 聽 聽 聽 0x00000008
#define DT_WORDBREAK 聽 聽 聽 聽 聽 聽 聽 聽0x00000010
#define DT_SINGLELINE 聽 聽 聽 聽 聽 聽 聽 0x00000020
#define DT_EXPANDTABS 聽 聽 聽 聽 聽 聽 聽 0x00000040
#define DT_TABSTOP 聽 聽 聽 聽 聽 聽 聽 聽 聽0x00000080
#define DT_NOCLIP 聽 聽 聽 聽 聽 聽 聽 聽 聽 0x00000100
#define DT_EXTERNALLEADING 聽 聽 聽 聽 聽0x00000200
#define DT_CALCRECT 聽 聽 聽 聽 聽 聽 聽 聽 0x00000400
#define DT_NOPREFIX 聽 聽 聽 聽 聽 聽 聽 聽 0x00000800
#define DT_INTERNAL 聽 聽 聽 聽 聽 聽 聽 聽 0x00001000


static oWnd := nil
static oLbx
static oFont
static lCancel := .f.
static cBuscando



function main()


local oDlg
local lValid := .f.
local aRect
local oCbxFind, aCbxFind := {}
local oCbxTipos, aCbxTipos := {}
local oCbxRutas, aCbxRutas := {}
local oBtnDir
local oChkMay, lMay := .f.
local oChkRec, lRec := .t.
local oChkExp, lExp := .f.
local cTipos := padr("*.PRG", 255 ) 聽//hb_CurDrive() + ":\" +
local cRutas := padr( GetCurDir(), 255)
local cDir
local aLines := {}
local cVar := ""
local cFind := space(255)

//DEFAULT nShow := 0

DEFINE DIALOG oDlg NAME 1001

聽 聽 聽 聽REDEFINE COMBOBOX oCbxFind 聽VAR cFind 聽ID 104 ITEMS aCbxFind 聽OF oDlg
聽 聽 聽 聽REDEFINE COMBOBOX oCbxTipos VAR cTipos ID 105 ITEMS aCbxTipos OF oDlg
聽 聽 聽 聽REDEFINE COMBOBOX oCbxRutas VAR cRutas ID 106 ITEMS aCbxRutas OF oDlg

聽 聽 聽 聽REDEFINE BUTTON oBtnDir ID 108 OF oDlg ACTION ( cDir := cGetDir("Seleccione Ruta", alltrim( cRutas ) ),;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽if( !empty( cDir ),;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽(if(!oCbxRutas:Find(cDir),oCbxRutas:Add( cDir ),),;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 oCbxRutas:oGet:VarPut( cDir ), oCbxRutas:oGet:Refresh()),))

聽 聽 聽 聽REDEFINE CHECKBOX oChkMay VAR lMay ID 101 OF oDlg
聽 聽 聽 聽REDEFINE CHECKBOX oChkRec VAR lRec ID 102 OF oDlg
聽 聽 聽 聽//REDEFINE CHECKBOX oChkExp VAR lExp ID 103 OF oDlg

聽 聽 聽 聽REDEFINE BUTTON ID 1 OF oDlg ACTION ( ShowWndFind(), if(!oCbxFind:Find(cFind),oCbxFind:Add( cFind ),),;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽Buscar( oCbxFind, oCbxTipos, oCbxRutas, lMay, lRec, lExp))
聽 聽 聽 聽REDEFINE BUTTON ID 2 OF oDlg ACTION lCancel := .t., oDlg:End()

ACTIVATE DIALOG oDlg CENTERED ON INIT oCbxFind:SetFocus()//VALID lValid

return nil

function Buscando( c )
if c != nil; cBuscando := c; endif
return cBuscando

function ShowWndFind()
local cVar
local aLines := {}


DEFINE FONT oFont NAME "Courier New" SIZE 0, -12

if oWnd == nil

聽 聽DEFINE WINDOW oWnd 聽;
聽 聽 聽 聽 聽 TITLE "Buscar en ficheros" ;
聽 聽 聽 聽 聽 FROM 150, 150 TO 520, 700 PIXEL ;
聽 聽 聽 聽 聽 COLOR 0, CLR_WHITE

聽 聽 聽@ 0, 0 LISTBOX oLbx VAR cVar ITEMS aLines SIZE 500, 300 PIXEL OF oWnd FONT oFont ON DBLCLICK AbreFichero() ;
聽 聽 聽 聽 聽 聽 COLOR 0, CLR_WHITE BITMAPS {0}

聽 聽 聽 聽 聽 聽 oLbx:bRClicked := {| nRow, nCol | Contextual( nRow, nCol ) }

聽 聽 聽 聽 聽 聽 oLbx:nBmpHeight := 20 //30
聽 聽 聽 聽 聽 聽 oLbx:bDrawItem := {| hDC, nItem, cText, rc, lFocus, lSelected, hBitmap | PintaItem( hDC, nItem, ctext, rc, lFocus, lSelected, hBitmap ) }

聽 聽 聽 聽 聽 oWnd:oClient := oLbx

聽 聽ACTIVATE WINDOW oWnd VALID ( oWnd := nil, .t. )

else
聽 聽oLbx:Reset()
聽 聽oWnd:SetFocus()
endif


return nil


static function Buscar( oCbxFind, oCbxTipos, oCbxRutas, lExacto, lRecursivo )
local aLines
local cLine
local cStr := ""
local cBuscar := alltrim(oCbxFind:oGet:VarGet())
local cRuta 聽 := alltrim(oCbxRutas:oGet:VarGet())
local cTipos 聽:= alltrim(oCbxTipos:oGet:VarGet())

if right( cRuta, 1 ) == "\" 聽 聽 聽 聽 聽 聽 聽
聽 聽cRuta := substr( cRuta, 1, len( cRuta )-1 )
endif

if empty( cBuscar )
聽 聽MsgAlert( "Debe especificar busqueda","Atenci贸n")
聽 聽return nil
endif

AAdd( oLbx:aItems, 'Buscando "' + cBuscar + '" 聽en [' + cRuta + "]" )
oLbx:SendMsg( 384, 0, "Buscando " + cBuscar + " 聽en [" + cRuta + "]" )
//oLbx:Add(" " )

Buscando( cBuscar )

aLines := FindInFile( cBuscar, cRuta, cTipos, lExacto, lRecursivo 聽)
oLbx:GoTop()


cBuscar := oCbxFind: oGet:VarGet()
cRuta 聽 := oCbxRutas:VarGet()
cTipos 聽:= oCbxTipos:VarGet()

oCbxFind:VarPut( cBuscar )
oCbxFind:Refresh()

oCbxRutas:VarPut( cRuta )
oCbxRutas:Refresh()

oCbxTipos:VarPut( cTipos )
oCbxTipos:Refresh()

if lCancel
聽 聽MsgStop( "Acci贸n cancelada","Atenci贸n")
聽 聽lCancel := .f.
聽 聽return nil
endif


return nil




function FindInFile( cBuscar, cDir, cMask, lExacto, lRecursivo )
local aDir, cFile, cStr, nEn, nLines, nEnLine, cLine, cAux, nLen, cAux2, n, cNewDir
local nLastEn := 0
local aLines := {}
local lPrimera := .t.

DEFAULT lExacto := .f.
DEFAULT lRecursivo := .f.

aDir := Directory( cDir + "\"+alltrim(cMask), "D" ) 

sleep(10)

cBuscar := alltrim(cBuscar)

nLen := len(aDir)

for n := 1 to nLen

聽 聽 cFile := aDir[n]

聽 聽 nLastEn := 0

聽 聽 if lCancel
聽 聽 聽 聽return .f.
聽 聽 endif


聽 聽 if lRecursivo .and. ("D" $ cFile[F_ATTR]) .and. (cFile[F_NAME] != ".") .AND. (cFile[F_NAME] != "..")
聽 聽 聽 聽 cNewDir := cDir + "\" + cFile[F_NAME]
聽 聽 聽 聽 SysRefresh()
聽 聽 聽 聽 FindInFile( cBuscar, cNewDir , cMask, lExacto, lRecursivo )
聽 聽 聽 聽 if lCancel
聽 聽 聽 聽 聽 聽return .f.
聽 聽 聽 聽 endif
聽 聽 else


聽 聽 聽 聽if "." +lower(cFileExt( cFile[F_NAME])) $ lower(cMask)

聽 聽 聽 聽 聽 oWnd:cTitle := cDir + "\" +cFile[F_NAME]

聽 聽 聽 聽 聽 cStr 聽 := Memoread( cDir + "\" + cFile[F_NAME] )
聽 聽 聽 聽 聽 cAux 聽 := Memoread( cDir + "\" + cFile[F_NAME] )
聽 聽 聽 聽 聽 lPrimera := .t.
聽 聽 聽 聽 聽 nLines := 0
聽 聽 聽 聽 聽 do while ( nEn := at( if( lExacto, cBuscar,lower(cBuscar)), if( lExacto, cStr, lower(cStr)) ) ) != 0

聽 聽 聽 聽 聽 聽 聽if lPrimera
聽 聽 聽 聽 聽 聽 聽 聽 lPrimera := .f.
聽 聽 聽 聽 聽 聽 聽 聽 AAdd( oLbx:aItems, "" )
聽 聽 聽 聽 聽 聽 聽 聽 oLbx:SendMsg( 384, 0, "" )
聽 聽 聽 聽 聽 聽 聽 聽 AAdd( oLbx:aItems, cDir + "\" + cFile[F_NAME] )
聽 聽 聽 聽 聽 聽 聽 聽 oLbx:SendMsg( 384, 0, cDir + "\" + cFile[F_NAME] )
聽 聽 聽 聽 聽 聽 聽endif

聽 聽 聽 聽 聽 聽 聽nLines 聽+= ((len( left( cStr, nEn ) )-len(strtran( left( cStr, nEn ),CRLF,"")))/2)
聽 聽 聽 聽 聽 聽 聽cLine 聽 := memoline( cAux,254,nLines+1 )
聽 聽 聽 聽 聽 聽 聽cStr 聽 聽:= substr( cStr, nEn+1 )
聽 聽 聽 聽 聽 聽 聽AAdd( oLbx:aItems, str(nLines+1,6) + ": 聽" + cLine )
聽 聽 聽 聽 聽 聽 聽oLbx:SendMsg( 384, 0, str(nLines+1,6) + ": 聽" + cLine )
聽 聽 聽 聽 聽 聽 聽SysRefresh()
聽 聽 聽 聽 聽 enddo

聽 聽 聽 聽endif
聽 聽 endif

next

return nil


function PintaItem( hDC, nItem, ctext, rc, lFocus, lSelected, hBitmap )
local nTop, nLeft, n
local nWidth := 0
local nHeight := 0
local nMode
local hOldFont := SelectObject( hDC, oFont:hFont )
local nEn
local nW
local c1, c2
local cBuscar := alltrim( Buscando() )
rc[2] += 3

nMode := SetBkMode( hDC, 1 )
if lSelected
聽 聽FillSolidRect( hDC, rc, CLR_HGRAY )
else
聽 聽FillSolidRect( hDC, rc, CLR_WHITE )
endif

SetTextColor( hDC, RGB(0,0,128) )

/*
if hBitmap != 0
聽 聽nWidth := nBmpWidth( hBitmap )
聽 聽nHeight := nBmpHeight( hBitmap )
聽 聽nTop := rc[1] + (rc[3]-rc[1])/2 - nHeight/2
聽 聽DrawMasked( hDC, hBitmap, nTop, rc[2]+2 )
endif
*/
nEn := at( lower(cBuscar), lower(cText) )

if nEn > 0
聽 聽c1 := substr( cText, 1, nEn-1 )
聽 聽nW := GetTextWidth( hDC, c1, oFont:hFont )
聽 聽rc[4] := rc[2] + nW
聽 聽DrawText( hDC, c1, {rc[1], rc[2], rc[3], rc[4] }, nOr( DT_VCENTER, DT_SINGLELINE ) )

聽 聽SetTextColor( hDC, RGB( 0,100,0) )
聽 聽rc[2] := rc[4]
聽 聽nW := GetTextWidth( hDC, cBuscar, oFont:hFont )
聽 聽rc[4] := rc[2] + nW
聽 聽DrawText( hDC, substr( cText, nEn, len( cBuscar ) ), {rc[1], rc[2] , rc[3], rc[4] }, nOr( DT_VCENTER, DT_SINGLELINE ) )

聽 聽SetTextColor( hDC, RGB(0,0,150) )
聽 聽c2 := substr( cText, nEn + len( cBuscar ) )
聽 聽rc[2] := rc[4]
聽 聽nW := GetTextWidth( hDC, c2, oFont:hFont )
聽 聽rc[4] := rc[2] + nW
聽 聽DrawText( hDC, c2, {rc[1], rc[2] , rc[3], rc[4] }, nOr( DT_VCENTER, DT_SINGLELINE ) )
else
聽 聽SetTextColor( hDC, RGB( 128,0,150) )
聽 聽DrawText( hDC, cText, {rc[1], rc[2] , rc[3], rc[4] }, nOr( DT_VCENTER, DT_SINGLELINE ) )
endif

SetBkMode( hDC, nMode )
SelectObject( hDC, hOldFont )

return nil





function LbxDrawItem( nPStruct, aBitmaps, aItems, nBmpWidth, bDrawItem )

local aInfo := GetDrawItemStruct( nPStruct )
local CtlType 聽 聽:= aInfo[1]
local CtlID 聽 聽 聽:= aInfo[2]
local itemID 聽 聽 := aInfo[3]
local itemAction := aInfo[4]
local itemState 聽:= aInfo[5]
local hWndItem 聽 := aInfo[6]
local hDC 聽 聽 聽 聽:= aInfo[7]
local nTop 聽 聽 聽 := aInfo[8]
local nLeft 聽 聽 聽:= aInfo[9]
local nBottom 聽 聽:= aInfo[10]
local nRight 聽 聽 := aInfo[11]
local rgbFore, rgbBack

do case
聽 聽case itemAction == ODA_DRAWENTIRE .or. itemAction == ODA_SELECT

聽 聽 聽 聽 if bDrawItem != nil
聽 聽 聽 聽 聽 聽if itemID+1 > len( aItems ); return " "; endif
聽 聽 聽 聽 聽 聽return eval( bDrawItem, hDC, itemID+1, aItems[itemID+1], {nTop, nLeft, nBottom, nRight}, lAnd( itemState, ODS_FOCUS ),lAnd( itemState, ODS_SELECTED )) //, if( len( abitmaps ) > 0, aBitmaps[itemID+1],0) )
聽 聽 聽 聽 endif

聽 聽 聽 聽 if lAnd( itemState, ODS_FOCUS )
聽 聽 聽 聽 聽 聽DrawFocusRect( hDC, nTop,nLeft,nBottom,nRight )
聽 聽 聽 聽 endif
聽 聽 聽 聽 if lAnd( itemState, ODS_SELECTED )
聽 聽 聽 聽 聽 聽rgbFore := SetTextColor( hDC, GetSysColor( COLOR_HIGHLIGHTTEXT ) )
聽 聽 聽 聽 聽 聽rgbBack := SetBkColor( hDC, GetSysColor( COLOR_HIGHLIGHT ) )
聽 聽 聽 聽 聽 聽FillSolidRect( hDC, {nTop, nLeft, nBottom, nRight}, GetSysColor( COLOR_HIGHLIGHT ) )
聽 聽 聽 聽 else
聽 聽 聽 聽 聽 聽FillSolidRect( hDC, {nTop, nLeft, nBottom, nRight}, CLR_WHITE聽 聽 聽)
聽 聽 聽 聽 endif

聽 聽 聽 聽 DrawText( hDC, aItems[itemID + 1], {nTop, nLeft + 2, nBottom, nRight}, nOr( DT_VCENTER, DT_SINGLELINE ) )

聽 聽 聽 聽 if lAnd( itemState, ODS_SELECTED )
聽 聽 聽 聽 聽 聽SetTextColor( hDC, rgbFore )
聽 聽 聽 聽 聽 聽SetBkColor( hDC, rgbBack )
聽 聽 聽 聽 endif

聽 聽 聽 聽 if lAnd( itemState, ODS_FOCUS )
聽 聽 聽 聽 聽 聽DrawFocusRect( hDC, nTop, nLeft, nBottom, nRight )
聽 聽 聽 聽 endif

endcase

return 0

static function Abrefichero()

local cLine := oLbx:GetSelText()
local nLine, cFile, n
local oCode
local nIni, nEnd

if substr( cLine, 7, 1 ) == ":"
聽 聽nLine := val( left( cLine, 6 ))
聽 聽for n := oLbx:GetPos to 1 step -1
聽 聽 聽 聽if left( oLbx:aItems[n], 1 ) != " "
聽 聽 聽 聽 聽 cFile := alltrim( oLbx:aItems[n] )
聽 聽 聽 聽 聽 exit
聽 聽 聽 聽endif
聽 聽next
endif

? cFile, nLine


return nil




static function contextual( nRow, nCol )
local oMnu


聽MENU oMnu POPUP
聽 聽 MENUITEM "Limpiar" ACTION ( if( len( oLbx:aItems ) > 0, (oLbx:Reset(), oLbx:Add( " " )),) )
聽 聽 MENUITEM " "
聽 聽 MENUITEM " "
聽 聽 MENUITEM " "
聽ENDMENU
聽ACTIVATE MENU oMnu AT nRow, nCol OF oLbx

return nil

function OpenCode( cFile )
? "Llamar al editor para abrir " + cFile
return 0



#pragma BEGINDUMP
#include "windows.h"
#include "hbapi.h"


/*typedef struct tagDRAWITEMSTRUCT {
聽 聽 UINT CtlType;
聽 聽 UINT CtlID;
聽 聽 UINT itemID;
聽 聽 UINT itemAction;
聽 聽 UINT itemState;
聽 聽 HWND hwndItem;
聽 聽 HDC hDC;
聽 聽 RECT rcItem;
聽 聽 ULONG_PTR itemData;
}*/

HB_FUNC( GETDRAWITEMSTRUCT )
{
聽 聽LPDRAWITEMSTRUCT lp = ( LPDRAWITEMSTRUCT ) hb_parnl( 1 );

聽 聽hb_reta( 12 );

聽 聽hb_storvni( lp->CtlType 聽 聽 聽, 聽 聽-1, 1 聽);
聽 聽hb_storvni( lp->CtlID 聽 聽 聽 聽, 聽 聽-1, 2 聽);
聽 聽hb_storvni( lp->itemID 聽 聽 聽 , 聽 聽-1, 3 聽);
聽 聽hb_storvni( lp->itemAction 聽 , 聽 聽-1, 4 聽);
聽 聽hb_storvni( lp->itemState 聽 聽, 聽 聽-1, 5 聽);
聽 聽hb_storvni( ( LONG ) lp->hwndItem 聽 聽 , 聽 聽-1, 6 聽);
聽 聽hb_storvni( ( LONG ) lp->hDC 聽 聽 聽 聽 聽, 聽 聽-1, 7 聽);
聽 聽hb_storvni( lp->rcItem.top 聽 , 聽 聽-1, 8 聽);
聽 聽hb_storvni( lp->rcItem.left 聽, 聽 聽-1, 9 聽);
聽 聽hb_storvni( lp->rcItem.bottom, 聽 聽-1, 10 );
聽 聽hb_storvni( lp->rcItem.right , 聽 聽-1, 11 );
聽 聽hb_storvnd( lp->itemData 聽 聽 , 聽 聽-1, 12 );

}
HB_FUNC( FILLSOLIDRECT )
{
聽 聽 RECT rct;
聽 聽 COLORREF nColor;
聽 聽 HPEN hPen, hOldPen;
聽 聽 HDC hDC = ( HDC ) hb_parnl( 1 );
聽 聽 rct.top 聽 聽= hb_parvni( 2, 1 );
聽 聽 rct.left 聽 = hb_parvni( 2, 2 );
聽 聽 rct.bottom = hb_parvni( 2, 3 );
聽 聽 rct.right 聽= hb_parvni( 2, 4 );

聽 聽 nColor = SetBkColor( hDC, hb_parnl( 3 ) );
聽 聽 ExtTextOut( hDC, 0, 0, ETO_OPAQUE, &rct, NULL, 0, NULL);
聽 聽 SetBkColor( hDC, nColor );

}






#pragma ENDDUMP


Code (fw): Select all Collapse
1001 DIALOG 6, 18, 210, 142
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Dialog"
FONT 8, "MS Sans Serif"
{
聽COMBOBOX 104, 2, 11, 136, 40, WS_BORDER |CBS_DROPDOWN |CBS_SORT |WS_VSCROLL |WS_TABSTOP
聽COMBOBOX 105, 2, 36, 136, 40, WS_BORDER |CBS_DROPDOWN |CBS_SORT |WS_VSCROLL |WS_TABSTOP
聽COMBOBOX 106, 2, 60, 136, 40, WS_BORDER |CBS_DROPDOWN |CBS_SORT |WS_VSCROLL |WS_TABSTOP
聽PUSHBUTTON "...", 108, 143, 60, 12, 13
聽CONTROL "Ignorar May/min", 101, "Button", BS_AUTOCHECKBOX |WS_TABSTOP, 2, 76, 64, 10
聽CONTROL "Recursivo", 102, "Button", BS_AUTOCHECKBOX |WS_TABSTOP, 74, 76, 48, 10
聽DEFPUSHBUTTON "&OK", IDOK, 2, 92, 45, 15
聽PUSHBUTTON "&Cancel", IDCANCEL, 2, 108, 45, 15
聽LTEXT "Texto:", 4001, 2, 2, 40, 8
聽LTEXT "En ficheros:", -1, 2, 26, 40, 8
聽LTEXT "Carpeta:", -1, 2, 51, 40, 8
}


https://drive.google.com/file/d/0B4835CHHvPURZ3NzYWxfZnQtMjQ/view?usp=sharing

A greeting.
Paco Garc铆a