# Set DPI Programmatically in Windows
## Setting DPI Scaling
### Via command line:
[GitHub - imniko/SetDPI](https://github.com/imniko/SetDPI)
This one seems relatively promising.
### Via Windows system API:
[SystemParametersInfoW function (winuser.h) - Win32 apps](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-systemparametersinfow)
See `SPI_GETLOGICALDPIOVERRIDE - 0x009E`.
It seems like the parameter for scaling is an integer, where 0 is the "recommended" setting you’d see in the Windows settings panel. A value of ±X will change the scaling by (X * 25%) in either direction from the recommended value, ergo there might be an issue of having to figure out what the recommended scale factor is and adjust based on that.
**This API is discouraged by Microsoft.**
### Via PowerShell:
[Force 100% DPI Scaling for all screens even if the default value is different](https://gist.github.com/itsho/cc4f0c66d3283a6b54582fde31b70a26)
## Example API calls & demo apps:
[How can I change Windows 10 Display Scaling Programmatically using C#](https://stackoverflow.com/a/57397039)
#windows