Read Microsoft documentation:
By the way, this kind of thing is somehow hard to do with the API (and just a bit better with MFC) as message are sent to the parent windows instead of the control itself. This make it harder to make reusable controls.
WinForms (and WPF) are hundredth of time better for that. The color can be set directly in the designer or a single line of code is required to set the color in code.