aboutsummaryrefslogtreecommitdiff
path: root/src/dutil/inc/dpiutil.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/dutil/inc/dpiutil.h')
-rw-r--r--src/dutil/inc/dpiutil.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/src/dutil/inc/dpiutil.h b/src/dutil/inc/dpiutil.h
new file mode 100644
index 00000000..c6f73b02
--- /dev/null
+++ b/src/dutil/inc/dpiutil.h
@@ -0,0 +1,55 @@
1#pragma once
2// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
3
4
5#ifdef __cplusplus
6extern "C" {
7#endif
8
9// from WinUser.h
10#ifndef WM_DPICHANGED
11#define WM_DPICHANGED 0x02E0
12#endif
13#ifndef USER_DEFAULT_SCREEN_DPI
14#define USER_DEFAULT_SCREEN_DPI 96
15#endif
16
17typedef struct _DPIU_WINDOW_CONTEXT
18{
19 UINT nDpi;
20} DPIU_WINDOW_CONTEXT;
21
22typedef HRESULT (APIENTRY *PFN_GETDPIFORMONITOR)(
23 __in HMONITOR hmonitor,
24 __in MONITOR_DPI_TYPE dpiType,
25 __in UINT* dpiX,
26 __in UINT* dpiY
27 );
28typedef UINT (APIENTRY *PFN_GETDPIFORWINDOW)(
29 __in HWND hwnd
30 );
31
32void DAPI DpiuInitialize();
33void DAPI DpiuUninitialize();
34
35/********************************************************************
36 DpiuGetWindowContext - get the DPI context of the given window.
37
38*******************************************************************/
39void DAPI DpiuGetWindowContext(
40 __in HWND hWnd,
41 __in DPIU_WINDOW_CONTEXT* pWindowContext
42 );
43
44/********************************************************************
45 DpiuScaleValue - scale the value to the target DPI.
46
47*******************************************************************/
48int DAPI DpiuScaleValue(
49 __in int nDefaultDpiValue,
50 __in UINT nTargetDpi
51 );
52
53#ifdef __cplusplus
54}
55#endif