mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 03:37:59 +01:00
* Started work * I can't debug anything, cleaning * Added settings, [[Not Tested]] Not even compiled * Tested, the most basic features work * Refactor, add RestoreSize * Added DPI awareness * Fixed a potential issue with resizing zoned windows * Fixup: Potentially unsafe memory-layout of std::pair replaced with std::array * Fixup: Use .data() instead of a pointer * Further refactoring * Integrated Win+Arrow keys with the Restore size feature * Fixed an issue where window's on-screen position is not restored properly * Fixed a bug pointed out by Enrico
24 lines
674 B
C++
24 lines
674 B
C++
#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);
|
|
};
|