Sha256: 6d26c0c95c621e2cff1302d585ebf42fa2a51387da6a99ba08bee4832ef5cd5e

Contents?: true

Size: 615 Bytes

Versions: 32

Compression:

Stored size: 615 Bytes

Contents

# http://www.vbcity.com/forums/topic.asp?tid=108859
require 'watir/ie'
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
      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

32 entries across 32 versions & 1 rubygems

Version Path
watir-3.0.0.rc3 lib/watir/contrib/enabled_popup.rb
watir-3.0.0.rc2 lib/watir/contrib/enabled_popup.rb
watir-3.0.0.rc1 lib/watir/contrib/enabled_popup.rb
watir-2.0.4 lib/watir/contrib/enabled_popup.rb
watir-2.0.3 lib/watir/contrib/enabled_popup.rb
watir-2.0.2 lib/watir/contrib/enabled_popup.rb
watir-2.0.2.rc1 lib/watir/contrib/enabled_popup.rb
watir-2.0.1 lib/watir/contrib/enabled_popup.rb
watir-2.0.0 lib/watir/contrib/enabled_popup.rb
watir-2.0.0.rc3 lib/watir/contrib/enabled_popup.rb
watir-2.0.0.rc2 lib/watir/contrib/enabled_popup.rb
watir-1.9.2 lib/watir/contrib/enabled_popup.rb
watir-1.9.2.rc1 lib/watir/contrib/enabled_popup.rb
watir-1.9.1 lib/watir/contrib/enabled_popup.rb
watir-1.9.1.rc1 lib/watir/contrib/enabled_popup.rb
watir-1.9.0 lib/watir/contrib/enabled_popup.rb
watir-1.9.0.rc7 lib/watir/contrib/enabled_popup.rb
watir-1.9.0.rc6 lib/watir/contrib/enabled_popup.rb
watir-1.9.0.rc5 lib/watir/contrib/enabled_popup.rb
watir-1.9.0.rc4 lib/watir/contrib/enabled_popup.rb