You seem to not realize that painting also happens outside of the WM_PAINT handler, moreover some apps do not call EndPaint in WM_PAINT, or call it before they paint anything.
Yep effectively I realized it after sending my mail. Anyway, Alexandre think that this project is not a good choice for a GSoC project so I'll perhaps think about another project at least for the moment. However thanks to all for your help and your answers.
Ben.