aboutsummaryrefslogtreecommitdiff
path: root/src/dutil/inc
diff options
context:
space:
mode:
Diffstat (limited to 'src/dutil/inc')
-rw-r--r--src/dutil/inc/dpiutil.h55
-rw-r--r--src/dutil/inc/dutilsources.h1
-rw-r--r--src/dutil/inc/thmutil.h6
3 files changed, 62 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
diff --git a/src/dutil/inc/dutilsources.h b/src/dutil/inc/dutilsources.h
index c88ada37..bf3da16f 100644
--- a/src/dutil/inc/dutilsources.h
+++ b/src/dutil/inc/dutilsources.h
@@ -19,6 +19,7 @@ typedef enum DUTIL_SOURCE
19 DUTIL_SOURCE_DICTUTIL, 19 DUTIL_SOURCE_DICTUTIL,
20 DUTIL_SOURCE_DIRUTIL, 20 DUTIL_SOURCE_DIRUTIL,
21 DUTIL_SOURCE_DLUTIL, 21 DUTIL_SOURCE_DLUTIL,
22 DUTIL_SOURCE_DPIUTIL,
22 DUTIL_SOURCE_DUTIL, 23 DUTIL_SOURCE_DUTIL,
23 DUTIL_SOURCE_ESEUTIL, 24 DUTIL_SOURCE_ESEUTIL,
24 DUTIL_SOURCE_FILEUTIL, 25 DUTIL_SOURCE_FILEUTIL,
diff --git a/src/dutil/inc/thmutil.h b/src/dutil/inc/thmutil.h
index e661a6cb..52de755f 100644
--- a/src/dutil/inc/thmutil.h
+++ b/src/dutil/inc/thmutil.h
@@ -255,6 +255,10 @@ struct THEME
255 DWORD dwFontId; 255 DWORD dwFontId;
256 HANDLE hIcon; 256 HANDLE hIcon;
257 LPWSTR sczCaption; 257 LPWSTR sczCaption;
258 int nDefaultDpiHeight;
259 int nDefaultDpiMinimumHeight;
260 int nDefaultDpiWidth;
261 int nDefaultDpiMinimumWidth;
258 int nHeight; 262 int nHeight;
259 int nMinimumHeight; 263 int nMinimumHeight;
260 int nWidth; 264 int nWidth;
@@ -283,6 +287,8 @@ struct THEME
283 DWORD dwCurrentPageId; 287 DWORD dwCurrentPageId;
284 HWND hwndTooltip; 288 HWND hwndTooltip;
285 289
290 UINT nDpi;
291
286 // callback functions 292 // callback functions
287 PFNTHM_EVALUATE_VARIABLE_CONDITION pfnEvaluateCondition; 293 PFNTHM_EVALUATE_VARIABLE_CONDITION pfnEvaluateCondition;
288 PFNTHM_FORMAT_VARIABLE_STRING pfnFormatString; 294 PFNTHM_FORMAT_VARIABLE_STRING pfnFormatString;