On Tuesday, 16 March 2021 at 19:42:26 UTC, Imperatorn wrote:



At last, i found the answer myself. There is a item called dwDrawStage in NMCUSTOMDRAW structure. If value of dwDrawStage is equal to CDDS_PREERASE, call SetBkMode with transparent and call SetTextColor. Then draw text with DrawText function. And finally, return CDRF_NOTIFYPOSTPAINT. In short, do the color changing process in pre-erase stage and return CDRF_NOTIFYPOSTPAINT constant. As per MSDN, What this constant means is,
The control will notify the parent after painting an item. This occurs when the dwDrawStage of the NMCUSTOMDRAW structure equals CDDS_PREPAINT.



Reply via email to