int flags = user.GetWindowLong(hWnd, User32.GWL_EXSTYLE);
JRootPane root = ((RootPaneContainer)w).getRootPane();
JLayeredPane lp = root.getLayeredPane();
if (transparent && !isTransparent(w)) {
flags |= User32.WS_EX_LAYERED;
user.SetWindowLong(hWnd, User32.GWL_EXSTYLE, flags);
lp.add(new W32RepaintTrigger(), JLayeredPane.DRAG_LAYER);
}
else if (!transparent && isTransparent(w)) {
flags &= ~User32.WS_EX_LAYERED;
user.SetWindowLong(hWnd, User32.GWL_EXSTYLE, flags);