Partager via


Providing Flicker-Free Activation

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at 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