I'm trying to automate software installer (NSIS) with pywinauto. There is the TreeView as follow Some items a disabled (gray out).
I discovered that I can find if item disabled/enabled by analysing pattern of the state code returned.
app = Application()
app.start('some_path_to_exe_file')
dialod = app.window(title_re='some_title', enabled_only=True)
item = dialog.child_window(class_name='SysTreeView32').get_item(r'\ABCD')
st = item.state()
print('{:b}'.format(st))
101000000000000
The difference between disabled and enabled item state in one bit, which was set for disabled item.
0101 0000 0000 0000
So, I can check this bit, but I wonder if there any other, more convenient method? Moreover, I'm not sure if state code consistent between applications.