Finding Missing Control Identifiers in Microsoft Minesweeper using Pywinauto

621 views Asked by At

I'm trying to develop a solver for good ole' Minesweeper, but running into a hitch.

Environment: I setup Python 3.4.6 (x64) and am using Pywinauto 0.61 and the old Windows 7 Minesweeper from Winaero's "Windows 7 games for Windows 10".

Problem: I can't seem to detect dialog items nor interact with them using Pywinauto, yet I can tell from inspect they are clearly there.

1) Minesweeper

2) Inspect.exe showing the process ID - which matches pywinauto's - and all relevant children

3) Results of Print_Control_Identifiers() on the window and the child. Lacking the children shown in 2)

My code is as such:

app = pywinauto.Application().connect(class_name="Minesweeper")
mswpr = app.window(title="Minesweeper")
mswpr.print_control_identifiers()
mswpr.child_window().print_control_identifiers()

After fiddling with this for hours, I'm still not sure what I'm missing. I expect to see a list of groups, a menu bar, and a title bar to appear in one of the outputs (given inspect's results): acknowledging they are recognized by pywinauto, yet I'm given nothing. I am sure the program is locating the right process and window, given the process ID and window dimensions match between inspect and pywinauto.

Suspicions: The first is that this, being a Microsoft product, is simply inaccessible through the traditional means of Pywinauto. Another idea is that I see conflicting UIA and win32 types, alternating between backends in Pywinauto yielded nothing. I've also attempted to directly access dialogs by name with the code I was able to determine via inspect.exe to no success. My question is, what could I be missing?

Thank you for any clues or suggestions.

0

There are 0 answers