- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我正在尝试访问显示的控件标识符,但我无法这样做。当打开的窗口弹出时,我只能访问“确定”和“取消”按钮。无法访问其他选项。请帮忙
最佳答案
打开对话框并将其分配给变量后,print_control_identifiers()(也称为 PrintControlIdentifiers)方法应打印所有可用控件。
>>> app = Application.Start('Notepad')
>>> app.UntitledNotepad.MenuItem("Edit -> Replace").Select()
>>> app.Replace.print_control_identifiers()
Control Identifiers:
Static - 'Fi&nd what:' (L1456, T336, R1528, B349)
'Fi&nd what:' 'Fi&nd what:Static' 'Static' 'Static0' 'Static1'
Edit - '' (L1531, T332, R1702, B352)
'Edit' 'Edit0' 'Edit1' 'Fi&nd what:Edit'
Static - 'Re&place with:' (L1456, T363, R1528, B376)
'Re&place with:' 'Re&place with:Static' 'Static2'
Edit - '' (L1531, T360, R1702, B380)
'Edit2' 'Re&place with:Edit'
Button - 'Match &case' (L1458, T422, R1547, B442)
'CheckBox2' 'Match &case' 'Match &caseCheckBox'
Button - '&Find Next' (L1711, T328, R1786, B351)
'&Find Next' '&Find NextButton' 'Button' 'Button0' 'Button1'
Button - '&Replace' (L1711, T355, R1786, B378)
'&Replace' '&ReplaceButton' 'Button2'
Button - 'Replace &All' (L1711, T383, R1786, B406)
'Button3' 'Replace &All' 'Replace &AllButton'
Button - 'Cancel' (L1711, T410, R1786, B433)
'Button4' 'Cancel' 'CancelButton'
>>> app.Replace.PrintControlIdentifiers()
Control Identifiers:
Static - 'Fi&nd what:' (L1456, T336, R1528, B349)
'Fi&nd what:' 'Fi&nd what:Static' 'Static' 'Static0' 'Static1'
Edit - '' (L1531, T332, R1702, B352)
'Edit' 'Edit0' 'Edit1' 'Fi&nd what:Edit'
Static - 'Re&place with:' (L1456, T363, R1528, B376)
'Re&place with:' 'Re&place with:Static' 'Static2'
Edit - '' (L1531, T360, R1702, B380)
'Edit2' 'Re&place with:Edit'
Button - 'Match &case' (L1458, T422, R1547, B442)
'CheckBox2' 'Match &case' 'Match &caseCheckBox'
Button - '&Find Next' (L1711, T328, R1786, B351)
'&Find Next' '&Find NextButton' 'Button' 'Button0' 'Button1'
Button - '&Replace' (L1711, T355, R1786, B378)
'&Replace' '&ReplaceButton' 'Button2'
Button - 'Replace &All' (L1711, T383, R1786, B406)
'Button3' 'Replace &All' 'Replace &AllButton'
Button - 'Cancel' (L1711, T410, R1786, B433)
'Button4' 'Cancel' 'CancelButton'
每个控件的第二行输出是不同的标识符(尽管应删除空格和与号 (&) 之类的内容。
Windows Media Player 很可能不使用“标准”Win32 对话框。但是打开对话框应该很简单..
这是我对此测试的输出(删除了错误和错误以保护有罪的人:))
>>> wmp = Application.Start(r'C:\Program Files (x86)\Windows Media Player\wmplayer.exe')
>>> wmp.WindowsMediaPlayer.TypeKeys("^O")
<pywinauto.controls.win32_controls.DialogWrapper object at 0x027CCDB0>
>>> wmp.Open.PrintControlIdentifiers()
Control Identifiers:
DUIViewWndClassName - '' (L200, T187, R1152, B590)
'DUIViewWndClassName' 'Files of &type:DUIViewWndClassName'
DirectUIHWND - '' (L200, T187, R1152, B590)
'DirectUIHWND' 'DirectUIHWND0' 'DirectUIHWND1' 'Files of &type:DirectUIHWND' 'Files of &type
:DirectUIHWND0' 'Files of &type:DirectUIHWND1'
CtrlNotifySink - '' (L201, T217, R426, B590)
'CtrlNotifySink' 'CtrlNotifySink0' 'CtrlNotifySink1' 'Files of &type:CtrlNotifySink' 'Files
of &type:CtrlNotifySink0' 'Files of &type:CtrlNotifySink1'
NamespaceTreeControl - 'Namespace Tree Control' (L201, T217, R426, B590)
'Namespace Tree Control' 'Namespace Tree Control0' 'Namespace Tree Control1' 'Namespace Tree
ControlNamespaceTreeControl' 'NamespaceTreeControl'
SysTreeView32 - 'Tree View' (L201, T217, R426, B590)
'Tree View' 'Tree ViewTreeView' 'TreeView'
CtrlNotifySink - '' (L429, T217, R1152, B590)
'CtrlNotifySink3' 'Files of &type:CtrlNotifySink2'
SHELLDLL_DefView - 'ShellView' (L429, T217, R1152, B590)
'SHELLDLL_DefView' 'ShellView' 'ShellViewSHELLDLL_DefView'
DirectUIHWND - '' (L429, T217, R1152, B590)
'DirectUIHWND2' 'Files of &type:DirectUIHWND2'
Static - 'File &name:' (L330, T603, R384, B618)
'File &name:' 'File &name:Static' 'Static2'
ComboBoxEx32 - '' (L389, T599, R935, B623)
'ComboBoxEx' 'File &name:ComboBoxEx'
ComboBox - '' (L389, T599, R935, B623)
'ComboBox' 'ComboBox0' 'ComboBox1' 'File &name:ComboBox' 'File &name:ComboBox0' 'File &name:
ComboBox1'
Edit - '' (L393, T604, R917, B619)
'Edit' 'File &name:Edit'
Static - 'Files of &type:' (L200, T152, R200, B152)
'Files of &type:' 'Files of &type:Static' 'Files of &type:Static0' 'Files of &type:Static1'
'Static3'
ComboBox - 'Media files (all types)' (L947, T599, R1135, B622)
'ComboBox2' 'File &name:ComboBox2' 'Files of &type:ComboBox'
Button - '&Open' (L947, T628, R1035, B654)
'&Open' '&OpenButton' 'Button' 'Button0' 'Button1'
Button - 'Cancel' (L1047, T628, R1135, B654)
'Button2' 'Cancel' 'CancelButton'
ScrollBar - '' (L1137, T651, R1152, B666)
'CancelScrollBar' 'ScrollBar3'
WorkerW - '' (L200, T152, R1152, B187)
'Files of &type:WorkerW' 'WorkerW'
ReBarWindow32 - '' (L200, T152, R1152, B187)
'Files of &type:ReBar' 'ReBar'
TravelBand - '' (L200, T152, R270, B184)
'Files of &type:TravelBand' 'TravelBand'
ToolbarWindow32 - '' (L202, T154, R270, B184)
'Files of &type:Toolbar' 'Files of &type:Toolbar0' 'Files of &type:Toolbar1' 'Toolbar' 'Tool
bar0' 'Toolbar1'
Address Band Root - '' (L270, T156, R944, B179)
'Address Band Root' 'Files of &type:Address Band Root'
msctls_progress32 - '' (L272, T157, R942, B178)
'Files of &type:Progress' 'Progress'
Breadcrumb Parent - '' (L272, T157, R898, B178)
'Breadcrumb Parent' 'Files of &type:Breadcrumb Parent'
ToolbarWindow32 - 'Address: C:\\Program Files (x86)\\Windows Media Player' (L272, T157, R898, B178
)
'Address: C:\\Program Files (x86)\\Windows Media Player' 'Address: C:\\Program Files (x86)\\
Windows Media PlayerToolbar' 'Toolbar2'
ToolbarWindow32 - '' (L898, T157, R942, B178)
'Files of &type:Toolbar2' 'Toolbar3'
UniversalSearchBand - '' (L948, T156, R1152, B179)
'Files of &type:UniversalSearchBand' 'UniversalSearchBand'
Search Box - '' (L948, T156, R1152, B179)
'Files of &type:Search Box' 'Search Box'
SearchEditBoxWrapperClass - '' (L953, T156, R1147, B179)
'Files of &type:SearchEditBoxWrapperClass' 'SearchEditBoxWrapperClass'
DirectUIHWND - '' (L953, T156, R1147, B179)
'DirectUIHWND3' 'Files of &type:DirectUIHWND3'
>>>
>>> wmp.Open.FilenameEdit.TypeKeys(r"c:\your_file_name.mp3")
<pywinauto.controls.win32_controls.EditWrapper object at 0x027CCC50>
>>> wmp.Open.Open.Click()
您可以(希望)看到 FilenameEdit 来自
Edit - '' (L393, T604, R917, B619)
'Edit' 'File &name:Edit'
关于python - 如何访问 pywinauto 中的控件标识符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5039642/
C++ Primer 说: The identifier we define in our programs may not contain 2 consecutive underscores, no
标识符术语在文档 alongside constants 中定义。 , 使用几乎相同的用例,尽管术语在运行时计算它们的值,而常量在编译时得到它。潜在地,这可能会使术语使用全局变量,但这是一个遥远而丑陋
我想知道,.Net 标识符中接受哪些字符? 不是 C# 或 VB.Net,而是 CLR。 我问这个的原因是我正在查看 yield return 语句是如何实现的 (C# In Depth),并看到
在PowerShell中,当我专门使用Active Directory时,通常会编译一个包含一组人群列表的对象,通常使用$x = get-adgroup -filter {name -like "*"
使用 hibernate 时: 我必须为每个实体指定一个 ID 或复合 ID,如果我想使用没有任何主键且没有复合键的表怎么办... 提前致谢 最佳答案 没有键的表不是一个好的关系模型。我不会推荐它。
所以我有一些代码正在尝试编译,但我不断收到此错误: 3SATSolver.java:3: expected 这是代码。我只是没有看到什么吗? import java.util.ArrayList;
我正在寻找有关 C 标准(C99 和/或 C11)部分内容的一些说明,主要是关于标识符的使用。 上下文是一个完整的C99标准库的实现,我希望它完全符合标准。 基本问题是:C 标准允许我在多大程度上声明
我有这个 Shader.h 文件,我正在用这段代码制作它: #include #include #include #include in vec2 TexCoords; out vec4 co
很难说出这里要问什么。这个问题模棱两可、含糊不清、不完整、过于宽泛或夸夸其谈,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开,visit the help center . 关闭 1
这是我的代码: #include "stdafx.h" #include #include #include #include using namespace std; int _tmain(
pthread_create() 的第一个参数是一个thread 对象,用于标识新创建的线程。但是,我不确定我是否完全理解其中的含义。 例如,我正在编写一个简单的聊天服务器并且我计划使用线程。线程会随
我想从我的标识符中获得匹配项。 我在 {/describe:foo} 中有一个这样的字符串,我正在尝试匹配 {/describe:} 以返回 foo,但我没有得到正确的正则表达式,会有人介意指出我做错
我遇到了一个奇怪的问题,我似乎找不到答案,但我想我不妨问问。 我有一个执行碰撞检查的抽象类,它有一个“更新”函数,以及“updateX”和“updateY”函数。 class MapCollidabl
我正在尝试创建一个程序来将所有文件从一个目录复制到另一个目录。但我遇到了一个基本问题。它说当我尝试在第 52 行编译时需要标识符。 public bool RecursiveCopy() {
1>cb.c(51): error C2061: syntax error : identifier 'SaveConfiguration' 1>cb.c(51): error C2059: synt
我刚刚发现命名变量 arguments 是个坏主意。 var arguments = 5; (function () { console.log(arguments); })(); Outpu
我们对我们的网站进行了安全测试,并发现了一个漏洞。 问题 If the session identifier were known by an attacker who had access to t
为了估计程序在一次内核启动中可以处理多少数据,我尝试使用 cudaMemGetInfo() 获取一些内存信息。但是,编译器告诉我: 错误:标识符“cudaMemGetInfo”未定义 cudaGetD
我发现我需要使用 xpath 查询来定位几乎是 regexp 类型的字符串,但无法看到如何管理它。我正在使用的当前查询是: $result = $xpath->query('//ul/li[sta
我正在创建我的学生计划表的虚拟版本,它基本上可以让你记下你有哪些科目的作业。 这是界面: 用户从组合框中选择主题,并在相邻的备忘录中输入一些注释。完成后,他们将单击“保存”按钮,将其保存到 .ini
我是一名优秀的程序员,十分优秀!