It worked well in Windows 8.1. But since I updated to Windows 10, GetWindowRect returns rectangle which is too big.
If I make screenshot from window (using ALT+PRINT keys) it gives me correct size of 794x578 Pixels. If I use GetWindowRect it gives me 808x585 pixels.
I have two Monitors with different resolutions. This Problem occurs on both Monitors.