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-3.0.0.rc3 lib/watir/contrib/ie-new-process.rb
watir-3.0.0.rc2 lib/watir/contrib/ie-new-process.rb
watir-3.0.0.rc1 lib/watir/contrib/ie-new-process.rb
watir-2.0.4 lib/watir/contrib/ie-new-process.rb
watir-2.0.3 lib/watir/contrib/ie-new-process.rb
watir-2.0.2 lib/watir/contrib/ie-new-process.rb
watir-2.0.2.rc1 lib/watir/contrib/ie-new-process.rb
watir-2.0.1 lib/watir/contrib/ie-new-process.rb
watir-2.0.0 lib/watir/contrib/ie-new-process.rb
watir-2.0.0.rc3 lib/watir/contrib/ie-new-process.rb
watir-2.0.0.rc2 lib/watir/contrib/ie-new-process.rb
watir-1.9.2 lib/watir/contrib/ie-new-process.rb
watir-1.9.2.rc1 lib/watir/contrib/ie-new-process.rb
watir-1.9.1 lib/watir/contrib/ie-new-process.rb
watir-1.9.1.rc1 lib/watir/contrib/ie-new-process.rb
watir-1.9.0 lib/watir/contrib/ie-new-process.rb
watir-1.9.0.rc7 lib/watir/contrib/ie-new-process.rb
watir-1.9.0.rc6 lib/watir/contrib/ie-new-process.rb
watir-1.9.0.rc5 lib/watir/contrib/ie-new-process.rb
watir-1.9.0.rc4 lib/watir/contrib/ie-new-process.rb