Vista以降で、アクティブなシェルを捕捉する。(その2)
GetCurrentShell.vbs
Set wShell=CreateObject("WScript.Shell")
wShell.SendKeys "^{tab}"
For Each ie In CreateObject("Shell.Application").Windows()
If InStr(LCase(ie.FullName),"explorer.exe") Then
wShell.SendKeys "^{tab}"
If ie.StatusText="" Then Exit For
End If
Next
If IsEmpty(ie) Then
MsgBox "Not Found"
Else
MsgBox ie.LocationURL
End If
SendKeys "^{tab}^{tab}"でフォルダペインにフォーカスを移動します。
このとき、StatusTextは、""です。通常は、"~個の項目"、"~個の項目を選択"、"1 個選択"、などです。これを判定します。
「お気に入りリンク」に入れて、エクスプローラの「お気に入りリンク」から起動します。ただ、問題が。。。
« IE7/IE8で、現在または最後にアクティブなIEを捕捉する。(その2) | トップページ | エクスプローラの「お気に入りリンク」からアプリを起動すると、2回、重複して起動される。(障害) »