资源描述
open a folder view, launch this application, click on init, it detects all instances. just drill-down to see the properties of the objects recursively.
you can now update properties and invoke methods on running instances !
file name : dom_explorer.hta
requirement : ie 5.5 (not tested on ie5.1)
author : jean-luc antoine
submitted : 31/10/2001
updated : 19/11/2001
category : hta
remember : the file extension has to be *.hta
代码如下:
<html>
<head>
<title>dom explorer</title>
<hta:application
applicationname=dom_explorer
border=thick borderstyle=normal
caption=yes contextmenu=yes
id=ohta alert(ohta.applicationname);
innerborder=yes maximizebutton=yes minimizebutton=yes
navigable=no scroll=yes scrollflat=no
selection=yes showintaskbar=yes singleinstance=no
sysmenu=yes version=0.5 windowstate=normal>
<script language=vbscript>
option explicit
dim shapp
set shapp=createobject(shell.application)
function sp2(name,obj,rw,objpath) 'properties
dim chaine
chaine=<tr><td>
if isobject(obj) then
if obj is nothing then
if hidenull.checked then
sp2=
exit function
end if
chaine=chaine & name
elseif vartype(obj)=0 then
chaine=chaine & name
else
chaine=chaine & <a href=# onclick='vbscript:showprop &_
objpath & . & name & , & objpath & . & name &_
' title=' & objpath & . & name & '> & name & </a>
end if
else
chaine=chaine & name
end if
chaine=chaine & </td><td> & typename(obj) & </td><td> & rw & </td><td>
select case vartype(obj)
case 0 'empty
chaine=chaine & <font color=red>uninitialized</font>
case 1 'null 'if isnull(obj) then
if hidenull.checked then
sp2=
exit function
end if
chaine=chaine & <font color=red>no value</font>
case 9 'object
chaine=chaine & <font color=red>can't display</font>
case else
if rw=read/write then
chaine=chaine & <span id= & name & contenteditable=true><b> &_
replace(obj,<,<) & </b></span> <a href='#' onclick='vbscript: &_
objpath & . & name & =
select case vartype(obj)
'case 2 'vbinteger - cint()
'case 3 'vblong - clng()
'case 4 'vbsingle - csng()
'case 5 'double - cdbl()
'case 6 'vbcurrency - ccur()
case 7 'vbdate
chaine=chaine & cdate( & name & .innertext)
'case 8 'vbstring - cstr()
'case 10 'vberror
case 11 'vbboolean
chaine=chaine & cbool( & name & .innertext)
'case 12 'vbvariant
'case 13 'vbdataobject
'case 14 'vbdecimal
'case 17 'vbbyte - cbyte()
'case 8192 'vbarray
case else
chaine=chaine & name & .innertext
end select
chaine=chaine & ' title='click here to update'>ok</a>
else
chaine=chaine & replace(obj,<,<)
end if
end select
chaine=chaine & </td></tr>
sp2=chaine
end function
function sp(name,nbarg,objpath,title) 'methods
dim chaine,x
chaine=<tr><td>
chaine=chaine & <a href=# onclick='vbscript: & objpath & . & name
if nbarg>0 then chaine=chaine & & name & 1 & .innertext
if nbarg>1 then chaine=chaine & , & name & 2 & .innertext
if nbarg>2 then chaine=chaine & , & name & 3 & .innertext
chaine=chaine & ' title=' & title & '> & name & </a>
chaine=chaine & </td><td>
if nbarg>0 then chaine=chaine & <input type=text name= & name & 1>
chaine=chaine & </td><td>
if nbarg>1 then chaine=chaine & <input type=text name= & name & 2>
chaine=chaine & </td><td>
if nbarg>2 then chaine=chaine & <input type=text name= & name & 3>
chaine=chaine & </td></tr>
sp=chaine
end function
function showframes(obj,depth)
dim chaine,x
on error resume next
x=obj.frames.length
chaine =
if x<>0 then
'chaine =x & vbcrlf
for x=0 to obj.frames.length-1
chaine=chaine & string(1+depth*4, )
chaine=chaine & obj.frames(x).name
chaine=chaine & obj.frames(x).location & vbcrlf
chaine=chaine & showframes(obj.frames(x).document,depth+1)
next
end if
showframes=chaine
end function
sub showprop(obj,op)
'display the object's properties
dim c,r,rw,x
r=read
rw=read/write
x=instrrev(op,.)
if x>0 then
c=left(op,x-1)
c=<a href=# onclick='vbscript:showprop & c & , & c &_
' title=' & c & '> & c & </a><u> & mid(op,x) & </u>
else
c=op
end if
c=properties for & c & - typename : & typename(obj) & <br><table class=prop>
c=c & <tr><td>propname</td><td>type</td><td>access</td><td>value</td></tr>
select case typename(obj) 'see microsoft html object librairy
case ishelldispatch3
c=c & sp2(application,obj.application,r,op)
c=c & sp2(parent,obj.parent,r,op)
c=c & sp2(windows,obj.windows,r,op)
c=c & sp(open,1,op,open a folder)
c=c & sp(explore,1,op,explore a folder)
c=c & sp(minimizeall,0,op,minimize all windows)
c=c & sp(undominimizeall,0,op,undo minimize all windows)
c=c & sp(filerun,0,op,bring up the file run)
c=c & sp(cascadewindows,0,op,cascade windows)
c=c & sp(tilevertically,0,op,tile windows vertically)
c=c & sp(tilehorizontally,0,op,tile windows horizontally)
c=c & sp(shutdownwindows,0,op,exit windows)
c=c & sp(suspend,0,op,suspend the pc)
c=c & sp(ejectpc,0,op,eject the pc)
c=c & sp(settime,0,op,bring up the set time dialog)
c=c & sp(help,0,op,display shell help)
c=c & sp(findfiles,0,op,find files)
c=c & sp(findcomputer,0,op,find a computer)
c=c & sp(refreshmenu,0,op,refresh the menu)
c=c & sp(controlpanelitem,1,op,run a control panel item)
'isrestricted, getsysteminformation, isservicerunning, canstartstopservice
c=c & sp(shellexecute,3,op,execute generic command (file[,args][,dir]))
c=c & sp(findprinter,3,op,find a printer in the directory service ([name][,location][,model]))
c=c & sp(servicestart,2,op,start a service by name, and optionally set it to autostart (name,persistent))
c=c & sp(servicestop,2,op,stop a service by name, and optionally disable autostart (name,persistent))
c=c & sp(showbrowserbar,2,op,show/hide browser bar (clsid,bshow))
c=c & sp(addtorecent,2,op,add an object to the recent docuements(file[,category])
case ishellwindows
c=c & sp2(count,obj.count,r,op)
'c=c & sp2(item,obj.item,r,op)
'for each w in shapp.windows
'next
for x=0 to obj.count-1
c=c & sp2(item( & x & ),obj.item(x),r,op)
next
case iwebbrowser2 'internet explorer
msgbox showframes(obj.document,0)
on error resume next
c=c & sp2(addressbar,obj.addressbar,rw,op)
on error goto 0
c=c & sp2(application,obj.application,r,op) 'microsoft internet explorer
c=c & sp2(busy,obj.busy,r,op)
c=c & sp2(container,obj.container,r,op)
c=c & sp2(document,obj.document,r,op)
c=c & sp2(fullname,obj.fullname,r,op)
c=c & sp2(fullscreen,obj.fullscreen,rw,op)
c=c & sp2(height,obj.height,rw,op)
c=c & sp2(hwnd,obj.hwnd,r,op)
c=c & sp2(left,obj.left,rw,op)
c=c & sp2(locationname,obj.locationname,r,op)
c=c & sp2(locationurl,obj.locationurl,r,op)
c=c & sp2(menubar,obj.menubar,rw,op)
c=c & sp2(name,obj.name,r,op) 'microsoft internet explorer
c=c & sp2(offline,obj.offline,rw,op)
c=c & sp2(parent,obj.parent,r,op)
c=c & sp2(path,obj.path,r,op)
c=c & sp2(readystate,obj.readystate,r,op)
'readystate_uninitialized=0
'readystate_loading=1
'readystate_loaded=2
'readystate_interactive=3
'readystate_complete=4
c=c & sp2(registerasbrowser,obj.registerasbrowser,rw,op)
c=c & sp2(registerasdroptarget,obj.registerasdroptarget,rw,op)
c=c & sp2(resizable,obj.resizable,rw,op)
c=c & sp2(silent,obj.silent,rw,op)
c=c & sp2(statusbar,obj.statusbar,rw,op)
c=c & sp2(statustext,obj.statustext,rw,op)
c=c & sp2(theatermode,obj.theatermode,rw,op)
c=c & sp2(toolbar,obj.toolbar,rw,op)
c=c & sp2(top,obj.top,rw,op)
c=c & sp2(toplevelcontainer,obj.toplevelcontainer,r,op)
on error resume next
c=c & sp2(type,obj.type,r,op) 'document html
on error goto 0
c=c & sp2(visible,obj.visible,rw,op)
c=c & sp2(width,obj.width,rw,op)
c=c & sp(goback,0,op,navigates to the previous item in the history list)
c=c & sp(goforward,0,op,navigates to the next item in the history list)
c=c & sp(gohome,0,op,go home/start page)
c=c & sp(gosearch,0,op,go search page)
c=c & sp(navigate,3,op,navigates to a url or file(url[,flags][,targetframename]))
c=c & sp(refresh,0,op,refresh the currently viewed page)
c=c & sp(refresh2,1,op,refresh the currently viewed page([level]))
c=c & sp(stop,0,op,stops opening a file)
c=c & sp(quit,0,op,exits application and closes the open document)
'clienttowindow, getproperty, querystatuswb, execwb
c=c & sp(putproperty,0,op,associates value with the name property in the context of the object(property,value))
c=c & sp(navigate2,3,op,navigates to a url or file or pidl (url[,flags][,targetframename]))
c=c & sp(showbrowserbar,3,op,set browserbar to clsid (clsid[,show][,size]))
case ishellfolderviewdual 'explorer
c=c & sp2(application,obj.application,r,op)
c=c & sp2(folder,obj.folder,r,op)
on error resume next
c=c & sp2(parent,obj.parent,r,op)
on error goto 0
c=c & sp2(selecteditems,obj.selecteditems,r,op)
c=c & sp2(focuseditem,obj.focuseditem,r,op)
c=c & sp2(script,obj.script,r,op)
c=c & sp2(viewoptions,obj.viewoptions,r,op)
c=c & sp(selectitem,2,op,select the item (pvfi,flags))
'popupitemmenu
case ishellfolderviewdual2 'explorer en ftp
c=c & sp2(application,obj.application,r,op)
c=c & sp2(folder,obj.folder,r,op)
on error resume next
c=c & sp2(parent,obj.parent,r,op)
c=c & sp2(selecteditems,obj.selecteditems,r,op)
c=c & sp2(focuseditem,obj.focuseditem,r,op)
c=c & sp2(script,obj.script,r,op)
c=c & sp2(viewoptions,obj.viewoptions,r,op)
c=c & sp2(currentviewmode,obj.currentviewmode,rw,op)
on error goto 0
c=c & sp(selectitem,2,op,select the item (pvfi,flags))
c=c & sp(selectitemrelative,1,op,select item relative to the current item (irelative))
'popupitemmenu
case folder3
c=c & sp2(application,obj.application,r,op)
c=c & sp2(havetoshowwebviewbarricade,obj.havetoshowwebviewbarricade,r,op)
c=c & sp2(items,obj.items,r,op)
on error resume next
c=c & sp2(parent,obj.parent,r,op)
on error goto 0
c=c & sp2(offlinestatus,obj.offlinestatus,r,op)
c=c & sp2(parentfolder,obj.parentfolder,r,op)
c=c & sp2(self,obj.self,r,op)
c=c & sp2(showwebviewbarricade,obj.showwebviewbarricade,rw,op)
c=c & sp2(title,obj.title,r,op)
'parsename, getdetailsof
c=c & sp(newfolder,2,op,create a new sub folder in this folder (name[,options]))
c=c & sp(movehere,2,op,move items to this folder (item[,options]))
c=c & sp(copyhere,2,op,copy items to this folder (item[,options]))
c=c & sp(synchronize,0,op,synchronize all offline files)
c=c & sp(dismissedwebviewbarricade,0,op,call this after the webview barricade is dismissed by the user)
case folderitem2
c=c & sp2(application,obj.application,r,op)
if obj.islink then c=c & sp2(getlink,obj.getlink,r,op)
if obj.isfolder then c=c & sp2(getfolder,obj.getfolder,r,op)
c=c & sp2(isbrowsable,obj.isbrowsable,r,op)
c=c & sp2(isfilesystem,obj.isfilesystem,r,op)
c=c & sp2(isfolder,obj.isfolder,r,op)
c=c & sp2(islink,obj.islink,r,op)
c=c & sp2(modifydate,obj.modifydate,rw,op)
c=c & sp2(name,obj.name,rw,op)
c=c & sp2(parent,obj.parent,r,op)
c=c & sp2(path,obj.path,r,op)
c=c & sp2(size,obj.size,r,op)
c=c & sp2(type,obj.type,r,op)
c=c & sp2(verbs,obj.verbs,r,op)
c=c & sp(invokeverb,1,op,execute a command on the item ([verb]))
c=c & sp(invokeverbex,2,o
展开阅读全文