るりまサーチ

最速Rubyリファレンスマニュアル検索!
44件ヒット [1-44件を表示] (0.043秒)
トップページ > クエリ:new[x] > クエリ:message_loop[x]

別のキーワード

  1. etc sc_message_passing
  2. etc sc_2_pbs_message
  3. getoptlong error_message
  4. mkmf message
  5. win32ole message_loop

ライブラリ

クラス

キーワード

検索結果

WIN32OLE_EVENT.message_loop -> () (18131.0)

Windowsのメッセージポンプを実行します。

...Windowsのメッセージポンプを実行します。

message_loop
メソッドは、Windowsメッセージがキューイングされている限りメッ
セージの読み出しとディスパッチを実行します。

COMのスレッド間/プロセス間通信はスレッド内で呼び出...
...
Windowsメッセージを読み取ってディスパッチすることで通知されます。

ie = WIN32OLE.new('InternetExplorer.Application.1')
event = WIN32OLE_EVENT.new(ie, 'DWebBrowserEvents2')
b = false
event.on_event('DocumentComplete') do |disp, uri|
disp.document.getElemen...
...oads/ など
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] (66.0)

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

...たない場合は空配列を返します。

tobj = WIN32OLE_TYPE.new('Microsoft Excel 14.0 Object Library', 'Worksheet')
tobj.default_event_sources.map {|intf| intf.name} #=> ["DocEvents"]

WIN32OLE_EVENT.newでインターフェイス名を指定しない場合は、ここで
返さ...
...
WIN32OLE_EVENT.message_loopの呼び出しが必要な点に注意してください。
ここでは最終イベントのStatusTextChangeイベントのメッセージについては既
知としています。

# coding : cp932
require 'win32ole'

type = WIN32OLE_TYPE.new('Microsoft Interne...
...t 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 do
define_method("on#{m.name}") do |*...

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

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

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

WIN32OL...

WIN32OLE_EVENT (18.0)

OLEオートメーションサーバからのイベント通知を制御するクラスです。

...ントを受け取るメソッドをサーバへ登録できま
す。

=== サンプルコード

ie = WIN32OLE.new('InternetExplorer.Application.1')
event = WIN32OLE_EVENT.new(ie, 'DWebBrowserEvents2')
b = false
event.on_event('DocumentComplete') do |disp, uri|
disp.document.getElement...
...sByTagName('a').each do |e|
puts "#{e.innerHTML}=#{e.href}" #=> ダウンロード=http://www.ruby-lang.org/ja/downloads/ など
end
disp.quit
b = true
end
ie.Navigate2 'http://www.ruby-lang.org/ja/'
loop do
break if b
WIN32OLE_EVENT.message_loop
end...