if ((hrgn = send_ncpaint( child, NULL, &erase_flags ))) send_erase( child, erase_flags, hrgn, NULL, NULL );
prev = 0;
break;
The problem is that this will cause children to be skipped too. What you really need is to repaint every window only once, but still recurse for children. Unfortunately that's a bit tricky to do with a stateless interface...
Now you tell me :-)
What about instead of the send_ncpaind/send_erase when child==prev (assuming this to be the more 'unusual' case and not the norm) I build a list of the hwnds and validate their update region. When the loop completes, for each hwnd left in the list I do the send_ncpaint/send_erase processing?
Without removing the update region there's no way to step further in the list, if I understand the problem correctly?
Jason