Support for layered windows


One piece of feedback we’ve heard loud and clear is that you want layered windows.  Well, I’m happy to announce that based on your feedback, we now plan to officially support layered windows in WPF 1.0, coming to a future CTP near you (not necessarily the next CTP, though, it will be the next CTP with major WPF changes).


The details: HwndSource (or more accurately, HwndSourceParameters) will have a constructor parameter for UsesPerPixelOpacity.  Setting this to true will enable layered windows w/ a per-pixel alpha channel.  Window will behave the same as today — UsesPerPixelOpacity=false, but Popup change to UsesPerPixelOpacity=true.  UsesPerPixelOpacity=true has a couple implications:



  • All rendering for that hwnd will be done in software (no hardware acceleration)
  • We won’t draw a window frame (no WS_CAPTION)
  • Transparent pixels will not be hit test or get mouse input
  • HwndHost is not supported inside a UsesPerPixelOpacity=true container

The last three stem directly from Win32k.sys’s layered windows behavior.  In terms of hardware acceleration, we’re still trying to work out what’s possible on various platforms with reasonable performance & reliability, but didn’t want to block all progress on that investigation.


Standard disclaimer — all product plans are subject to change, this is not a guarantee, etc. etc.


Comments (8)

  1. Themes says:

    Really nice news!

    If you will not do it, we have to do some hard workarounds. Thank you to free our hands 🙂

  2. Anonymous says:

    "All rendering for that hwnd will be done in software (no hardware acceleration)"

    Would be interesting to hear why. Since layered windows need to be composited, I assume they will be hardware RGBA textures at some point. Hardware (TNT and up) has no problems rendering to RGBA textures, writing Alpha.

    So, why no hw accel?

  3. Florian Krüsch says:

    I assume that will not a Vista only feature?

  4. Joku says:

    > Would be interesting to hear why. Since layered windows need to be composited, I assume they will be hardware RGBA textures at some point. Hardware (TNT and up) has no problems rendering to RGBA textures, writing Alpha.

    I’d also like to hear what’s the major difficulty with doing this in HW.

    But if I could choose between better gfx transparency tricks such as layered windows and the ability to have a managed stream as source for video/audio easily, I’d go with the latter.

  5. It’s out, and there’s been a lot of great work since the last major CTP.   Layered Windows…

  6. Florian Krüsch says:

    that’s great news 🙂 Is it still true that it’s not hardware accelerated at all or did you find a way for that?

  7. A feature that the WPF team added late to WPF was the ability to allow transparent windows ( property