In a custom control editor, I decided to implement some standard
messages, like %EM_SETSEL, to make it easier to simply replace
already existing text boxes with one for unlimited text sizes, etc.
So, %EM_SETSEL has a 16 bit limit in ordinary textboxes, but since
my editor is built from scratch and I'm handling all messages myself,
I thought I could over-ride that limit. Not so!
Sending an %EM_SETSEL message with lParam or wParam larger than
Integer limit, still fails, even though I trap it all in Longs.
Strange. By changing %EM_SETSEL to my own control message, %EDM_SETSEL,
that is, %WM_USER + something, all works fine!
So, with a "CASE %EM_SETSEL, %EDM_SETSEL", the first one fails on
Longs and the last one works, even though both uses the same code,
same message handler!
Seems like there's more to messages than meets the eye..
(yes, I know about %EM_EXSETSEL, but this was to enhance already
existing textboxes with an editor for unlimited textsize, without
having to rewrite any code. Obviously not possible, since Windows
still puts its limits to these, in some weird way..
)
------------------
messages, like %EM_SETSEL, to make it easier to simply replace
already existing text boxes with one for unlimited text sizes, etc.
So, %EM_SETSEL has a 16 bit limit in ordinary textboxes, but since
my editor is built from scratch and I'm handling all messages myself,
I thought I could over-ride that limit. Not so!
Sending an %EM_SETSEL message with lParam or wParam larger than
Integer limit, still fails, even though I trap it all in Longs.
Strange. By changing %EM_SETSEL to my own control message, %EDM_SETSEL,
that is, %WM_USER + something, all works fine!
So, with a "CASE %EM_SETSEL, %EDM_SETSEL", the first one fails on
Longs and the last one works, even though both uses the same code,
same message handler!
Seems like there's more to messages than meets the eye..
(yes, I know about %EM_EXSETSEL, but this was to enhance already
existing textboxes with an editor for unlimited textsize, without
having to rewrite any code. Obviously not possible, since Windows
still puts its limits to these, in some weird way..

------------------
Comment