Francois Gouget : user32/tests: Trace monitor information with 'monitor info'.

Alexandre Julliard julliard at winehq.org
Wed Apr 27 16:12:13 CDT 2022


Module: wine
Branch: master
Commit: 57b38565967510b8f43436613952a1c787b91fb1
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=57b38565967510b8f43436613952a1c787b91fb1

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Wed Apr 27 15:22:32 2022 +0200

user32/tests: Trace monitor information with 'monitor info'.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/user32/tests/monitor.c | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/dlls/user32/tests/monitor.c b/dlls/user32/tests/monitor.c
index 02bc6651dd3..94cb7e60382 100644
--- a/dlls/user32/tests/monitor.c
+++ b/dlls/user32/tests/monitor.c
@@ -2530,9 +2530,38 @@ static void test_display_dc(void)
     }
 }
 
+BOOL CALLBACK MonitorEnumProc(HMONITOR hMonitor, HDC hdcMonitor,
+                              LPRECT lprcMonitor, LPARAM dwData)
+{
+    MONITORINFOEXW info;
+    static int index;
+
+    info.cbSize = sizeof(info);
+    if (GetMonitorInfoW(hMonitor, (MONITORINFO*)&info))
+    {
+        printf("Monitor %d %7s [%02lx] %s %s\n", index,
+              (info.dwFlags & MONITORINFOF_PRIMARY) ? "primary" : "",
+               info.dwFlags, wine_dbgstr_rect(&info.rcMonitor),
+               wine_dbgstr_w(info.szDevice));
+    }
+    index++;
+    return TRUE;
+}
+
 START_TEST(monitor)
 {
+    char** myARGV;
+    int myARGC = winetest_get_mainargs(&myARGV);
+
     init_function_pointers();
+
+    if (myARGC >= 3 && strcmp(myARGV[2], "info") == 0)
+    {
+        printf("Monitor information:\n");
+        EnumDisplayMonitors(NULL, NULL, MonitorEnumProc, 0);
+        return;
+    }
+
     test_enumdisplaydevices();
     test_ChangeDisplaySettingsEx();
     test_DisplayConfigSetDeviceInfo();




More information about the wine-cvs mailing list