A Windows console application that displays resolution and scaling information for all connected monitors.
- Lists all connected monitors
- Shows current resolution for each monitor
- Displays DPI scaling percentage
- Identifies the primary monitor
- Supports modern DPI awareness (Windows 8.1+) with fallback for older systems
- Windows Vista or later (Windows 8.1+ recommended for full DPI support)
- Delphi 10.3 or later (for compilation)
- Open
DisplayInfo.dprojin Delphi - Select Build Configuration (Debug or Release)
- Select Platform (Win32 or Win64)
- Press F9 to compile and run, or Shift+F9 to compile only
dcc32 DisplayInfo.dprOr for 64-bit:
dcc64 DisplayInfo.dprThe project follows a clean output structure:
- Executables:
Win32\Debug\orWin32\Release\ - DCU files:
Win32\Debug\dcu\orWin32\Release\dcu\
Simply run the executable:
DisplayInfo.exeMonitors, Resolution and Scaling:
---
Device: \\.\DISPLAY1
Primary Monitor: Yes
Resolution (current): 3840x2160 pixels
Scaling: ~150% (DPI ~144)
---
Device: \\.\DISPLAY2
Primary Monitor: No
Resolution (current): 1920x1080 pixels
Scaling: ~100% (DPI ~96)
---
Note: 96 DPI = 100% scaling (effective DPI, if available).
Press Enter to continue...
This project follows the Delphi Style Guide included in the repository.
Key conventions:
- 2 spaces indentation
- Local variables prefixed with
L - Parameters prefixed with
A - Global variables prefixed with
G - XML documentation comments for public APIs
- Proper error handling with
try..finallyblocks
The application uses two methods to ensure proper DPI awareness:
- Modern (Windows 8.1+): Uses
SetProcessDpiAwarenessfromShcore.dll - Legacy (Windows Vista+): Falls back to
SetProcessDPIAwarefromuser32.dll
Monitor information is retrieved using:
EnumDisplayMonitors- Enumerates all display monitorsGetMonitorInfo- Gets monitor information including device name and primary statusEnumDisplaySettings- Gets current display resolutionGetDpiForMonitor- Gets effective DPI (Windows 8.1+)GetDeviceCapswithLOGPIXELSX- Fallback DPI detection
This project is licensed under the MIT License - see the LICENSE file for details.
Copyright (c) 2025 Olaf Monien