CWindowPaper added and some refactoring