hwnds and the DWM

I wrote that "All Avalon elements on the screen are ultimately backed by hwnds."  Yep, even on Longhorn.  One of the changes we made to USER and Win32k.sys in Longhorn is that when the DWM is on, all top-level windows (Avalon or otherwise) are rendered to an offscreen bitmap.  And that implementation is mostly the same as layered windows; a good portion of the work in USER these days is performance and compatibility tweaks for that code path.  Which is also why there's a good chance of us fixing most Avalon layered window issues on Longhorn (although not guaranteed, since layered windows aren't exactly the same as DWM top-level windows)

On a sidenote, when we talk about DWM most people think about the output redirection part of it -- taking applications that were designed to render directly to the screen and "redirecting" their output to an offscreen bitmap which the DWM can then draw wherever it wants.  But most people, including within the Avalon team, overlook input redirection -- it doesn't matter where that window is drawn if mouse input doesn't get to that window.  So the DWM tells USER where each window is so it can direct input as appropriate, as well as how each window is scaled.