title: How to click a particular button within a window (without using XPOS YPOS)
body: <p>I have just started using AUTOHOTKEY and its been phenomenal.I have a doubt though.
  I want to automate the launching of an application and then clicking on a specific button in it.I would like to accomplish this using AHK.</p>
  
  <p>Once I launch the applicaton this window appears <a href="https://www.dropbox.com/s/vkmoccc4hhhxmng/LOGIN%20screenshot.jpg" rel="nofollow">here</a>.
  I want to hit the "Connect" button, but I cant figure out a good way to move the cursor to the connect button. I tried the following code which uses tab.</p>
  
  <pre><code>Loop ,5
      {    
  sleep 2*1000    
  Send {Tab down}    
  }
  </code></pre>
  
  <p><strong>This works, But i feel this is crude and need a better way. Is there a way to use button_name or button_text to my advantage?</strong> </p>
  
  <p><strong>I dont want to use screen positions XPOS AND YPOS either.</strong></p>
  
  <p>The link to my applcn window screenshot is <a href="https://www.dropbox.com/s/vkmoccc4hhhxmng/LOGIN%20screenshot.jpg" rel="nofollow">this</a>.</p>
  
  <p>I have the following info from the WINDOW-SPY feature of <strong>AutoHotKey</strong>.Hope you can find this useful.</p>
  
  <blockquote>
    <blockquote>
      <blockquote>
        <blockquote>
          <blockquote>
            <blockquote>
              <blockquote>
                <blockquote>
                  <blockquote>
                    <blockquote>
                      <p>( Window Title &amp; Class )&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;
                      Asianet Login
                      ahk_class QWidget</p>
                      
                      <blockquote>
                        <blockquote>
                          <p>( Mouse Position )&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;
                          On Screen:  881, 306  (less often used)
                          In Active Window:   462, 76</p>
                        </blockquote>
                      </blockquote>
                    </blockquote>
                    
                    <p>( Now Under Mouse Cursor )&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;
                    ClassNN:    QWidget2
                    Text:   bnConnect
                    Color:  0xC8D0D4  (Blue=C8 Green=D0 Red=D4)</p>
                    
                    <blockquote>
                      <p>( Active Window Position )&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;
                      left: 419     top: 230     width: 529     height: 238</p>
                      
                      <blockquote>
                        <p>( Status Bar Text )&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;</p>
                        
                        <p>( Visible Window Text )&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;
                        layoutWidget
                        bnConnect
                        bnAbout
                        bnClose
                        chkRemember
                        edPassword
                        lbPassword
                        edUsername
                        teLog
                        qt_scrollarea_viewport
                        lbUsername</p>
                        
                        <p>( Hidden Window Text )&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;
                        qt_scrollarea_vcontainer
                        qt_scrollarea_hcontainer</p>
                      </blockquote>
                    </blockquote>
                  </blockquote>
                </blockquote>
              </blockquote>
            </blockquote>
          </blockquote>
          
          <p>( TitleMatchMode=slow Visible Text )&lt;&lt;&lt;&lt;</p>
          
          <p>( TitleMatchMode=slow Hidden Text )&lt;&lt;&lt;&lt;</p>
        </blockquote>
      </blockquote>
    </blockquote>
  </blockquote>