autohotkey - WinGetPos 返回负坐标
问题描述
我正在尝试获取窗口的位置和大小。但是,我看到在任何全屏窗口上我的 X 和 Y 都为 -9。
WinGetTitle, WT, A
WinGet, WID, ID, A
WinGetPos, X, Y, Width, Height, %WT%
ListVars
WinWaitActive ahk_class AutoHotkey
ControlSetText Edit1, [Title]`r`n%WT%`r`n[ID]`r`n%WID%`r`n[Dimensions]`r`nX: %X%`r`nY: %Y%`r`nWidth: %Width%`r`nHeight: %Height%
WinWaitClose
上述代码的输出是:
[Title]
Stuff.ahk - SciTE4AutoHotkey
[ID]
0x4e079a
[Dimensions]
X: -9
Y: -9
Width: 1938
Height: 1048
只是我的决心导致了这种情况吗?当我使用窗口间谍时,我可以清楚地看到窗口的左上角是绝对的 0,0 或窗口的 9,9。
知道为什么会这样吗?
解决方案
客户区是从窗口区域到屏幕的 0x0 的 -9 xy。这就是它的样子。
推荐阅读
- javascript - 帮助查找包含模运算符的 if 语句中的模式
- sql - SQL Server 将密码值设置为 0x00,安全问题?
- javascript - 将 Qualtrics 中的图形自动调整为参与者屏幕的大小?
- php - 如何使用 ajax 和 json 获得价值?
- list - golang 没有解析 stdin 的最后一个元素
- amazon-s3 - 有没有一种方法可以定义一个函数来根据 kafka connect 中的主题消息来决定 S3 路径
- windows - 启动时运行的批处理文件不会使用“del”命令自行删除
- azure - 如何授权多个客户端应用程序访问我的 Azure 存储资源?
- python - 运行 python websocket 库示例代码时出错
- php - 使用 PHP 清除 SQLite3 表时遇到问题