The following remark can be found in the description of the EM_SETSEL message in the Win32 Programmer's Reference:
For some unknown reason, such behavior does not seem to be constant from one system to another. This is posted primarily as a warning to anyone wishing to use this EM_SETSEL message for edit controls which may grow larger than 32K.
Raymond
Remarks
In a rich edit control, if the selection is not entirely contained in the first 64K, use the message EM_EXSETSEL.
While tracking down another problem, it was noticed that the limit should probably have been stated as being 32K. Although the parameters taken by the message are 32-bit values, it seems that only the low word of those values are used AND are sign extended to 32 bits, and then interpreted as an unsigned 32-bit value.
In a rich edit control, if the selection is not entirely contained in the first 64K, use the message EM_EXSETSEL.
For some unknown reason, such behavior does not seem to be constant from one system to another. This is posted primarily as a warning to anyone wishing to use this EM_SETSEL message for edit controls which may grow larger than 32K.
Raymond