http://bugs.winehq.org/show_bug.cgi?id=10522
--- Comment #15 from Austin Lund austin.lund@gmail.com 2009-07-09 00:59:10 --- There seem to be two confounding effects here.
a) When DispatchMessage() is called on a WM_PAINT message in wine, the WNDPROC is called and then _after_ it has done what it does, if parts of the window are still marked as invalid they are updated using GetUpdateRgn(..,..,TRUE). This doesn't seem to happen in windows. The WM_NCPAINT and WM_ERASEBACKGROUND messages seem to be processed in a WM_PAINT message _before_ the WNDPROC is called.
b) When BeginPaint() is called and a WM_NCPAINT message is processed within it, the window is marked as invalid in wine when BeginPaint() returns. In windows a BeginPaint() seems to mark everything as clean even if WM_NCPAINT called RedrawWindow(..,..,..,0x401).