るりまサーチ

最速Rubyリファレンスマニュアル検索!
24件ヒット [1-24件を表示] (0.080秒)

別のキーワード

  1. fiddle ruby_free
  2. rbconfig ruby
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

クラス

検索結果

WIN32OLE_EVENT#handler=(obj) -> () (18231.0)

イベント処理を実行するオブジェクトを登録します。

...j イベントに対応するメソッドを持つオブジェクト。イベント受信を
解除するにはnilを指定します。

class
IeHandler
def initialize
@completed = false
end
attr_reader :completed
def onDocumentComplete(disp, uri)
disp.docume...
...end

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_EVE...

WIN32OLE_TYPE#default_event_sources -> [WIN32OLE_TYPE] (479.0)

型が持つソースインターフェイスを取得します。

...型が持つソースインターフェイスを取得します。

default_event_sourcesメソッドは、selfがCoClass(コンポーネントクラス)
の場合、そのクラスがサポートするデフォルトのソースインターフェイス(イ
ベントの通知元となるイン...
...ype = 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 |m|
WebEvent.module_eval...
...(ctl)
evt.handler = WebEvent.new
ctl.navigate2 'http://www.ruby-lang.org/'
loop do
break if evt.handler.completed
WIN32OLE_EVENT.message_loop
end
ctl.Quit

このプログラムを実行するとWindows7のIE8環境では以下のような出力を得られ
ます。

2010-10-06 22:33:54...