Sha256: 12481dff3b25342d0e5f487f8505e6db27820fb1da61d84ba3e033c197471c5d

Contents?: true

Size: 722 Bytes

Versions: 41

Compression:

Stored size: 722 Bytes

Contents

# based on http://svn.instiki.org/instiki/trunk/test/watir/e2e.rb
# and http://rubyforge.org/pipermail/wtr-general/2005-November/004108.html

require 'watir/ie-process'

class IEProcess < Watir::IE::Process 
  def stop
    right_to_terminate_process = 1
    handle = Win32API.new('kernel32.dll', 'OpenProcess', 'lil', 'l').
    call(right_to_terminate_process, 0, @process_id)
    Win32API.new('kernel32.dll', 'TerminateProcess', 'll', 'l').call(handle, 0)
  end
  
end

module Watir
  class IE
    def process_id
      @process_id ||= IEProcess.process_id_from_hwnd @ie.hwnd
    end
    attr_writer :process_id
    def kill
      iep = IEProcess.new process_id
      iep.stop
    end
  end
end

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
watir-1.9.0.rc3 lib/watir/contrib/ie-new-process.rb
watir-1.9.0.rc2 lib/watir/contrib/ie-new-process.rb
watir-1.9.0.rc1 lib/watir/contrib/ie-new-process.rb
watir-1.8.1 lib/watir/contrib/ie-new-process.rb
watir-1.8.1.rc1 lib/watir/contrib/ie-new-process.rb
watir-1.8.0 lib/watir/contrib/ie-new-process.rb
watir-1.8.0.rc1 lib/watir/contrib/ie-new-process.rb
watir-1.7.1 lib/watir/contrib/ie-new-process.rb
watir-1.7.0 lib/watir/contrib/ie-new-process.rb
watir-1.7.0.rc1 lib/watir/contrib/ie-new-process.rb
watir-1.6.7 lib/watir/contrib/ie-new-process.rb
watir-1.6.7.rc1 lib/watir/contrib/ie-new-process.rb
watir-1.6.6 lib/watir/contrib/ie-new-process.rb
watir-1.6.6.rc2 lib/watir/contrib/ie-new-process.rb
watir-1.6.6.rc1 lib/watir/contrib/ie-new-process.rb
watir-1.5.2 watir/contrib/ie-new-process.rb
watir-1.5.4 watir/contrib/ie-new-process.rb
watir-1.5.3 watir/contrib/ie-new-process.rb
watir-1.5.6 watir/contrib/ie-new-process.rb
watir-1.6.2 lib/watir/contrib/ie-new-process.rb