13 user32_ = fml::NativeLibrary::Create(
"user32.dll");
15 user32_->ResolveFunction<GetPointerType_*>(
"GetPointerType");
17 user32_->ResolveFunction<GetPointerInfo_*>(
"GetPointerInfo");
18 get_pointer_pen_info_ =
19 user32_->ResolveFunction<GetPointerPenInfo_*>(
"GetPointerPenInfo");
20 enable_non_client_dpi_scaling_ =
21 user32_->ResolveFunction<EnableNonClientDpiScaling_*>(
22 "EnableNonClientDpiScaling");
23 set_window_composition_attribute_ =
24 user32_->ResolveFunction<SetWindowCompositionAttribute_*>(
25 "SetWindowCompositionAttribute");
26 adjust_window_rect_ext_for_dpi_ =
27 user32_->ResolveFunction<AdjustWindowRectExForDpi_*>(
28 "AdjustWindowRectExForDpi");
36 POINTER_INPUT_TYPE* pointer_type)
const {
37 if (!get_pointer_type_.has_value()) {
41 return get_pointer_type_.value()(pointer_id, pointer_type);
45 POINTER_INFO* pointer_info)
const {
46 if (!get_pointer_info_.has_value()) {
50 return get_pointer_info_.value()(pointer_id, pointer_info);
55 POINTER_PEN_INFO* pointer_pen_info)
const {
56 if (!get_pointer_pen_info_.has_value()) {
60 return get_pointer_pen_info_.value()(pointer_id, pointer_pen_info);
66 PULONG length)
const {
67 return ::GetThreadPreferredUILanguages(flags, count, languages, length);
71 HIGHCONTRAST high_contrast = {.cbSize =
sizeof(HIGHCONTRAST)};
72 if (!::SystemParametersInfoW(SPI_GETHIGHCONTRAST,
sizeof(HIGHCONTRAST),
77 return high_contrast.dwFlags & HCF_HIGHCONTRASTON;
81 BOOL composition_enabled;
83 return composition_enabled;
94 LPCWSTR cursor_name)
const {
95 return ::LoadCursorW(instance, cursor_name);
99 return ::SetCursor(cursor);
103 if (!enable_non_client_dpi_scaling_.has_value()) {
107 return enable_non_client_dpi_scaling_.value()(hwnd);
113 if (!set_window_composition_attribute_.has_value()) {
117 return set_window_composition_attribute_.value()(hwnd, data);
122 const MARGINS* pMarInset)
const {
123 return ::DwmExtendFrameIntoClientArea(hwnd, pMarInset);
129 DWORD cbAttribute)
const {
130 return ::DwmSetWindowAttribute(hwnd, dwAttribute, pvAttribute, cbAttribute);
138 if (!adjust_window_rect_ext_for_dpi_.has_value()) {
142 return adjust_window_rect_ext_for_dpi_.value()(lpRect, dwStyle, bMenu,
147 return ::GetSystemMetrics(nIndex);
152 PDISPLAY_DEVICE lpDisplayDevice,
153 DWORD dwFlags)
const {
154 return ::EnumDisplayDevices(lpDevice, iDevNum, lpDisplayDevice, dwFlags);
159 DEVMODEW* lpDevMode)
const {
160 return ::EnumDisplaySettingsW(lpszDeviceName, iModeNum, lpDevMode);
164 LPMONITORINFO lpmi)
const {
165 return ::GetMonitorInfoW(hMonitor, lpmi);
170 MONITORENUMPROC lpfnEnum,
171 LPARAM dwData)
const {
172 return ::EnumDisplayMonitors(hdc, lprcClip, lpfnEnum, dwData);
virtual HRESULT DwmFlush() const
virtual BOOL GetPointerInfo(UINT32 pointer_id, POINTER_INFO *pointer_info) const
virtual BOOL GetPointerPenInfo(UINT32 pointer_id, POINTER_PEN_INFO *pointer_pen_info) const
virtual BOOL GetPointerType(UINT32 pointer_id, POINTER_INPUT_TYPE *pointer_type) const
virtual HCURSOR LoadCursor(HINSTANCE instance, LPCWSTR cursor_name) const
virtual int GetSystemMetrics(int nIndex) const
virtual HCURSOR SetCursor(HCURSOR cursor) const
virtual bool GetHighContrastEnabled() const
virtual ~WindowsProcTable()
virtual BOOL EnumDisplayDevices(LPCWSTR lpDevice, DWORD iDevNum, PDISPLAY_DEVICE lpDisplayDevice, DWORD dwFlags) const
virtual BOOL AdjustWindowRectExForDpi(LPRECT lpRect, DWORD dwStyle, BOOL bMenu, DWORD dwExStyle, UINT dpi) const
virtual BOOL EnableNonClientDpiScaling(HWND hwnd) const
virtual HRESULT DwmExtendFrameIntoClientArea(HWND hwnd, const MARGINS *pMarInset) const
virtual bool DwmIsCompositionEnabled() const
virtual BOOL EnumDisplaySettings(LPCWSTR lpszDeviceName, DWORD iModeNum, DEVMODEW *lpDevMode) const
virtual HRESULT DwmSetWindowAttribute(HWND hwnd, DWORD dwAttribute, LPCVOID pvAttribute, DWORD cbAttribute) const
virtual BOOL GetMonitorInfo(HMONITOR hMonitor, LPMONITORINFO lpmi) const
virtual BOOL EnumDisplayMonitors(HDC hdc, LPCRECT lprcClip, MONITORENUMPROC lpfnEnum, LPARAM dwData) const
virtual LRESULT GetThreadPreferredUILanguages(DWORD flags, PULONG count, PZZWSTR languages, PULONG length) const
virtual BOOL SetWindowCompositionAttribute(HWND hwnd, WINDOWCOMPOSITIONATTRIBDATA *data) const