Providing Flicker-Free Activation

If your control draws itself identically in the inactive and active states (and does not use windowless activation), you can eliminate the drawing operations and the accompanying visual flicker that normally occur when making the transition between the inactive and active states. To do this, include the noFlickerActivate flag in the set of flags returned by COleControl::GetControlFlags. For example:

DWORD CMyAxOptCtrl::GetControlFlags()
{
   DWORD dwFlags = COleControl::GetControlFlags();
dwFlags |= noFlickerActivate;
return dwFlags;
}

The code to include this flag is automatically generated if you select the Flicker-Free activation option on the Control Settings page when creating your control with the MFC ActiveX Control Wizard.

If you are using windowless activation, this optimization has no effect.

See also

MFC ActiveX Controls: Optimization