TMyDirTree.TreeViewAdvancedCustomDrawItem ...........
if cdsSelected in State then
Self.Options := Self.Options + [tvoThemedDraw]
else Self.Options := Self.Options - [tvoThemedDraw];
attrs := Integer(Node.Data);
if attrs > 0 then // here's a condition which font color to set
Canvas.Font.Color := AttributeToColor(attrs);
if Not (cdsSelected in State) then
exit; // Leave custom draw with having set the font color for non-selected nodes
// and now do the custom draw stuff for the selected node ....