
Transparency and Top-Level Windows
The window manager process (in both Windows Vista and Microsoft Windows XP) only really processes Win32 HWNDs, therefore every WPF Window is an HWND. The Window HWND must abide by the general rules for any HWND. Within that HWND, WPF code can do whatever the overall WPF APIs support. But for interactions with other HWNDs on the desktop, WPF must abide by Win32 processing and rendering rules. WPF supports non-rectangular windows by using Win32 APIs—HRGNs for non-rectangular windows, and layered windows for a per-pixel alpha.
Constant alpha and color keys are not supported. Win32 layered window capabilities vary by platform.
Layered windows can make the entire window translucent (semi-transparent) by specifying an alpha value to apply to every pixel in the window. (Win32 in fact supports per-pixel alpha, but this is very difficult to use in practical programs because in this mode you would need to draw any child HWND yourself, including dialogs and dropdowns).
WPF supports HRGNs; however, there are no managed APIs for this functionality. You can use platform invoke and HwndSource to call the relevant Win32 APIs. For more information, see Calling Native Functions from Managed Code
WPF layered windows have different capabilities on different operating systems (this is because WPF uses DirectX to render, and layered windows were primarily designed for GDI rendering, not DirectX rendering):
WPF supports hardware accelerated layered windows on Windows Vista. Hardware accelerated layered windows on Microsoft Windows XP require support from Microsoft DirectX, so the capabilities will depend on the version of Microsoft DirectX on that machine.
WPF does not support transparency color keys, because WPF cannot guarantee to render the exact color you requested, particularly when rendering is hardware-accelerated.
If running on Microsoft Windows XP, layered windows on top of DirectX surfaces flicker when the DirectX application renders. (The actual rendering sequence is that Microsoft Windows Graphics Device Interface (GDI) hides the layered window, then DirectX draws, and then Microsoft Windows Graphics Device Interface (GDI) puts the layered window back). Non-WPF layered windows also have this limitation.