Look into the control deeper its possible the message is getting rerouted after the first one..
Also remember that windows only sends OnMessageItem message once per entry and remembers the size you gave it afterwards.
Btw, you can type class the class with the same name in the unit you are using it for and add what ever
you need to it.
Also I don't rebuilt the IDE, just the files until I know its working correctly.
Looking at the control it appears there could be an issue, however, I See that you can do what you need using the TlistBox instead..
The TListCheckBox is the basically the same control but if you use the TlistBox you'll simply need to draw the check mark yourself along with other items..
But there is a turbo bug with the checkbox area detection while clicking. The higher the item is, the wider the area is for changing the status of the checkbox with the mouse. […] Checkbox areas are practically squared…
Probably it's done to allow for changes in the size of the font but it will only work more or less "right" with single-line items, as your test show.
For me, something like that is inconceivable. The more so because the code responsible for determining the area of checkboxes is in the same unit! Therefore, why do not take advantage of it? Why is the area that allows to change the selection of a checkbox with the mouse is much larger than its actual size? This is nonsense.
Now I have to override the control WndProc method and redefine the entire LM_LBUTTONDOWN message hendler part so that the user can use my program normally. Dirty job with subclassing and Windows API. Another day lost, because of such trivial design mistakes.
I used subclassing to redefine the WndProc method so that it can handle mouse messages. Generally, this is about:
....
Even though my code is executing, the one from the default handler is also executed. So my fix do nothing — I can still check and uncheck checkboxes by clicking inside items.
What should I do to completely override the default handler for this messages?
Have you considered correcting the original source and submitting a patch to the bug-tracker? Or at least asking in the mailing list WTH this was done so?
There may be some other reason we know nothing about ... although I can't see it.
As to why ... well, just a wild guess but maybe someone thought that this being a quasi-tabular stle of control the user should be able to "check" the box by clicking on the text or something like that?
Strange. Have you tried following the message path to see what it's doing and where?