Sha256: 61263aca8066614e1613029869f7824a3e9a473c0fc6082de12ab2314fa8825e

Contents?: true

Size: 604 Bytes

Versions: 6

Compression:

Stored size: 604 Bytes

Contents

# http://www.vbcity.com/forums/topic.asp?tid=108859

module Watir
  module PageContainer
    include Win32
    def enabled_popup(timeout=4)
      # Use handle of our parent window to see if we have any currently
      # enabled popup.
      hwnd_modal = 0
      Waiter.wait_until(timeout) do
        hwnd_modal, arr = GetWindow.call(hwnd, GW_ENABLEDPOPUP)
        hwnd_modal > 0
      end
      # use hwnd() method to find the IE or Container hwnd (overriden by IE)
      if hwnd_modal == hwnd() || 0 == hwnd_modal
        hwnd_modal = nil
      end
      hwnd_modal
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
watir-1.5.4 watir/contrib/enabled_popup.rb
watir-1.5.2 watir/contrib/enabled_popup.rb
watir-1.5.3 watir/contrib/enabled_popup.rb
watir-1.6.2 lib/watir/contrib/enabled_popup.rb
watir-1.5.6 watir/contrib/enabled_popup.rb
watir-1.5.5 watir/contrib/enabled_popup.rb