Alt + Tab changes to native size window even if resized

I have a problem, since my game is in windowed mode, with set resolution (by command r.SetRes), I need it to be able to resize window, or maximize window and stay that way. I am able to do it once, but when i hit Alt + Tab, or open another program and get back to my game, my game sets back windows size to original. How can I change this in C++?