Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jsf-2/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
获取PowerShell中的窗口位置和大小_Powershell_Ui Automation - Fatal编程技术网

获取PowerShell中的窗口位置和大小

获取PowerShell中的窗口位置和大小,powershell,ui-automation,Powershell,Ui Automation,我正在寻找一种使用PowerShell获取窗口当前大小和位置的方法。我目前正在使用UIAutomation()包执行其他一些窗口操作,因此,如果有人碰巧知道如何通过PowerShell执行操作,无论是否使用该包,我都很想知道 谢谢 Get-UIAWindow似乎还有一些我不知道的附加属性。使用BoundingRectange属性,我能够获得有关窗口位置、大小以及相对位置的所有详细信息 以下内容将返回有关Notepad.exe应用程序窗口的大量数据: $test = Start-Process n

我正在寻找一种使用PowerShell获取窗口当前大小和位置的方法。我目前正在使用UIAutomation()包执行其他一些窗口操作,因此,如果有人碰巧知道如何通过PowerShell执行操作,无论是否使用该包,我都很想知道


谢谢

Get-UIAWindow似乎还有一些我不知道的附加属性。使用BoundingRectange属性,我能够获得有关窗口位置、大小以及相对位置的所有详细信息

以下内容将返回有关Notepad.exe应用程序窗口的大量数据:

$test = Start-Process notepad.exe -PassThru | Get-UiaWindow #| Get-UiaCurrentPattern -PassThru<br/>

$test.Current.BoundingRectangle
$test=Start Process notepad.exe-PassThru | Get UiaWindow#| Get UiaCurrentPattern-PassThru
$test.Current.BoundingRectangle
您能显示一些代码吗?可以通过多种方式获得任何窗口的大小和位置。尤其是当您拥有相关窗口的句柄时。Get-UIAWindow-ProcessId($PID).Id-AutomationId$autoID该对象是否能够提供其他属性?我没有使用UIAutomation,我仔细查看了Get-UIAWindow的不同属性,我想我找到了我想要的东西。下面将返回有关Notepad.exe应用程序窗口的大量数据:$test=Start Process Notepad.exe-PassThru | Get UiaWindow#| Get UiaCurrentPattern-PassThru$test.Current.BoundingRectangle