Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

NMLVCUSTOMDRAW content problems ...

1 view
Skip to first unread message

R.Wieser

unread,
Feb 14, 2021, 3:59:44 AM2/14/21
to
Hello all,

As you could probably guess from my previous message, I'm trying to handle
some of a listviews "custom draw" events. :-)

I've got a few problems though: Using XPsp3:

Reference:
https://docs.microsoft.com/en-us/windows/win32/api/commctrl/ns-commctrl-nmcustomdraw
(retrieved: yesterday, 2021-02-13)

First problem:

It states for the RECT argument that its initialized on a CDDS_ITEMPREPAINT
state. My own logging shows its *only* initialized on a CDDS_PREPAINT
(0x00000001) state, and that the mentioned CDDS_ITEMPREPAINT (0x00010001)
state *doesn't* initialize it at all (contents are random)

Worse, that above RECT initialisation does not carry over to the following
CDDS_ITEMxxxx state messages. Or specifically, in that case only the Left
and Right fields are set, with the Top and Bottom fields being random. In
other words: not usable when trying to draw on the (sub) items DC.

What, if anything at all, am I missing here ?

Second problem:

The ColorText and ColorBackground fields (the first two in the extended
NMLVCUSTOMDRAW structure). On all but the CDDS_PREPAINT (0x00000001) and
CDDS_POSTPAINT (0x00000002) draw states the colors are always set to
0xFF000000. Meaning, black, but fully transparent. Regardless of if its
the currently focussed item or not. Again, not usable.

Also, missing : the color with which the (sub)items rectangle is cleared.

Remark:
There is a "clrFace" field, but as it happens that one isn't present in the
XP definition. Also, what is a "face" ? Text foreground ? text
Background ? The rectangles erase color ? I haven't got the foggiest
...

tl;dr:
I was expecting that the NMLVCUSTOMDRAW notification structure would give me
everything needed to, on the CDDS_(sub)ITEMxxxPAINT state, (re)draw a
(sub)items rectangle - selected or not. It doesn't. WTF ?

Regards,
Rudy Wieser


0 new messages