Force iconic representation except when Flip3D is used
In an application of mine, I want to have the Peek preview set to a bitmap that I am generating.
As a result, I call DwmSetWindowAttribute to set DWMWA_HAS_ICONIC_BITMAP and DWMWA_FORCE_ICONIC_REPRESENTATION to TRUE.
This works, I'm receiving the WM_DWMSENDICONICTHUMBNAIL and WM_DWMSENDICONICLIVEPREVIEWBITMAP messages just fine.
However, there is one issue when using the Flip3D (Win-Tab) feature in that it's the thumbnail that gets requested, not the live preview.
Not setting DWMWA_FORCE_ICONIC_REPRESENTATION to TRUE means that I don't get the WM_DWMSENDICONIC messages, so I can't remove it permanently.
However, if the application is notified when Flip3D is starting/stopping, then I can set DWMWA_FORCE_ICONIC_REPRESENTATION to FALSE and TRUE accordingly.
Do you know if and how the application is notified when Flip3D is starting/stopping?
There is no notification of Flip3D activity. The DWM messages are your only indication. When dealing with live previews, make sure you are calling DwmInvalidateIconicBitmaps() whenever your window contents change so that Windows knows it needs to request an updated bitmap from you.