Get Text of IDE Editor

Just starting out? Need help? Post your questions and find answers here.
lavachri
User
User
Posts: 19
Joined: Tue Oct 14, 2008 3:01 pm
Location: French

Get Text of IDE Editor

Post 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