diff --git a/resources/desktop-picker.ps1 b/resources/desktop-picker.ps1 index ebdf5ae..a16d03b 100644 --- a/resources/desktop-picker.ps1 +++ b/resources/desktop-picker.ps1 @@ -8,7 +8,7 @@ Write-PickLog ("=== start Mode=$Mode ===") Add-Type -AssemblyName UIAutomationClient, UIAutomationTypes, WindowsBase 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);" -Name PickW32 -Namespace RpaPick | Out-Null +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);' -Name PickW32 -Namespace RpaPick | Out-Null Write-PickLog "w32 ok" if ($Mode -eq "windows") { $wins = @() @@ -48,7 +48,7 @@ function Set-HighlightBox([int]$x, [int]$y, [int]$w, [int]$h) { } function Hide-Highlight { $hl.Hide() } function Get-DeepestAtPoint([double]$px, [double]$py) { - $point = New-Object System.Windows.Automation.Point($px, $py) + $point = New-Object System.Windows.Point($px, $py) $cur = [System.Windows.Automation.AutomationElement]::FromPoint($point) if (-not $cur) { return $null } for ($depth = 0; $depth -lt 25; $depth++) {