From 4ad238ff37a323b042b33924463a8595a13864df Mon Sep 17 00:00:00 2001 From: yu <191972707@qq.com> Date: Fri, 30 Oct 2026 14:16:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=A1=8C=E9=9D=A2=E6=8B=BE=E5=8F=96?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=E8=A1=A5=20DPI=20=E6=84=9F=E7=9F=A5=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B7=B7=E5=90=88=E7=BC=A9=E6=94=BE=E4=B8=8B?= =?UTF-8?q?=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 --- resources/desktop-picker.ps1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/resources/desktop-picker.ps1 b/resources/desktop-picker.ps1 index cc87d57..0d0fbf3 100644 --- a/resources/desktop-picker.ps1 +++ b/resources/desktop-picker.ps1 @@ -7,6 +7,9 @@ function Write-PickLog([string]$msg) { } Write-PickLog ("=== start Mode=$Mode ===") Add-Type -AssemblyName UIAutomationClient, UIAutomationTypes, WindowsBase +Add-Type -MemberDefinition "[DllImport("user32.dll")] public static extern bool SetProcessDpiAwarenessContext(IntPtr value);" -Name PickDpi -Namespace RpaPick | Out-Null +try { [RpaPick.PickDpi]::SetProcessDpiAwarenessContext([IntPtr](-4)) | Out-Null } catch {} +Write-PickLog "dpi aware set" Add-Type -AssemblyName System.Windows.Forms Write-PickLog "assemblies ok" Add-Type -MemberDefinition '[DllImport("user32.dll")] public static extern short GetAsyncKeyState(int key); [DllImport("user32.dll", CharSet = CharSet.Unicode)] public static extern int GetWindowTextW(IntPtr h, System.Text.StringBuilder sb, int max); [DllImport("user32.dll")] public static extern int GetWindowLong(IntPtr hWnd, int nIndex); [DllImport("user32.dll")] public static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);' -Name PickW32 -Namespace RpaPick | Out-Null