protected void setMask(final Component w, final Rectangle[] rectangles) {
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());