From abeba64d77336b3fbf9aafe9ecc66b779c1e5d02 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Mon, 6 Jul 2020 16:22:38 +1000 Subject: Add ability for ThemeCreateParentWindow to center on the monitor. --- src/dutil/inc/dpiutil.h | 15 +++++++++++++++ src/dutil/inc/thmutil.h | 7 +++++++ 2 files changed, 22 insertions(+) (limited to 'src/dutil/inc') diff --git a/src/dutil/inc/dpiutil.h b/src/dutil/inc/dpiutil.h index c6f73b02..8c61ab19 100644 --- a/src/dutil/inc/dpiutil.h +++ b/src/dutil/inc/dpiutil.h @@ -14,6 +14,12 @@ extern "C" { #define USER_DEFAULT_SCREEN_DPI 96 #endif +typedef struct _DPIU_MONITOR_CONTEXT +{ + UINT nDpi; + MONITORINFOEXW mi; +} DPIU_MONITOR_CONTEXT; + typedef struct _DPIU_WINDOW_CONTEXT { UINT nDpi; @@ -32,6 +38,15 @@ typedef UINT (APIENTRY *PFN_GETDPIFORWINDOW)( void DAPI DpiuInitialize(); void DAPI DpiuUninitialize(); +/******************************************************************** + DpiuGetMonitorContextFromPoint - get the DPI context of the monitor from the given point. + +*******************************************************************/ +HRESULT DAPI DpiuGetMonitorContextFromPoint( + __in const POINT* pt, + __out DPIU_MONITOR_CONTEXT** ppMonitorContext + ); + /******************************************************************** DpiuGetWindowContext - get the DPI context of the given window. diff --git a/src/dutil/inc/thmutil.h b/src/dutil/inc/thmutil.h index c75f9587..1ba5db35 100644 --- a/src/dutil/inc/thmutil.h +++ b/src/dutil/inc/thmutil.h @@ -81,6 +81,12 @@ typedef enum THEME_SHOW_PAGE_REASON THEME_SHOW_PAGE_REASON_REFRESH, } THEME_SHOW_PAGE_REASON; +typedef enum THEME_WINDOW_INITIAL_POSITION +{ + THEME_WINDOW_INITIAL_POSITION_DEFAULT, + THEME_WINDOW_INITIAL_POSITION_CENTER_MONITOR_FROM_COORDINATES, +} THEME_WINDOW_INITIAL_POSITION; + struct THEME_COLUMN { @@ -394,6 +400,7 @@ HRESULT DAPI ThemeCreateParentWindow( __in_opt HWND hwndParent, __in_opt HINSTANCE hInstance, __in_opt LPVOID lpParam, + __in THEME_WINDOW_INITIAL_POSITION initialPosition, __out_opt HWND* phWnd ); -- cgit v1.2.3-55-g6feb