Do not send bogus WM_SIZE messages, use SetWindowPos instead. Remove iStatusBarHeight from globals and use IsWindowVisible and GetWindowRect when you need to take into account status bar size.
From looking at microsoft examples, said examples send WM_SIZE to the status bar and let it reposition itself.
And also, said examples store the status bar height for later use (presumably because calling IsWindowVisible and GetWindowRect multiple times is slower than saving it and reusing it later)
I dont know if there is one example that does both things but I do know that both things are done by microsoft example code.