I'm calling GetClientRect
via pinvoke in C# to get dimensions of a panel (on WindowsForm) I'm using as DirectX render target area. I would've thought that WinAPI gives me the unscaled (i.e. returned values should be the same regardless of Windows display DPI settings) dimensions, but it appears to give me the scaled one instead (at least on Windows 8.1 as I have not tested it on other OSes).
The ClientRectangle
property also returns the same scaled dimensions as GetClientRect
. This remains the same when I've changed the form AutoScaleMode
to none
.
Is that the expected behavior with GetClientRect
? If so, how do I get the unscaled dimensions?
EDIT: This only affects Windows 8.1. Tested it on Windows 7 and GetClientRect returns the unscaled dimensions!