From 093fc302fab36f58cb92c7d4d73f0bfd0649c08b Mon Sep 17 00:00:00 2001 From: yu <191972707@qq.com> Date: Wed, 28 Oct 2026 15:33:27 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=A1=8C=E9=9D=A2=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E5=BC=BA=E5=88=B6=20Per-Monitor=20DPI=20=E6=84=9F=E7=9F=A5?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E5=A4=8D=E5=A4=9A=E5=B1=8F=E7=BC=A9=E6=94=BE?= =?UTF-8?q?=E4=B8=8B=E7=82=B9=E5=87=BB=E5=9D=90=E6=A0=87=E9=94=99=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/capabilities/desktop-uia.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/capabilities/desktop-uia.ts b/src/main/capabilities/desktop-uia.ts index 5788f8f..ae04d13 100644 --- a/src/main/capabilities/desktop-uia.ts +++ b/src/main/capabilities/desktop-uia.ts @@ -52,7 +52,10 @@ export function parseUiaSelector(raw: unknown): UiaSelector { return selector; } -const UIA_USING = "Add-Type -AssemblyName UIAutomationClient, UIAutomationTypes;"; +const UIA_USING = [ + "Add-Type -AssemblyName UIAutomationClient, UIAutomationTypes;", + "try { Add-Type -MemberDefinition '[DllImport(\"user32.dll\")] public static extern bool SetProcessDpiAwarenessContext(IntPtr value);' -Name RpaDpi -Namespace WinRpaDpi | Out-Null; [WinRpaDpi.RpaDpi]::SetProcessDpiAwarenessContext([IntPtr](-4)) | Out-Null } catch {}" +].join("\n"); const FIND_HELPER = ` function Find-RpaWindow([string]$winName) { @@ -354,3 +357,4 @@ register("Element_WaitElementGround", waitElementGround); +