ShowColorDlg Example for C++ 5.0 and later

void CDialogs::OnShowColorDlg() 
{
   int nRet; 

   m_pRasterColorDlg->UIFlags = COLOR_SHOW_OLDCOLOR              |
                           COLOR_SHOW_NEWCOLOR              |
                           COLOR_SHOW_NAME                  |
                           COLOR_COLORSPACE_SHOW_HUE        |
                           COLOR_COLORSPACE_SHOW_BRIGHTNESS |
                           COLOR_COLORSPACE_SHOW_WHEEL      |
                           COLOR_COLORSPACE_SHOW_RGB        |
                           COLOR_COLORSPACE_SHOW_CMY        |
                           COLOR_COLORSPACE_SHOW_CMYK       |
                           COLOR_COLORSPACE_SHOW_LAB        |
                           COLOR_COLORMODEL_SHOW_RGB        |
                           COLOR_COLORMODEL_SHOW_HSB        |
                           COLOR_COLORMODEL_SHOW_HLS        |
                           COLOR_COLORMODEL_SHOW_CMY        |
                           COLOR_COLORMODEL_SHOW_CMYK       |
                           COLOR_COLORMODEL_SHOW_LAB; 

   m_pRasterColorDlg->SelectedColor= RGB ( 255, 255, 255 ); 
   m_pRasterColorDlg->Bitmap = m_LeadRasterView.GetRaster().GetBitmap ();

   nRet= m_pRasterColorDlg->ShowColorDlg((long)this->m_hWnd); 

   if ( nRet == 0 && m_pRasterColorDlg->DialogStatus ==DLG_OK ) 
   {
      m_pRasterProc->Fill (m_LeadRasterView.GetRaster (), m_pRasterColorDlg->SelectedColor ); 
   }
}