# DIF_DISABLE

The DIF_DISABLE flag directs the Dialog Manager to disable this item. It means that such dialog element will not receive input focus and will not respond to mouse, but at the same time a control with this flag set can be changed programmatically.

### Controls

The DIF_DISABLE flag is applicable to the following dialog items:

Control | Description
--- | ---
All | All dialog items can be disabled.

### Remarks

1. To change Enabled/Disabled state of a control, send the DM_ENABLE message to the Dialog Manager (using the SendDlgMessage function).
2. Disabled edit controls are displayed using the COL_DIALOGEDITDISABLED color. If you want to change the color of a control, you must add the following code to the dialog handler:

       ...
       if(msg == DN_CTLCOLORDLGITEM)
       {
         if(Param1 >= 9 && Param1 <= 13)
         {
           int Lo=(int)Info.AdvControl(Info.ModuleNumber,ACTL_GETCOLOR,(void*)COL_DIALOGEDIT);
           int Hi=(int)Info.AdvControl(Info.ModuleNumber,ACTL_GETCOLOR,(void*)COL_DIALOGEDITSELECTED);
           return (LONG_PTR)MAKELONG(MAKEWORD(Lo,Hi),MAKEWORD(Lo,Hi));
         }
       }
       ...

   In this example, predefined colors for disabled items are modified to match colors corresponding to the normal state of the edit control.

See also: