Ask Learn
Preview
Please sign in to use this experience.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
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")
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.
This message has no return value.
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.
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));
Requirement | Value |
---|---|
Minimum supported client |
Windows 2000 Professional [desktop apps only] |
Minimum supported server |
Windows 2000 Server [desktop apps only] |
Header |
|
Unicode and ANSI names |
SETRGBSTRINGW (Unicode) and SETRGBSTRINGA (ANSI) |
Reference
Conceptual
Please sign in to use this experience.
Sign in