19 lines
513 B
Python
19 lines
513 B
Python
|
|
import sys, time
|
||
|
|
sys.stdout.reconfigure(encoding='utf-8', errors='replace')
|
||
|
|
from pywinauto import Application
|
||
|
|
|
||
|
|
app = Application(backend='uia').connect(process=11748, timeout=10)
|
||
|
|
wins = app.windows()
|
||
|
|
print('windows:', len(wins))
|
||
|
|
for w in wins:
|
||
|
|
try:
|
||
|
|
t = w.window_text()
|
||
|
|
if not t:
|
||
|
|
continue
|
||
|
|
print('---', t)
|
||
|
|
tabs = [x.window_text() for x in w.descendants(control_type='TabItem')]
|
||
|
|
if tabs:
|
||
|
|
print(' tabs:', tabs)
|
||
|
|
except Exception:
|
||
|
|
pass
|