Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
I am working to automate an application called MEmu Instance Manager.
For my project, I want to return the amount of instances that exist, along with their names with the pywinauto module and the inspect tool from windows kit.
Based on the Inspect tool, the MEmu application is structured like this
MainWindow
Parent
Child1
InstanceArea
TARGET
WIDGETS
When inspecting the target widgets with the inspect tool, this is what I get.
The string that I am trying to return is "b__"
How can you use python to return the Legacy|Accessible.Value
string?
Does the path of the widget need to be specified before doing this?
If so, how? I've read a lot of useful information on the pywinauto guide, but I'm having trouble applying it on MEmu with the information I am getting from inspect.
For example,
with the information above, I cannot refer to this window with the info provided.
I am a beginner and I've been working on this for a couple of days, and getting nowhere with this. plz help *cries a lil
from pywinauto import Application
app = Application(backend="uia").connect(title='MainWindow')
# app.MainWindow.dump_tree() # useful to get child_window spec for just a copy-paste!
target = app.MainWindow.child_window(title='TARGET', control_type='Edit').wrapper_object()
# maybe try control_type='Text' depending on info from Inspect.exe
# when you found the control, just get the text
target.legacy_properties()['Value'] # .legacy_properties() returns a dict
I've not checked it with real app instance. Hope you could adjust it on the edges.
–
–
–
–
–
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.