您的位置:首页 > 运维架构 > Shell

AHK 之 ComObjCreate("Shell.Application").Windows

2015-03-29 12:55 736 查看
autohotkey 笔记 20150329

几乎盲人摸象般折腾好久,一点总结:

1. Shell object
: https://msdn.microsoft.com/en-us/library/bb774094.aspx

2. ShellWindows object:  https://msdn.microsoft.com/en-us/library/bb773974.aspx

For IE in ComObjCreate("Shell.Application").Windows { ; for each open window, can only find explorer.exe and iexplorer.exe on win XP
;cnt := cnt+1
;实际测试结果,ComObjCreate("Shell.Application").Windows有以下属性:
; .FullName
; .Name
; .path
; .locationname
 这个最有用,在XP+IE8下,是每个Tab的名字

; .LocationURL

OutputDebug % IE.FullName "---" IE.path "---" IE.name
OutputDebug % IE.locationname  " :: " IE.LocationURL "`n"

;obj_addr := &IE
;obj_VarType := ComObjType(IE)
;obj_Name    := ComObjType(IE, "Name")
;obj_IID     := ComObjType(IE, "IID")
OutputDebug % "[" &IE "]--[" ComObjType(IE)  "]---[" ComObjType(IE, "Name") "]---[" ComObjType(IE, "IID") "]"

If InStr(IE.FullName, "iexplore.exe") ; check if it's an ie window
{
;msgbox % IE.document.Name
MsgBox % IE.locationname " cookie:`n" IE.document.cookie
;break ; keep that window's handle
; this assumes an ie window is available. it won't work if not
}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  autohotkey
相关文章推荐