44件ヒット
[1-44件を表示]
(0.086秒)
種類
- インスタンスメソッド (22)
- 特異メソッド (11)
- クラス (11)
ライブラリ
- win32ole (44)
クラス
-
WIN32OLE
_ EVENT (22) -
WIN32OLE
_ TYPE (11)
キーワード
-
WIN32OLE
_ EVENT (11) -
default
_ event _ sources (11) - handler= (11)
検索結果
先頭4件
-
WIN32OLE
_ EVENT . message _ loop -> () (18237.0) -
Windowsのメッセージポンプを実行します。
...Windowsのメッセージポンプを実行します。
message_loopメソッドは、Windowsメッセージがキューイングされている限りメッ
セージの読み出しとディスパッチを実行します。
COMのスレッド間/プロセス間通信はスレッド内で呼び出......etExplorer.Application.1')
event = WIN32OLE_EVENT.new(ie, 'DWebBrowserEvents2')
b = false
event.on_event('DocumentComplete') do |disp, uri|
disp.document.getElementsByTagName('a').each do |e|
puts "#{e.innerHTML}=#{e.href}" #=> ダウンロード=http://www.ruby-lang.org/ja/downloa......ds/ など
end
disp.quit
b = true
end
ie.Navigate2 'http://www.ruby-lang.org/ja/'
loop do
break if b
WIN32OLE_EVENT.message_loop
end
なお、メソッド名はloopですが、呼び出し時および既にキューイングされたメッ
セージの処理中にキュ... -
WIN32OLE
_ TYPE # default _ event _ sources -> [WIN32OLE _ TYPE] (418.0) -
型が持つソースインターフェイスを取得します。
..._EVENT.message_loopの呼び出しが必要な点に注意してください。
ここでは最終イベントのStatusTextChangeイベントのメッセージについては既
知としています。
# coding : cp932
require 'win32ole'
type = WIN32OLE_TYPE.new('Microsoft Internet Controls',......hod("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.navigate2 'http://www.ruby-lang......mpleted
WIN32OLE_EVENT.message_loop
end
ctl.Quit
このプログラムを実行するとWindows7のIE8環境では以下のような出力を得られ
ます。
2010-10-06 22:33:54 +0900: PropertyChange was called
["{265b75c1-4158-11d0-90f6-00c04fd497ea}"]
2010-10-06 22:33:54 +0900: Before... -
WIN32OLE
_ EVENT # handler=(obj) -> () (130.0) -
イベント処理を実行するオブジェクトを登録します。
...ジェクトをイベントハンドラとし
て登録します。
イベントハンドラはイベント名に「on」を前置します。もし、イベントに対応
するonメソッドが実装されていなければmethod_missingが呼ばれます。イベン
ト名は大文字小文字......ternetExplorer.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_eventなどの呼び... -
WIN32OLE
_ EVENT (24.0) -
OLEオートメーションサーバからのイベント通知を制御するクラスです。
...etExplorer.Application.1')
event = WIN32OLE_EVENT.new(ie, 'DWebBrowserEvents2')
b = false
event.on_event('DocumentComplete') do |disp, uri|
disp.document.getElementsByTagName('a').each do |e|
puts "#{e.innerHTML}=#{e.href}" #=> ダウンロード=http://www.ruby-lang.org/ja/downloa......ds/ など
end
disp.quit
b = true
end
ie.Navigate2 'http://www.ruby-lang.org/ja/'
loop do
break if b
WIN32OLE_EVENT.message_loop
end...