Export (0) Print
Expand All

ChooseColorDlg method

[This documentation is preliminary and is subject to change.]

Opens the system color-selection dialog box.


HRESULT retVal = object.ChooseColorDlg(initColor, );

Standards information

There are no standards that apply here.


initColor [in, optional]


A VARIANT that specifies the RGB value of the initial color selected in the color-selection dialog box. The value is specified as 0xrrggbb where rr is the red hex value, gg is the green hex value, and bb is the blue hex value. For a complete list of colors, see Color Table.

rgbColor [out, retval]


A pointer to a VARIANT that specifies the decimal value of the color chosen in the color-selection dialog box. The value must be converted to its hexadecimal equivalent and is specified as 0xrrggbb.

Return value


If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.


There is no way to persist custom colors in this dialog box.

The return value of this method must be converted from decimal to hexadecimal before it can be used to change the collor of an object. The hexadecimal number must contain six digits to represent the RRGGBB schema required by the color table. For numbers with less than six numbers, concatenate zeros to the beginning of the number. For more information, see the Color Table.

IHtmlDlgSafeHelper::ChooseColorDlg was introduced in Microsoft Internet Explorer 6.



Build date: 6/6/2012

Community Additions

© 2014 Microsoft