The default window procedure calls WinRealizePalette with a NULL parameter. This causes the default palette to be realized. If the return value from WinRealizePalette is greater than 0, the default window procedure invalidates the window, causing it to be repainted with the newly-realized palette.