Color Dialog Control Set | CodeGuru

Color Dialog Control Set

Environment: VC6 SP4 (with newest platform SDK for GDI+) There are three controls included with the demo project, which are CLumChooser, CHusSatChooser and CColorBox. To make use of these controls, you can simply add a custom control to your dialog template and specific the correct Windows class name (which is declared inside CtrlSetting.h) You are […]

Written By
CodeGuru Staff
CodeGuru Staff
Apr 18, 2002
1 minute read
CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

Environment: VC6 SP4 (with newest platform SDK for GDI+)

There are three controls included with the demo project, which are
CLumChooser, CHusSatChooser and CColorBox.

To make use of these controls, you can simply add a custom control to your dialog template and specific the correct Windows class name (which is declared inside CtrlSetting.h)


You are then required to add code to your dialog implementation file:

1) Add necessary DDX_Control to DoDataExchange

  DDX_Control(pDX, IDC_COLORBOX1, m_box[0]);
  DDX_Control(pDX, IDC_COLORBOX2, m_box[1]);
  DDX_Control(pDX, IDC_COLORBOX3, m_box[2]);
  DDX_Control(pDX, IDC_COLORBOX4, m_box[3]);
  DDX_Control(pDX, IDC_LUMCHOOSER, m_LumChooser);
  DDX_Control(pDX, IDC_HUESAT, m_HueSatChooser);

2) Add necessare Macros and routines to handle child notification

ON_NOTIFY(CHueSatChooser::NM_COLORCHANGE,
          IDC_HUESAT,
          OnHueSatChange)
ON_NOTIFY(CLumChooser::NM_COLORCHANGE,
          IDC_LUMCHOOSER,
          OnLumChange)
ON_NOTIFY(CColorBox::NM_BOXCLICK,
          IDC_COLORBOX1,
          OnColorBoxClick)
ON_NOTIFY(CColorBox::NM_BOXCLICK,
          IDC_COLORBOX2,
          OnColorBoxClick)
ON_NOTIFY(CColorBox::NM_BOXCLICK,
          IDC_COLORBOX3,
          OnColorBoxClick)
ON_NOTIFY(CColorBox::NM_BOXCLICK,
          IDC_COLORBOX4,
          OnColorBoxClick)
afx_msg void OnHueSatChange(NMHDR * pNotifyStruct,
                            LRESULT * result );
afx_msg void OnLumChange(NMHDR * pNotifyStruct,
                         LRESULT * result );
afx_msg void OnColorBoxClick(NMHDR * pNotifyStruct,
                             LRESULT * result );

If there is any kind of bugs or memory leaks, please let me know.

Have fun.

Downloads

Download demo project – 23 Kb

CodeGuru Logo

CodeGuru covers topics related to Microsoft-related software development, mobile development, database management, and web application programming. In addition to tutorials and how-tos that teach programmers how to code in Microsoft-related languages and frameworks like C# and .Net, we also publish articles on software development tools, the latest in developer news, and advice for project managers. Cloud services such as Microsoft Azure and database options including SQL Server and MSSQL are also frequently covered.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.