Discussion:
EM_GETSCROLLPOS result != EM_SETSCROLLPOS set values
(too old to reply)
R.Wieser
2022-04-08 10:44:31 UTC
Permalink
Hello all,

I'm trying to use EM_GETSCROLLPOS and EM_SETSCROLLPOS to save and later load
a position in a RichText control.

The problem is that when I set a certain position and *directly after*
retrieve the position they differ quite a bit (at least 10000 smaller
vertical).

I have no idea why that that happens, and neither MSDN doc to both tells me
about it either. :-|

So, my question : Does anyone here knows whats going on here ?


On a hunch I just tried to set several vertical positions in the range of
10000 to 60000, and dividing the results by those numbers returned a steady
0.78. IOW, its not the (constant) hight of the control's window or
something like that.

Regards,
Rudy Wieser
R.Wieser
2022-04-12 15:31:17 UTC
Permalink
Post by R.Wieser
So, my question : Does anyone here knows whats going on here ?
Having written some basic stuff to use a RichEd30 control and following a
hunch I think I know what happens : simply using any font other than the one
the control is created with causes the mismatching.

And that makes the (above mentioned) messages all but worthless for RTF
files, and /almost/, but not totally, for plain text files. :-(

Funny though : MSDN doesn't mention it and neither does a quite a bit of
googeling and ddg-ing.

Regards,
Rudy Wieser

Loading...