vendor/vendor_gems/rdp-rautomation-0.6.3.1/lib/rautomation/adapter/autoit/window.rb
# Retrieves handle of the window.
# @note Searches only for visible windows.
# @see RAutomation::Window#hwnd
Retrieves handle of the window.
Retrieves handle of the window .
def hwnd
          @hwnd ||= begin
                      locators = @autoit_locators
                      if @locator_index || @locator_pid
                        locators = "[regexptitle:]" 
                      end
                      windows = @@autoit.WinList(locators, @locator_text).pop.compact.
                        map {|handle| self.class.new(:hwnd => handle.hex)}
                      windows.delete_if {|window| !window.visible?}
                      if @locator_pid
                        window = windows.find {|win| win.pid == @locator_pid} 
                      else
                        window = windows[@locator_index || 0]
                      end
                      window ? window.hwnd : nil
                    end
        end
def hwnd @hwnd ||= begin locators = @autoit_locators if @locator_index || @locator_pid locators = "[regexptitle:]" end windows = @@autoit . WinList ( locators , @locator_text ) . pop . compact . map { | handle | self . class . new ( :hwnd => handle . hex ) } windows . delete_if { | window | ! window . visible? } if @locator_pid window = windows . find { | win | win . pid == @locator_pid } else window = windows [ @locator_index || 0 ] end window ? window . hwnd : nil end end
Retrieves handle of the window.
Retrieves handle of the window .
# @todo Come up with some better solution for this case # match all, needed for the case when only :index or :pid is used
note
Searches only for visible windows.
Searches only for visible windows .
see
None