The DwmSetWindowAttribute
function might be able to help you. It lets you modify a number of window attributes related to the DWM. In particular, the DWMWA_TRANSITIONS_FORCEDISABLED
attribute mentions "Enable or forcibly disable DWM transitions", which just might do the trick.
HRESULT hr = S_OK;
LPCVOID dwAttribute = (LPCVOID)TRUE;
hr = DwmSetWindowAttribute(hWnd, DWMWA_TRANSITIONS_FORCEDISABLED,
&dwAttribute, sizeof(dwAttribute));
if (SUCCEEDED(hr))
{
// The transitions should have been disabled
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…