From: Zhiyi Zhang zzhang@codeweavers.com
--- dlls/windows.ui/Makefile.in | 2 +- dlls/windows.ui/accessibilitysettings.c | 11 +++++++++-- dlls/windows.ui/tests/uisettings.c | 13 +++++-------- 3 files changed, 15 insertions(+), 11 deletions(-)
diff --git a/dlls/windows.ui/Makefile.in b/dlls/windows.ui/Makefile.in index e6b49738898..5bef78b300e 100644 --- a/dlls/windows.ui/Makefile.in +++ b/dlls/windows.ui/Makefile.in @@ -1,5 +1,5 @@ MODULE = windows.ui.dll -IMPORTS = combase advapi32 +IMPORTS = combase advapi32 user32
SOURCES = \ accessibilitysettings.c \ diff --git a/dlls/windows.ui/accessibilitysettings.c b/dlls/windows.ui/accessibilitysettings.c index a04d59a6cd8..f1dfe588b75 100644 --- a/dlls/windows.ui/accessibilitysettings.c +++ b/dlls/windows.ui/accessibilitysettings.c @@ -99,8 +99,15 @@ static HRESULT WINAPI accessibilitysettings_GetTrustLevel(IAccessibilitySettings static HRESULT WINAPI accessibilitysettings_get_HighContrast(IAccessibilitySettings *iface, boolean *value) { - FIXME("iface %p, value %p stub!\n", iface, value); - return E_NOTIMPL; + HIGHCONTRASTW high_contrast = {.cbSize = sizeof(high_contrast)}; + + TRACE("iface %p, value %p.\n", iface, value); + + if (!SystemParametersInfoW(SPI_GETHIGHCONTRAST, sizeof(high_contrast), &high_contrast, 0)) + return E_FAIL; + + *value = !!(high_contrast.dwFlags & HCF_HIGHCONTRASTON); + return S_OK; }
static HRESULT WINAPI accessibilitysettings_get_HighContrastScheme(IAccessibilitySettings *iface, diff --git a/dlls/windows.ui/tests/uisettings.c b/dlls/windows.ui/tests/uisettings.c index 3abf62730ec..4ab05d14ddd 100644 --- a/dlls/windows.ui/tests/uisettings.c +++ b/dlls/windows.ui/tests/uisettings.c @@ -378,15 +378,12 @@ static void test_AccessibilitySettings(void) check_interface( inspectable, &IID_IAccessibilitySettings, TRUE );
hr = IAccessibilitySettings_get_HighContrast( settings, &value ); - todo_wine ok( hr == S_OK, "Got unexpected hr %#lx.\n", hr ); - if ( hr == S_OK ) - { - high_contrast.cbSize = sizeof(high_contrast); - ret = SystemParametersInfoW( SPI_GETHIGHCONTRAST, sizeof(high_contrast), &high_contrast, 0 ); - ok( ret, "SystemParametersInfoW failed, error %lu.\n", GetLastError() ); - ok( value == !!(high_contrast.dwFlags & HCF_HIGHCONTRASTON), "Got unexpected high contrast value.\n" ); - } + + high_contrast.cbSize = sizeof(high_contrast); + ret = SystemParametersInfoW( SPI_GETHIGHCONTRAST, sizeof(high_contrast), &high_contrast, 0 ); + ok( ret, "SystemParametersInfoW failed, error %lu.\n", GetLastError() ); + ok( value == !!(high_contrast.dwFlags & HCF_HIGHCONTRASTON), "Got unexpected high contrast value.\n" );
IAccessibilitySettings_Release( settings ); IInspectable_Release( inspectable );