1 /**
2  * This file has no copyright assigned and is placed in the Public Domain.
3  * This file is part of the mingw-w64 runtime package.
4  * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5  */
6 
7 #ifndef _SHELLSCALINGAPI_H_
8 #define _SHELLSCALINGAPI_H_
9 
10 #include <shtypes.h>
11 #include <winapifamily.h>
12 
13 #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
14 
15 #ifndef SCALING_ENUMS_DECLARED
16 typedef enum {
17   SCF_VALUE_NONE = 0x00,
18   SCF_SCALE = 0x01,
19   SCF_PHYSICAL = 0x02
20 } SCALE_CHANGE_FLAGS;
21 DEFINE_ENUM_FLAG_OPERATORS(SCALE_CHANGE_FLAGS);
22 
23 typedef enum {
24   DEVICE_PRIMARY = 0,
25   DEVICE_IMMERSIVE = 1
26 } DISPLAY_DEVICE_TYPE;
27 
28 #define SCALING_ENUMS_DECLARED
29 #endif /* SCALING_ENUMS_DECLARED */
30 
31 #if NTDDI_VERSION >= NTDDI_WIN8
32 STDAPI_(DEVICE_SCALE_FACTOR) GetScaleFactorForDevice(DISPLAY_DEVICE_TYPE deviceType);
33 STDAPI RegisterScaleChangeNotifications(DISPLAY_DEVICE_TYPE displayDevice, HWND hwndNotify, UINT uMsgNotify,
34   DWORD *pdwCookie);
35 STDAPI RevokeScaleChangeNotifications(DISPLAY_DEVICE_TYPE displayDevice, DWORD dwCookie);
36 #endif /* NTDDI_VERSION >= NTDDI_WIN8 */
37 
38 #ifndef DPI_ENUMS_DECLARED
39 typedef enum MONITOR_DPI_TYPE {
40   MDT_EFFECTIVE_DPI = 0,
41   MDT_ANGULAR_DPI = 1,
42   MDT_RAW_DPI = 2,
43   MDT_DEFAULT = MDT_EFFECTIVE_DPI
44 } MONITOR_DPI_TYPE;
45 
46 typedef enum PROCESS_DPI_AWARENESS {
47   PROCESS_DPI_UNAWARE = 0,
48   PROCESS_SYSTEM_DPI_AWARE = 1,
49   PROCESS_PER_MONITOR_DPI_AWARE = 2
50 } PROCESS_DPI_AWARENESS;
51 
52 #define DPI_ENUMS_DECLARED
53 #endif /* DPI_ENUMS_DECLARED */
54 
55 #if NTDDI_VERSION >= NTDDI_WINBLUE
56 STDAPI GetScaleFactorForMonitor(HMONITOR hMon, DEVICE_SCALE_FACTOR *pScale);
57 STDAPI RegisterScaleChangeEvent(HANDLE hEvent, DWORD_PTR *pdwCookie);
58 STDAPI UnregisterScaleChangeEvent(DWORD_PTR dwCookie);
59 
60 STDAPI GetDpiForMonitor(HMONITOR hmonitor, MONITOR_DPI_TYPE dpiType, UINT *dpiX, UINT *dpiY);
61 STDAPI GetProcessDpiAwareness(HANDLE hprocess, PROCESS_DPI_AWARENESS *value);
62 STDAPI SetProcessDpiAwareness(PROCESS_DPI_AWARENESS value);
63 #endif /* NTDDI_VERSION >= NTDDI_WINBLUE */
64 
65 #if NTDDI_VERSION >= NTDDI_WINTHRESHOLD
66 #ifndef SHELL_UI_COMPONENT_ENUMS_DECLARED
67 typedef enum {
68   SHELL_UI_COMPONENT_TASKBARS = 0,
69   SHELL_UI_COMPONENT_NOTIFICATIONAREA = 1,
70   SHELL_UI_COMPONENT_DESKBAND = 2
71 } SHELL_UI_COMPONENT;
72 
73 #define SHELL_UI_COMPONENT_ENUMS_DECLARED
74 #endif /* SHELL_UI_COMPONENT_ENUMS_DECLARED */
75 
76 UINT WINAPI GetDpiForShellUIComponent(SHELL_UI_COMPONENT component);
77 #endif /* NTDDI_VERSION >= NTDDI_WINTHRESHOLD */
78 
79 #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
80 #endif /* _SHELLSCALINGAPI_H_ */
81