SETRGBSTRING message

The hook procedure of a Color dialog box, CCHookProc, can send the SETRGBSTRING registered message to the dialog box to set the current color selection.

#define SETRGBSTRING TEXT("commdlg_SetRGBColor")

Parameters

wParam

This parameter is not used.

lParam

The RGB value of the color to select in the Color dialog box. You can use the RGB macro to specify the red, green, and blue intensities of an RGB color value.

Return value

This message has no return value.

Remarks

If lParam matches one of the basic colors or one of the 16 custom colors, the dialog box procedure selects that color. The dialog box procedure also updates all the controls in the custom color extension of the Color dialog box, if it is open.

If lParam does not match a basic or custom color, the dialog box procedure does not change the current color selection, but it does update the custom color controls, if they are visible.

Examples

The following sample code gets the SETRGBSTRING message identifier and then sets the color selection to blue.

UINT uiSetRGB;

uiSetRGB = RegisterWindowMessage(SETRGBSTRING);

SendMessage(hdlg, uiSetRGB, 0, (LPARAM) RGB(0, 0, 255)); 

Requirements

Minimum supported client
Windows 2000 Professional [desktop apps only]
Minimum supported server
Windows 2000 Server [desktop apps only]
Header
Commdlg.h (include Windows.h)
Unicode and ANSI names
SETRGBSTRINGW (Unicode) and SETRGBSTRINGA (ANSI)

See also

Reference

RegisterWindowMessage

RGB

SendMessage

Conceptual

Common Dialog Box Library