Nel caso di una finestra "vetrata" (In cui lo stile Aero Glass è abilitato attraverso le API "DwmExtendFrameIntoClientArea" o "DwmEnableBlurBehindWindow") non è possibile utilizzare la modilità double buffered che in .NET è impostabile attraverso la proprietà "DoubleBuffered".
Per eliminare lo sfarfallio nel caso in si presenti è sufficiente applicare alla finetstra le proprietà WS_EX_LAYERED e WS_EX_COMPOSITED.
In .NET è sufficiente sovrascrivere la proprietà CreateParams nel seguente modo:
protected override CreateParams CreateParams
{
get
{
CreateParams cp = base.CreateParams;
cp.ExStyle |= 0x02000000; // WS_EX_COMPOSITED
cp.ExStyle |= 0x00080000; // WS_EX_LAYERED
return cp;
}
}
Mentre in VC++ bisogna impostare lo stile nel seguente modo:
::SetWindowLong (hWnd, GWL_EXSTYLE, ::GetWindowLong (hWnd, GWL_EXSTYLE) | WS_EX_LAYERED | WS_EX_COMPOSITED);
dove hWnd è l'handle di finestra e cui applicare lo stile.