This example queries the disable-foreground attribute; if it is a valid attribute of the window, it is removed via WinRemovePresParam.
#define INCL_WINSYS #include <OS2.H> HWND hwnd; ULONG AttrFound; ULONG AttrValue[32]; ULONG cbRetLen; cbRetLen = WinQueryPresParam(hwnd, PP_DISABLEDFOREGROUNDCOLORINDEX, 0, &AttrFound, sizeof(AttrValue), &AttrValue, QPF_ID1COLORINDEX | QPF_NOINHERIT); if(PP_DISABLEDFOREGROUNDCOLORINDEX == AttrFound) WinRemovePresParam(hwnd, PP_DISABLEDFOREGROUNDCOLORINDEX);