DN_CTLCOLORDLGITEM

Far Manager

DN_CTLCOLORDLGITEM

The DN_CTLCOLORDLGITEM event is sent to the dialog callback function before each dialog item is drawn.

Param1

ID of the dialog item that is about to be drawn.

Param2

Color attribute (foreground+background) that the callback function wants to use to draw dialog item:
LO(LO=Title,HI=HiText), HI(LO=Frame,0)
LO(LO=Title,HI=HiText), HI(LO=Frame,0)
The box color applies only to text items with the DIF_SEPARATOR and DIF_SEPARATOR2 flags set.
LO(LO=Title,HI=0), HI(0,0)
LO(LO=EditLine,HI=SelectText), HI(LO=UnchangedColor, HI=History&ComboBox pointer)
LO(LO=Title,HI=HiText), HI(0,0)
LO(LO=Title,HI=HiText), HI(0,0)
For the DI_LISTBOX item only the DN_CTLCOLORDLGLIST event is recieved.

Return

Color attribute (foreground+background) that the callback function should use to draw the dialog item.

Controls

ControlDescription
All Applies to all dialog items with the exception of DI_LISTBOX and DI_USERCONTROL

Remarks

Example

For example, this is how the macro assignment dialog in FAR Manager changes the color of input field:
/* 02 */ DI_EDIT,5,3,28,3,1,0,0,1,"",

case DN_CTLCOLORDLGITEM:
  // Unchanged resides in the Lo byte of the Hi word.
  Param2&=0xFF00FFFFU;
  Param2|=(Param2&0xFF)<<16;
  return Param2;
See also: