SETRGBSTRING

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

MessageID = RegisterWindowMessage(SETRGBSTRING);
wParam = 0;
lParam = (COLORREF) rgbColor;

Parameters

rgbColor

Specifies 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 Values

No return value.

Remarks

If rgbColor 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 rgbColor 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.

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

UINT uiSetRGB;

uiSetRGB = RegisterWindowMessage(SETRGBSTRING);

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

See Also

RegisterWindowMessage, RGB, SendMessage