This function returns the colors (one or more) that are currently being used by a control window of the type specified by clrType. If hwnd is a valid control window handle, the colors being used by that window are returned, including any presentation parameters it might be using. If hwnd is set to HWND_DESKTOP, the default colors being used by that window are returned.
To find out the default control colors for the current thread, specify CCF_APPLICATION. Be sure to issue the call to WinQueryColors from the same thread that created the control windows, otherwise the information returned will be incorrect.
To get all the colors used by a control window returned at once, specify CCF_ALLCOLORS. You can call WinQueryColors with CCF_COUNTCOLORS first to determine the buffer size you will need for the color information.
Each item in the returned array contains an index and value pair (CTLCOLOR). If CCF_ALLCOLORS and CCF_COUNTCOLORS are not set, each item's index should be set to a valid CCI_* constant for which a value is to be returned. The values returned in the array are always valid RGB colors (including SYSCLR_* values, which are actually indexes but can be used by graphics functions in RGB mode).
If an invalid CCI_* index is specified, CCV_NOTFOUND is returned.
Note: This function can only be used for querying the colors of standard PM controls.