There are lots of things you need to be doing and the first one that I have seen is you have invalidated in the WM_PAINT. Do you find any reason to be doing that.

I guess what needs to be done is explained in my prev post. You need to be doing with care as you have no good experience on handling the issues and after running your program the machine tends to become quite slow and so you need to be handling the paint a bit in a better way.