Quote Originally Posted by AKE View Post
hsb - handle of status bar.
It doesn't matter whether it is a status bar or any other window.

Quote Originally Posted by AKE View Post
I tried comment "SendMessage(hsb, WM_SIZE, 0, 0);" - it didn't help me.
Well, this line must be removed because it is wrong. Either use MoveWindow or SetWindowPos or send some used defined message to the status bar window and implement its resizing while handling this message.

Now define "application close". How exactly does it happen? Without any error message? without any message in the Windows Event Viewer?