Unable to access windows controls inside pywinauto's hwndwrapper (wrapper class
Question: [enter image description here](http://i.stack.imgur.com/BTJpy.png)I am new to
python and pywinauto. Trying to set or get Text for TextBox (windows control)
inside pywinauto.controls.hwndwrapper.hwndwrapper by using SWAPY, I have Class
Name of wrapper class. How to access controls inside wrapper class using class
name (like `Afx:633C0000:1008`) in pywinauto?

    
    
    import pywinauto
    import pywinauto.controls
    from pywinauto.application import Application
    app = Application().Connect(title=u'SAP', class_name='SAP_FRONTEND_SESSION')
    sapfrontendsession = app.SAP
    afxe = sapfrontendsession[u'Afx:633C0000:1008']
    


Answer: pywinauto provides a 2-level concept based on `WindowSpecification` and
wrappers. Window specification is just a description, set of criteria to
search desired control (it may not exist when `WindowSpecification` is
created). Concrete wrapper is created for really existing control if found. In
IDLE console it looks so:

    
    
    >>> app.RowListSampleApplication
    <pywinauto.application.WindowSpecification object at 0x0000000003859B38>
    >>> app.RowListSampleApplication.WrapperObject()
    <pywinauto.controls.win32_controls.DialogWrapper object at 0x0000000004ADF780>
    

Window specification can have no more than 2 levels:
`app.WindowName.ControlName`. It can be specified with more detailed search
criteria:

    
    
    app.Window_(title=u'SAP', class_name_re='^Afx:.*$')
    app.SAP.ChildWindow(class_name='Edit')
    

Possible `Window_/ChildWindow` arguments are the same as listed in
[find_windows](http://pywinauto.github.io/docs/code/pywinauto.findwindows.html?highlight=find_windows#pywinauto.findwindows.find_windows).

* * *

P.S. Great Python features can hide `WrapperObject()` method call in
production code so you need to call it for debugging purpose only. For example
these statements are equivalent (do the same):

    
    
    app.WindowName.Edit.SetText(u'text')
    app.WindowName.Edit.WrapperObject().SetText(u'text')
    

But the statements below return different objects:

    
    
    app.WindowName.Edit # <WindowSpecification>
    app.WindowName.Edit.WrapperObject() # <EditWrapper>
    

