typedef struct _COLORDLGPARAMS
{
L_UINT uStructSize;
COLORREF crColor;
L_UINT32 uColorSpace;
L_UINT32 uColorModel;
HPALETTE hpalCustom;
L_UINT32 uDlgFlags;
LTCOMMDLGHELPCB pfnHelpCallback;
L_VOID *pHelpCallBackUserData;
} COLORDLGPARAMS,* LPCOLORDLGPARAMS;
The COLORDLGPARAMS structure provides information used to initialize the dialog box created by the L_DlgColor function. After the user closes the dialog box, this structure is updated with information about the user's selections.
Size of this structure, in bytes. Use the sizeof operator to calculate this value.
A COLORREF that holds the color picked by the user of the dialog. The initial value of this color sets the initial color selected at the dialog and the color will be remain visible at the top-left corner of the dialog box. You can specify a COLORREF value, such as the return value of the Windows RGB macro, or you can use the PALETTEINDEX macro to specify a palette color.
A variable to be updated with the color space selected when the dialog closed. Set this to indicate the initial color space to display in the dialog. Possible values are:
Value | Meaning |
---|---|
DLG_COLOR_COLORSPACE_SHOW_HUE | [0x00000010] HSB-Hue Based color space. |
DLG_COLOR_COLORSPACE_SHOW_BRIGHTNESS | [0x00000020] HSB-Brightness Based color space. |
DLG_COLOR_COLORSPACE_SHOW_WHEEL | [0x00000040] HSB-Wheel Based color space. |
DLG_COLOR_COLORSPACE_SHOW_RGB | [0x00000080] RGB-3D Additive color space. |
DLG_COLOR_COLORSPACE_SHOW_CMY | [0x00000100] CMY-3D Subtractive color space. |
DLG_COLOR_COLORSPACE_SHOW_CMYK | [0x00000200] CMYK-3D Subtractive color space. |
DLG_COLOR_COLORSPACE_SHOW_LAB | [0x00000400] LAB- Device Independent color space. |
A variable to be updated with the color model selected when the dialog closed. Set this to indicate the initial color model to display in the dialog. Acceptable values are:
Value | Meaning |
---|---|
DLG_COLOR_COLORMODEL_SHOW_RGB | [0x00000800] RGB color values. |
DLG_COLOR_COLORMODEL_SHOW_HSB | [0x00001000] HSB color values. |
DLG_COLOR_COLORMODEL_SHOW_HLS | [0x00002000] HLS color values. |
DLG_COLOR_COLORMODEL_SHOW_CMY | [0x00004000] CMY color values. |
DLG_COLOR_COLORMODEL_SHOW_CMYK | [0x00008000] CMYK color values. |
DLG_COLOR_COLORMODEL_SHOW_LAB | [0x00010000] LAB color values. |
A handle to a palette. If this contains a valid handle, the dialog will display only the colors in this palette, no available color spaces will be displayed, and only color values from this palette can be selected.
User interface flags for this dialog, hich determine the layout and action of the dialog. Possible values are:
Value | Meaning |
---|---|
DLG_COLOR_SHOW_CONTEXTHELP | [0x00000001] dialog should contain a context sensitive help icon. |
DLG_COLOR_SHOW_OLDCOLOR | [0x00000002] dialog should contain the Old color in a static control. |
DLG_COLOR_SHOW_NEWCOLOR | [0x00000004] dialog should contain the New color in a static control. |
DLG_COLOR_SHOW_NAME | [0x00000008] dialog should contain the name in a static control. |
DLG_COLOR_COLORSPACE_SHOW_HUE | [0x00000010] dialog should contain the HSB-Hue Based color space |
DLG_COLOR_COLORSPACE_SHOW_BRIGHTNESS | [0x00000020] dialog should contain the HSB-Brightness Based color space |
DLG_COLOR_COLORSPACE_SHOW_WHEEL | [0x00000040] dialog should contain the HSB-Wheel Based color space. |
DLG_COLOR_COLORSPACE_SHOW_RGB | [0x00000080] dialog should contain the RGB-3D Additive color space. |
DLG_COLOR_COLORSPACE_SHOW_CMY | [0x00000100] dialog should contain the CMY-3D Subtractive color space. |
DLG_COLOR_COLORSPACE_SHOW_CMYK | [0x00000200] dialog should contain the CMYK-3D Subtractive color space. |
DLG_COLOR_COLORSPACE_SHOW_LAB | [0x00000400] dialog should contain the LAB- Device Independent color space. |
DLG_COLOR_COLORMODEL_SHOW_RGB | [0x00000800] dialog should contain the RGB color values display. |
DLG_COLOR_COLORMODEL_SHOW_HSB | [0x00001000] dialog should contain the HSB color values display. |
DLG_COLOR_COLORMODEL_SHOW_HLS | [0x00002000] dialog should contain the HLS color values display. |
DLG_COLOR_COLORMODEL_SHOW_CMY | [0x00004000] dialog should contain the CMY color values display. |
DLG_COLOR_COLORMODEL_SHOW_CMYK | [0x00008000] dialog should contain the CMYK color values display. |
DLG_COLOR_COLORMODEL_SHOW_LAB | [0x00010000] dialog should display the LAB color values display. |
Pointer to an optional help callback function. If you do not wish to provide help to this dialog, use NULL as the value of this parameter. To provide help to this dialog, use the function pointer as the value of this parameter. The callback function must adhere to the prototype described in LTCOMMDLGHELPCB.
Void pointer that you can use to pass one or more additional parameters that the callback function needs. To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID *. The callback function, which receives the address in its own pHelpCallBackUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure. If the additional parameters are not needed, you can pass NULL in this parameter.