Current per-monitor DPI scale for this window (1.0 on a 96-DPI monitor, 2.0 on a Retina-class 192-DPI monitor, etc.). Falls back to 1.0 if the API is missing (pre-Win10 1607).
(hwnd: HWND)
| 273 | /// monitor, 2.0 on a Retina-class 192-DPI monitor, etc.). Falls |
| 274 | /// back to 1.0 if the API is missing (pre-Win10 1607). |
| 275 | pub fn dpi_scale(hwnd: HWND) -> f64 { |
| 276 | unsafe { |
| 277 | let dpi = GetDpiForWindow(hwnd); |
| 278 | if dpi == 0 { 1.0 } else { dpi as f64 / 96.0 } |
| 279 | } |
| 280 | } |
| 281 | |
| 282 | pub fn poll_events() { |
| 283 | unsafe { |