2019-09-04 18:26:26 +02:00
|
|
|
#pragma once
|
|
|
|
|
#include "windef.h"
|
|
|
|
|
|
2019-12-17 12:32:56 +03:00
|
|
|
namespace DPIAware
|
|
|
|
|
{
|
|
|
|
|
constexpr inline int DEFAULT_DPI = 96;
|
2019-09-04 18:26:26 +02:00
|
|
|
|
2019-12-17 12:32:56 +03:00
|
|
|
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 EnableDPIAwarenessForThisProcess();
|
2019-12-16 14:28:14 +03:00
|
|
|
|
2019-12-17 12:34:45 +03:00
|
|
|
enum AwarnessLevel
|
2019-12-17 12:32:56 +03:00
|
|
|
{
|
|
|
|
|
UNAWARE,
|
|
|
|
|
SYSTEM_AWARE,
|
|
|
|
|
PER_MONITOR_AWARE,
|
|
|
|
|
PER_MONITOR_AWARE_V2,
|
|
|
|
|
UNAWARE_GDISCALED
|
|
|
|
|
};
|
2019-12-17 12:34:45 +03:00
|
|
|
AwarnessLevel GetAwarenessLevel(DPI_AWARENESS_CONTEXT system_returned_value);
|
2019-12-17 12:32:56 +03:00
|
|
|
};
|