summaryrefslogtreecommitdiff
path: root/alf/alfcompat.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'alf/alfcompat.cpp')
-rw-r--r--alf/alfcompat.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/alf/alfcompat.cpp b/alf/alfcompat.cpp
index 7b30eac..45f5f4a 100644
--- a/alf/alfcompat.cpp
+++ b/alf/alfcompat.cpp
@@ -492,6 +492,37 @@ ALF_Compat_fallbackLoadIconWithScaleDown(HINSTANCE hinst,
return E_NOTIMPL;
}
+static BOOL WINAPI
+ALF_Compat_fallbackGetMonitorInfoA(HMONITOR monitor, MONITORINFO *lpmi)
+{
+ if (monitor != (HMONITOR)0x12340042 || !lpmi || lpmi->cbSize != sizeof(MONITORINFO))
+ return FALSE;
+
+ lpmi->rcMonitor.left = 0;
+ lpmi->rcMonitor.top = 0;
+ lpmi->rcMonitor.right = GetSystemMetrics(SM_CXSCREEN);
+ lpmi->rcMonitor.bottom = GetSystemMetrics(SM_CYSCREEN);
+ SystemParametersInfoA(SPI_GETWORKAREA, 0, &lpmi->rcWork, 0);
+ lpmi->dwFlags = MONITORINFOF_PRIMARY;
+ return TRUE;
+}
+
+static HMONITOR WINAPI ALF_Compat_fallbackMonitorFromPoint(POINT pt, DWORD flags)
+{
+ (void)pt;
+ (void)flags;
+
+ return (HMONITOR)0x12340042; // like multimon.h
+}
+
+static HMONITOR WINAPI ALF_Compat_fallbackMonitorFromWindow(HWND window, DWORD flags)
+{
+ (void)window;
+ (void)flags;
+
+ return (HMONITOR)0x12340042; // like multimon.h
+}
+
static BOOL CALLBACK
ALF_Compat_DrawDisabledText_DrawStateProc(HDC hdc,
@@ -603,6 +634,9 @@ void ALF_LoadCompatFunctions(void)
LOAD_FUNC(user32, AdjustWindowRectExForDpi);
LOAD_FUNC(user32, GetSystemMetricsForDpi);
LOAD_FUNC(user32, SystemParametersInfoForDpi);
+ LOAD_FUNC(user32, GetMonitorInfoA);
+ LOAD_FUNC(user32, MonitorFromPoint);
+ LOAD_FUNC(user32, MonitorFromWindow);
*((FARPROC*)&ALF_Compat_TrackMouseEvent) = GetProcAddress(_alf_dll_comctl32, "_TrackMouseEvent");
if (!ALF_Compat_TrackMouseEvent)
@@ -761,3 +795,6 @@ HRESULT (WINAPI *ALF_Compat_GetThemeTransitionDuration)(HTHEME,int,int,int,int,D
HRESULT (WINAPI *ALF_Compat_GetThemeColor)(HTHEME,int,int,int,COLORREF*) = NULL;
HRESULT (WINAPI *ALF_Compat_GetThemeMargins)(HTHEME,HDC,int,int,int,const RECT *,MARGINS *) = NULL;
HRESULT (WINAPI *ALF_Compat_LoadIconWithScaleDown)(HINSTANCE,PCWSTR,int,int,HICON *) = NULL;
+BOOL (WINAPI *ALF_Compat_GetMonitorInfoA)(HMONITOR,MONITORINFO *) = NULL;
+HMONITOR (WINAPI *ALF_Compat_MonitorFromPoint)(POINT,DWORD) = NULL;
+HMONITOR (WINAPI *ALF_Compat_MonitorFromWindow)(HWND,DWORD) = NULL;