Resolve incorrect desktop application window sizes by calculating client area dimensions using system metrics for borders and title bars.