Group window settings into structs. Include rect sizes in regular and maximized state and maximized flag. Use them instead of manipulations with string names.