From e4487d3fd51791cd79a3764f931ccc4527a769ea Mon Sep 17 00:00:00 2001 From: "Yaqing Mi (from Dev Box)" Date: Tue, 22 Apr 2025 17:01:59 +0800 Subject: [PATCH] Resolve Spelling errors --- src/common/UITestAutomation/Session.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/common/UITestAutomation/Session.cs b/src/common/UITestAutomation/Session.cs index d6c33dbb2d..403ed01a29 100644 --- a/src/common/UITestAutomation/Session.cs +++ b/src/common/UITestAutomation/Session.cs @@ -789,13 +789,19 @@ namespace Microsoft.PowerToys.UITest [DllImport("user32.dll")] public static extern int GetSystemMetrics(int nIndex); - private const int SMCXSCREEN = 0; - private const int SMCYSCREEN = 1; + public enum SystemMetric + { + ScreenWidth = 0, // Width of the primary screen in pixels (SM_CXSCREEN) + ScreenHeight = 1, // Height of the primary screen in pixels (SM_CYSCREEN) + VirtualScreenWidth = 78, // Width of the virtual screen that includes all monitors (SM_CXVIRTUALSCREEN) + VirtualScreenHeight = 79, // Height of the virtual screen that includes all monitors (SM_CYVIRTUALSCREEN) + MonitorCount = 80, // Number of display monitors (SM_CMONITORS, available on Windows XP+) + } public static (int CenterX, int CenterY) GetScreenCenter() { - int width = GetSystemMetrics(SMCXSCREEN); - int height = GetSystemMetrics(SMCYSCREEN); + int width = GetSystemMetrics((int)SystemMetric.ScreenWidth); + int height = GetSystemMetrics((int)SystemMetric.ScreenHeight); return (width / 2, height / 2); }