well it is hard to figure out what you are talking about, but I think you
should look up

CDC::IntersectClipRect