forked from microsoft/PowerToys
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdpi_aware.h
More file actions
23 lines (20 loc) · 674 Bytes
/
dpi_aware.h
File metadata and controls
23 lines (20 loc) · 674 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#pragma once
#include "windef.h"
namespace DPIAware
{
constexpr inline int DEFAULT_DPI = 96;
HRESULT GetScreenDPIForWindow(HWND hwnd, UINT& dpi_x, UINT& dpi_y);
HRESULT GetScreenDPIForPoint(POINT p, UINT& dpi_x, UINT& dpi_y);
void Convert(HMONITOR monitor_handle, int& width, int& height);
void InverseConvert(HMONITOR monitor_handle, int& width, int& height);
void EnableDPIAwarenessForThisProcess();
enum AwarenessLevel
{
UNAWARE,
SYSTEM_AWARE,
PER_MONITOR_AWARE,
PER_MONITOR_AWARE_V2,
UNAWARE_GDISCALED
};
AwarenessLevel GetAwarenessLevel(DPI_AWARENESS_CONTEXT system_returned_value);
};