【OLE】オートメーション総合スレ【ActiveX】

このエントリーをはてなブックマークに追加
167デフォルトの名無しさん
もう終わった話だろうけどシリーズ。

>>19 >>20 >>21
一応そんなような事やってみた。超テキトーだけど。

<<TABB.VBS>>
Set ie2 = CreateObject("InternetExplorer.Application")
ie2.Left = 320
ie2.Width = 300
Set ie1 = WScript.CreateObject("InternetExplorer.Application", "ie1_")
ie1.Left = 0
ie1.Width = 300
ie2.Visible = True
ie1.Visible = True
ie1.Navigate "http://www.google.co.jp/"
ie2.Navigate "about:blank"
Do While ie1.Busy Or ie1.ReadyState <> 4
Loop
Set doc = ie1.Document
Set doc.onclick = GetRef("doc_onclick")
Quit = False
Do While True
  If Quit Then
  Exit Do
  End If
  WScript.Sleep 100
Loop
ie2.Quit
168デフォルトの名無しさん:2006/07/15(土) 20:35:12
Function doc_onclick
  Set ev = doc.parentWindow.event
  if ev.srcElement.tagName = "A" Then
  ie2.Navigate ev.srcElement.href
  ev.returnValue = False
  End If
End Function
Function ie1_OnQUit
  Quit = True
End Function

HTML内にWebBrowserコントロールを<OBJECT>で貼り付けてもみたんだけど、なぜかイベントがキャッチできないんだよね・・・