日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > python >内容正文

python

python标识符_python – 如何访问pywinauto中的控件标识符

發布時間:2024/1/1 python 35 豆豆
生活随笔 收集整理的這篇文章主要介紹了 python标识符_python – 如何访问pywinauto中的控件标识符 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

打開對話框并將其分配給變量后,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對話框.但是Open對話應該很容易..

這是我對此測試的輸出(刪除了錯誤和錯誤以保護有罪:))

>>> wmp = Application.Start(r'C:\Program Files (x86)\Windows Media Player\wmplayer.exe')

>>> wmp.WindowsMediaPlayer.TypeKeys("^O")

>>> 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")

>>> wmp.Open.Open.Click()

你可以看到(希望)FilenameEdit來自

Edit - '' (L393, T604, R917, B619)

'Edit' 'File &name:Edit'

總結

以上是生活随笔為你收集整理的python标识符_python – 如何访问pywinauto中的控件标识符的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。