No Render-Output after resizing

Hi there,

I came across an issue with my rendering code. As the title says, I get no render output at specific window sizes. For example at 508x525 and less the expected output is visible, but at ~ 552x552 and higher it is not.
Here is my Code:
WndProc

I changed it the way you suggested but it didn't changed anything. Also your Code is hardly readable, try using the [highlight=cpp][/highlight] tag instead of the code tag. However thanks for your quick reply.