2

我正在尝试模拟单击 Windows 应用程序上的图标。目前,我这样做的唯一方法是使用 ClickInput(coords = (x,y)) 模拟鼠标点击上述方法的问题是,每当软件 UI 更新时,它的位置就会改变,这迫使我更新所有脚本根据新的图标位置。

有没有办法在不使用坐标的情况下模拟工具条中的图标点击?

4

1 回答 1

0

是的!据我所知,图像看起来像Static.pywinauto

Access names : ['Static4']
Class : Static
ClientRects : [<RECT L0, T0, R24, B24>]
ContextHelpID : 0
ControlCount : 0
ControlID : 269
ExStyle : 4
Fonts : [<LOGFONTW 'MS Shell Dlg' -11>]
FriendlyClassName : Static
handle : 2097378
Image : <Image._ImageCrop image mode=RGB size=24x24 at 0x1E47DC8>
IsEnabled : True
IsUnicode : True
IsVisible : True
MenuItems : []
pwa_type : <class 'pywinauto.controls.win32_controls.StaticWrapper'>
Rectangle : (L514, T498, R538, B522)
Style : 1342179331
Texts : ['']
UserData : 0

您可以轻松访问它

window['Static4'].Click()
于 2012-10-16T11:00:48.200 回答