diff --git a/dlls/api-ms-win-shcore-scaling-l1-1-1/api-ms-win-shcore-scaling-l1-1-1.spec b/dlls/api-ms-win-shcore-scaling-l1-1-1/api-ms-win-shcore-scaling-l1-1-1.spec index acf194ac33f..44c0e93261d 100644 --- a/dlls/api-ms-win-shcore-scaling-l1-1-1/api-ms-win-shcore-scaling-l1-1-1.spec +++ b/dlls/api-ms-win-shcore-scaling-l1-1-1/api-ms-win-shcore-scaling-l1-1-1.spec @@ -1,4 +1,4 @@ -@ stub GetDpiForMonitor +@ stdcall GetDpiForMonitor(long long ptr ptr) shcore.GetDpiForMonitor @ stdcall GetProcessDpiAwareness(long ptr) shcore.GetProcessDpiAwareness @ stub GetScaleFactorForDevice @ stub GetScaleFactorForMonitor diff --git a/dlls/shcore/Makefile.in b/dlls/shcore/Makefile.in index ec2e95f526f..8497198996d 100644 --- a/dlls/shcore/Makefile.in +++ b/dlls/shcore/Makefile.in @@ -1,4 +1,5 @@ MODULE = shcore.dll +IMPORTS = user32 gdi32 C_SRCS = \ main.c diff --git a/dlls/shcore/main.c b/dlls/shcore/main.c index 9075a38e1b4..9073bd12383 100644 --- a/dlls/shcore/main.c +++ b/dlls/shcore/main.c @@ -21,6 +21,8 @@ #include "windef.h" #include "winbase.h" +#include "wingdi.h" +#include "winuser.h" #include "shellscalingapi.h" #include "wine/debug.h" @@ -48,3 +50,17 @@ HRESULT WINAPI GetProcessDpiAwareness(HANDLE process, PROCESS_DPI_AWARENESS *val if (value) *value = PROCESS_DPI_UNAWARE; return S_OK; } + +HRESULT WINAPI GetDpiForMonitor(HMONITOR monitor, MONITOR_DPI_TYPE type, UINT *x, UINT *y) +{ + HDC hDC; + + FIXME("(%p, %u, %p, %p): semi-stub\n", monitor, type, x, y); + + hDC = GetDC(0); + if (x) *x = GetDeviceCaps(hDC, LOGPIXELSX); + if (y) *y = GetDeviceCaps(hDC, LOGPIXELSY); + ReleaseDC(0, hDC); + + return S_OK; +} diff --git a/dlls/shcore/shcore.spec b/dlls/shcore/shcore.spec index 374fafbceb2..958c91f88de 100644 --- a/dlls/shcore/shcore.spec +++ b/dlls/shcore/shcore.spec @@ -7,7 +7,7 @@ @ stub DllGetActivationFactory @ stdcall -private DllGetClassObject(ptr ptr ptr) shell32.DllGetClassObject @ stdcall GetCurrentProcessExplicitAppUserModelID(ptr) shell32.GetCurrentProcessExplicitAppUserModelID -@ stub GetDpiForMonitor +@ stdcall GetDpiForMonitor(long long ptr ptr) @ stub GetDpiForShellUIComponent @ stdcall GetProcessDpiAwareness(long ptr) @ stub GetProcessReference