GetWindowRgn returns ERROR for a window rendered under Aero Glass, while it returns a region that outlines the rounded window corners with Aero Glass turned off. Perhaps this is to be expected, since it similarly returns ERROR for per-pixel WS_EX_LAYERED windows in XP.
But is there any way to obtain a 32-bit bitmap with alpha values for a specific HWND Or if not that, a way to obtain the non-transparent region of a window I basically want to capture the image (following the rounded corners in the titlebar) of a window without the windows that show up behind it.
Tim

Capture alpha bitmap for a window / GetWindowRgn under Vista
SIYER
You cannot capture the contents of the glass frame without capturing what's behind, but you can display them using the DWM Thumbnails APIs.
You can capture the screen using BitBlt(), with the CAPTUREBLT flag to include layered windows.
You can also capture a window using PrintWindow(), but it will have a Basic frame. Note that the Basic frame uses a window region, not alpha values for the rounded corners.
PrintWindow() will always paint a Basic frame, whereas sending WM_PRINT will leave it up to the application - it will do it only if the application passes the message to DefWindowProc().
Adminanup
Bump. I'm also curious how to capture a window while preserving transparencies.
Namely, if we have an HWND, can we just get its HDC and call alphablend to get its bits onto an in memory 32-bit bitmap I understand the complexity here is that the glass effect is not just a transparency effect, but rather a blur, which can't be represented in static pixels, but there should still be a way to preserve the per-pixel alpha values of the rounded corners of windows correct
Any help on this would be appreciated.