http://bugs.winehq.org/show_bug.cgi?id=10522
--- Comment #18 from Austin Lund austin.lund@gmail.com 2010-08-15 01:47:12 --- (In reply to comment #15)
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).
On further investigation, this seems to be the more important part.
BeginPaint() should leave the whole thing validated even under the conditions for this bug. This means that the validation should occur AFTER all the other window messages are sent and processed (such as WM_NCPAINT in this case). Currently it happens with a call of get_update_region to the wineserver before any of the messages are sent. Reversing this is probably the key.