whenDisplayable(w, new Runnable() {
public void run() {
GDI32 gdi = GDI32.INSTANCE;
User32 user = User32.INSTANCE;
HWND hWnd = getHWnd(w);
final HRGN result = gdi.CreateRectRgn(0, 0, 0, 0);
try {
if (rectangles == null) {
gdi.SetRectRgn(result, 0, 0, w.getWidth(), w
.getHeight());
} else {
final HRGN tempRgn = gdi.CreateRectRgn(0, 0, 0, 0);
try {
for (int i = 0; i < rectangles.length; i++) {
Rectangle rectangle = rectangles[i];
gdi.SetRectRgn(tempRgn, rectangle.x,
rectangle.y, rectangle.x