|
Overview |
|
|
|
Group |
|
|
|
Quick Info
Windows NT
| Yes
| Win95
| Yes
| Win32s
| Yes
| Import Library
| comdlg32.lib
| Header File
| commdlg.h
| Unicode
| WinNT
| Platform Notes
| None
|
|
|
ChooseColor
The ChooseColor function creates a Color common dialog box that enables the user to select a
color.
BOOL ChooseColor(
LPCHOOSECOLOR lpcc
| // pointer to structure with initialization data
| );
|
|
Parameters
lpcc
Pointer to a CHOOSECOLOR structure that contains information used to initialize the dialog box. When ChooseColor returns, this structure contains information about the user's color
selection.
Return Values
If the user clicks the OK button of the dialog box, the return value is
nonzero. The rgbResult member of the CHOOSECOLOR structure contains the RGB color value of the color selected by the user.
If the user cancels or closes the Color dialog box or an error occurs, the
return value is zero. To get extended error information, call the CommDlgExtendedError function, which can return one of the following values:
CDERR_FINDRESFAILURE
| CDERR_MEMLOCKFAILURE
| CDERR_INITIALIZATION
| CDERR_NOHINSTANCE
| CDERR_LOCKRESFAILURE
| CDERR_NOHOOK
| CDERR_LOADRESFAILURE
| CDERR_NOTEMPLATE
| CDERR_LOADSTRFAILURE
| CDERR_STRUCTSIZE
| CDERR_MEMALLOCFAILURE
|
|
Remarks
The Color dialog box does not support palettes. The color choices offered by
the dialog box are limited to the system colors and dithered versions of those
colors.
You can provide a CCHookProc hook procedure for a Color dialog box. The hook procedure can process
messages sent to the dialog box. To enable a hook procedure, set the CC_ENABLEHOOK
flag in the Flags member of the CHOOSECOLOR structure and specify the address of the hook procedure in the lpfnHook member.
See Also
CCHookProc, CHOOSECOLOR, CommDlgExtendedError
Related Links
Software for Delphi and C++ Builder developers
Software for Visual Studio .NET developers
Software for Visual Basic 6 developers
Delphi Tips&Tricks
MegaDetailed.NET
TMS Scripter Studio Pro components for Delphi/C++Builder
More Online Helps
Win32 Multimedia Programmer's Reference (mmedia.hlp)
OLE Programmer's Reference (ole.hlp)
Microsoft Windows Pen API Programmer's Reference (penapi.hlp)
Microsoft Windows Sockets 2 Reference (sock2.hlp)
Microsoft Windows Telephony API (TAPI) Programmer's Reference (tapi.hlp)
Unix Manual Pages
|