python window access error

1.9k views Asked by At

my goal is get list item of the application i use pywinauto module

import pywinauto
pwa_app = pywinauto.application.Application()
w_handle = pywinauto.findwindows.find_windows(class_name='#32770')
window = pwa_app.window_(handle=w_handle[0])
lv = window.Children()[3]
lv.GetItem(1)

this is error

Traceback (most recent call last):
  File "C:\Users\gunhee\Desktop\getlistview.py", line 7, in <module>
    lv.GetItem(1)
  File "C:\Python27\lib\site-packages\pywinauto\controls\common_controls.py", line 354, in GetItem
    remote_mem = _RemoteMemoryBlock(self)
  File "C:\Python27\lib\site-packages\pywinauto\controls\common_controls.py", line 86, in __init__
    raise ctypes.WinError()
WindowsError: [Error 5] access denied

i'm administrator of my windows 8.

please help me

1

There are 1 answers

0
Vasily Ryabov On BEST ANSWER

Please use 64-bit Python and 64-bit compatible pywinauto: download from github or find any other 64-bit compatible pywinauto modification. Just note my version requires pyWin32 extensions which is in ActivePython distributive by default. BTW, you will get more detailed log for RemoteMemoryBlock failures - there are few improvements in this class too.