size.cy = h;
POINT loc = new POINT();
loc.x = alphaWindow.getX();
loc.y = alphaWindow.getY();
POINT srcLoc = new POINT();
BLENDFUNCTION blend = new BLENDFUNCTION();
blend.SourceConstantAlpha = (byte)(alpha * 255);
blend.AlphaFormat = User32.AC_SRC_ALPHA;
user.UpdateLayeredWindow(hWnd, screenDC, loc, size, memDC, srcLoc,
0, blend, User32.ULW_ALPHA);
}
finally {
user.ReleaseDC(null, screenDC);
if (hBitmap != null) {
gdi.SelectObject(memDC, oldBitmap);
gdi.DeleteObject(hBitmap);
}
gdi.DeleteDC(memDC);
}
}
else if (a) {
BLENDFUNCTION blend = new BLENDFUNCTION();
blend.SourceConstantAlpha = (byte)(alpha * 255);
blend.AlphaFormat = User32.AC_SRC_ALPHA;
user.UpdateLayeredWindow(hWnd, null, null, null, null, null,
0, blend, User32.ULW_ALPHA);
}