On Windows 7, I'm trying to write something which overlays a top-level layered window above my app's main window to create some visual effects. The intention is to make it look like everything is part of the main window even though there's really another window above it rendering some of the effects.
It goes wrong if the main window is opening / closing / minimizing / etc. because of the DWM's animations. The top-level effects window is positioned so that it's on top of where GetWindowRect reports the main window to be, but the on-screen representation
of the main window isn't really there. The main window is being transformed & animated in 3D space away from or towards the reported window location. So my top-level effects window is sitting in space looking really weird and drawing its effects over other
windows. ![]()
I'd be happy to simply disable my effect while the DWM animations are playing. Problem is I can't see a way to detect them. I'd like to do it properly in case future OS versions make the animations longer or shorter. i.e. I'd prefer not to use a kludge that says "don't apply my effects if the window was only opened/restored/maximized 1 second ago."
(I don't want to turn off the DWM animations for the main window.)
There are a bunch of stats returned by DwmGetCompositionTimingInfo but I'm not sure if any of them are useful for detecting the animations. It's not very clear to me what the stats are for but I'm guessing it's to do with syncing multimedia or measuring performance rather than seeing what's going on with a particular window.
There's also some DWM APIs like DwmFlush, DwmAttachMilContent, DwmGetGraphicsStreamTransformHint, DwmGetGraphicsStreamClient which (despite dating back to Vista) still seem to be undocumented (beyond their argument/return types). Is there some fuller documentation for the DWM API somewhere that I'm missing?


Thread Closed
This thread is kinda stale and has been closed but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.