22件ヒット
[1-22件を表示]
(0.073秒)
ライブラリ
- win32ole (22)
クラス
-
WIN32OLE
_ EVENT (11) -
WIN32OLE
_ TYPE (11)
検索結果
-
WIN32OLE
_ EVENT # handler=(obj) -> () (27212.0) -
イベント処理を実行するオブジェクトを登録します。
...るにはnilを指定します。
class IeHandler
def initialize
@completed = false
end
attr_reader :completed
def onDocumentComplete(disp, uri)
disp.document.getElementsByTagName('a').each do |e|
puts "#{e.innerHTML}=#{e.href}"
end
@completed = tru......ie = WIN32OLE.new('InternetExplorer.Application.1')
event = WIN32OLE_EVENT.new(ie, 'DWebBrowserEvents2')
event.handler = IeHandler.new
ie.Navigate2 'http://www.ruby-lang.org/ja/'
loop do
break if event.handler.completed
WIN32OLE_EVENT.message_loop
end
ie.Quit
WIN32OLE_EVENT#on_... -
WIN32OLE
_ TYPE # default _ event _ sources -> [WIN32OLE _ TYPE] (6112.0) -
型が持つソースインターフェイスを取得します。
...型が持つソースインターフェイスを取得します。
default_event_sourcesメソッドは、selfがCoClass(コンポーネントクラス)
の場合、そのクラスがサポートするデフォルトのソースインターフェイス(イ
ベントの通知元となるイン......32
require 'win32ole'
type = WIN32OLE_TYPE.new('Microsoft Internet Controls', 'InternetExplorer')
ctl = WIN32OLE.new(type.progid)
source = type.default_event_sources[0]
class WebEvent
def initialize
@completed = false
end
attr_reader :completed
end
source.ole_methods.each do |......odule_eval do
define_method("on#{m.name}") do |*arg|
if arg[0] == "ページが表示されました"
@completed = true
end
puts "#{Time.now}: #{m.name} was called"
p arg
end
end
end
evt = WIN32OLE_EVENT.new(ctl)
evt.handler = WebEvent.new
ctl.na...