Hello, I have a window with controls, that i create during the wm_paint message. I've put the creation of the controls in an If Statement so that they are created only once. Now, when i minimize the window, and then maximize it again, all the controls, except the Static ones, disappear. If i hover them with my mouse they appear again. if i remove the If Statement, so that they are created in every WM_PAINT message, they don't disappear ofcourse, but why would i create the controls over and over..? in my WM_PAINT message i return DefWindowProc(). any idea why this is happening?
You should not create them in paint but you should create them before and keep reference to them to be used in paint.