Page 1 of 1

Get Text of IDE Editor

Posted: Sat Apr 25, 2009 9:53 am
by lavachri
Hello,
because i can't use #SCI_FINDTEXT,
i'm trying to get the text of IDE (Scintilla Editor).
But if the returned lenght is good, my buffer is always empty !
I had use the VirtualAllocateMemory for the same result...

Code: Select all

EnableExplicit
Global hSCI
Global Len, R,
Global *Buf
Global Text$

hSCI = Val(GetEnvironmentVariable("PB_TOOL_Scintilla")) 
If hSCI 
  len = SendMessage_(hSCI,#SCI_GETTEXTLENGTH,0,0) + 1
  *buf = AllocateMemory(len) 
  If *Buf
    R = SendMessage_(hSCI,#SCI_GETTEXT,Len, *Buf ) 
    Text$ = PeekS( *Buf, Len )
     MessageRequester("Len="+Str(Len)+" R="+Str(R),Text$ ) 
   EndIf
EndIf

Compile an Exe and use as an external Tool.
My config : XP Home, PB 4.3


Thanks