IHtmlDlgSafeHelper::ChooseColorDlg Method

Opens the system color-selection dialog box.


HRESULT ChooseColorDlg(
    VARIANT initColor,
    VARIANT *rgbColor


[in] 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.
[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

Returns S_OK if successful, or an error value otherwise.


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.