Link to home
Start Free TrialLog in
Avatar of TAF2000
TAF2000

asked on

Getting text from another program SendMessage? WM_GETTEXT

I am trying to get a large amount of text into my program, from a different program.   I have tried using:

SendMessage progHWND, WM_GETTEXT, 8192, sText

The problem I am having, is the limit to the size of the text buffer.  it's only letting me get a small portion of the text that I need.  Is there a different method that will allow me to get much more?  Or is there a way I can get portions of it at a time?

Thanks in advance.


Avatar of Jaime Olivares
Jaime Olivares
Flag of Peru image

Hi TAF2000,

Notice that there is a OS limitation in Edit Boxes. 0x7FFF for Win95/98/Me and 0x7FFFFFFF for WinNT/2000/XP
Read at: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/editcontrols/editcontrolreference/editcontrolmessages/em_setlimittext.asp 

Good luck,
Jaime.
ASKER CERTIFIED SOLUTION
Avatar of zzzzzooc
zzzzzooc

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of TAF2000
TAF2000

ASKER

yes, the limt im having problems with is not max int (2147483647) that you refered too..
it is a much lower limitation caused by the string buffer:

Dim sText As String * 8192

it will not let you create a very large string..

so.. is there a way to get around this?  using something else in the sendmessage command?

Thanks
Avatar of TAF2000

ASKER

zzzzzooc,
just saw your message after replying to jaime's comment.  Will give it a shot.
Oh, one more comment. lngLen may need to be lngLen + 1:

If lngLen > 0 Then
    lngLen = lngLen + 1
    'etc...
End If