PaintMaxPasses example for C++ 4.0 and later

This example includes two procedures. First, a button click starts a multi-pass paint effect; then LEAD's PaintNotification event changes the direction of the effect on each pass.

void CTutorDlg::OnButton1() 
{
   m_Lead1.SetAutoRepaint(FALSE);

   // Set the effect
   m_Lead1.SetPaintEffect(EFX_EFFECT_WIPE_L_TO_R); 
   m_Lead1.SetPaintMaxPasses(5);    // 5 total passes
   m_Lead1.SetPaintPass(1);         // Start with pass number 1
   m_Lead1.SetPaintNotificationDelay(200); // Delay 200 milliseconds between passes
   m_Lead1.Load("c:\\lead\\images\\image1.cmp", 0, 0, 1);    // load the image
   m_Lead1.SetAutoRepaint(TRUE);
}

void CMfc40ocxDlg::OnPaintNotificationLead1(short uPass, short uType) 
{
  // If the first pass is complete
  if ((uType == EFX_NOTIFY_IMAGE) && (uPass > 0)) 
  {
    // Toggle the effect from left_to_right to right_to_left
    if (m_Lead1.GetPaintEffect()== EFX_EFFECT_WIPE_L_TO_R)
       m_Lead1.SetPaintEffect(EFX_EFFECT_WIPE_R_TO_L);
    else
       m_Lead1.SetPaintEffect(EFX_EFFECT_WIPE_L_TO_R);
  }
}