On-screen text in text area

BlitzPlus Forums/BlitzPlus Programming/On-screen text in text area

Rottbott(Posted 2004) [#1]
Anyone got a good way to work out which section of the text in a text area gadget is actually visible in the text area?

The text area can be resized to any size.


soja(Posted 2004) [#2]
Rottbott, here's something that will help you:
[a http://support.microsoft.com/default.aspx?scid=kb;en-us;88387]Microsoft Knowledge Base Article - 88387
HOWTO: Determine the Visible Area of a Multiline Edit Control[/a]


Rottbott(Posted 2004) [#3]
Interesting.

Obviously what I really need to find is the first visible line in my text area, after which everything else is easy.

I think it depends on just what TextAreaCursor() returns. I'll investigate.


soja(Posted 2004) [#4]
First visible line in textarea:
; .lib "user32.dll"
; SendMessage%(hwnd, msg, wParam, mParam):"SendMessageA"

Const EM_GETFIRSTVISIBLELINE = $00CE
Notify SendMessage(QueryObject(textarea,1), EM_GETFIRSTVISIBLELINE, 0, 0)
; note that it includes lines that are only partly visible



Rottbott(Posted 2004) [#5]
Thanks, perfect. I'm useless at all this Win32 stuff!