ChooseColor

The ChooseColor function creates a Color common dialog box that enables the user to select a color.

dword ChooseColor(
  dword color,
  dword flag,
  dword hwnd
);
 

Parameters

color
If the CC_RGBINIT flag is set, color specifies the color initially selected when the dialog box is created. If the specified color value is not among the available colors, the system selects the nearest solid color available. If rgbResult is zero or CC_RGBINIT is not set, the initially selected color is black.
flag
A set of bit flags that you can use to initialize the Color common dialog box. This member can be a combination of the following flags:
Flag Meaning
CC_ANYCOLOR Causes the dialog box to display all available colors in the set of basic colors.
CC_FULLOPEN Causes the dialog box to display the additional controls that allow the user to create custom colors. If this flag is not set, the user must click the Define Custom Color button to display the custom color controls.
CC_PREVENTFULLOPEN Disables the Define Custom Colors button.
CC_RGBINIT Causes the dialog box to use the color specified in the color parameter as the initial color selection.
CC_SOLIDCOLOR Causes the dialog box to display only solid colors in the set of basic colors.
 
hwnd
Identifies the window that owns the dialog box. This member can be any valid window handle, or it can be NULL if the dialog box has no owner.

Return Values

If the user clicks the OK button, the return value is user's color selection.

Otherwise, the return value is inputed color parameter.

Example

local currentColor=COLOR_BLACK
currentColor=wnd.ChooseColor(currentColor,orDWORD(CC_RGBINIT,CC_FULLOPEN))