This function queries the colors currently being used by a control window.
Note: If you are interested in the default colors used by PM controls, see Colors Used by PM Controls.
#define INCL_WINSYS /* Or use INCL_WIN, INCL_PM, */ #include <os2.h> HWND hwnd; /* Window handle. */ LONG clrType; /* Control color index. */ ULONG fCtlColor; /* Control Color Flags. */ ULONG cCtlColor; /* Number of items available in pCtlColor. */ PCTLCOLOR pCtlColor; /* Array of control colors, each comprising an index and value pair. */ LONG rc; /* Number of control colors returned in pCtlColor. */ rc = WinQueryControlColors(hwnd, clrType, fCtlColor, cCtlColor, pCtlColor);