Progress bar saves previous state.Code:case WM_SIZE: SendMessage(hsb, WM_SIZE, 0, 0); {RECT WindowRect; GetWindowRect(hwnd, &WindowRect); int width = WindowRect.right-WindowRect.left; SetWindowPos(hProgress, HWND_NOTOPMOST, 20, 150, width-20, 17, 0); break;}