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