MSHTML Classes: CWindow

Arguably the starting point for scripting Internet Explorer is the window object. The internal representation in MSHTML is ultimately the CWindow class.

Identifiers

coclass: HTMLWindow2 {D48A6EC6-6A4A-11CF-94A7-444553540000}
dispinterface: DispHTMLWindow2 {3050F55D-98B5-11CF-BB82-00AA00BDCE0B}

Interfaces

The window object implements the following interfaces:

Note the “private” interfaces, which Microsoft does not document.

Scripting

Of course, only some of those interfaces are intended for scripting. The table below lists the interface members that the CWindow class exposes as properties (methods, collections, etc) through its string table. Properties that Microsoft does not list in the HTML and DHTML Reference are highlighted yellow. Properties that are listed but not as applying to the window object are shaded yellow.

Property Attribute Interface Member
alert   IHTMLWindow2 alert
attachEvent   IHTMLWindow3 attachEvent
blur   IHTMLWindow2 blur
clearInterval   IHTMLWindow2 clearInterval
clearTimeout   IHTMLWindow2 clearTimeout
clientInformation   IHTMLWindow2 get_clientInformation
clipboardData   IHTMLWindow3 get_clipboardData
close   IHTMLWindow2 close
closed   IHTMLWindow2 get_closed
confirm   IHTMLWindow2 confirm
createPopup   IHTMLWindow4 createPopup
defaultStatus   IHTMLWindow2 get_defaultStatus
put_defaultStatus
detachEvent   IHTMLWindow3 detachEvent
document   IHTMLWindow2 get_document
event   IHTMLWindow2 get_event
execScript   IHTMLWindow2 execScript
external   IHTMLWindow2 get_external
focus   IHTMLWindow2 focus
frameElement   IHTMLWindow4 get_frameElement
frames   IHTMLWindow2 get_frames
history   IHTMLWindow2 get_history
Image   IHTMLWindow2 get_Image
item   IHTMLWindow2 item
length   IHTMLWindow2 length
location   IHTMLWindow2 get_location
moveBy   IHTMLWindow2 moveBy
moveTo   IHTMLWindow2 moveTo
name   IHTMLWindow2 get_name
put_name
navigate   IHTMLWindow2 navigate
navigator   IHTMLWindow2 get_navigator
_newEnum   IHTMLWindow2 get__newEnum
offscreenBuffering   IHTMLWindow2 get_offscreenBuffering
put_offscreenBuffering
onafterprint same IHTMLWindow3 get_onafterprint
put_onafterprint
onbeforeprint same IHTMLWindow3 get_onbeforeprint
put_onbeforeprint
onbeforeunload same IHTMLWindow2 get_onbeforeunload
put_onbeforeunload
onblur same IHTMLWindow2 get_onblur
put_onblur
onerror same IHTMLWindow2 get_onerror
put_onerror
onfocus same IHTMLWindow2 get_onfocus
put_onfocus
onhelp same IHTMLWindow2 get_onhelp
put_onhelp
onload same IHTMLWindow2 get_onload
put_onload
onresize same IHTMLWindow2 get_onresize
put_onresize
onscroll same IHTMLWindow2 get_onscroll
put_onscroll
onunload same IHTMLWindow2 get_onunload
put_onunload
open   IHTMLWindow2 open
opener   IHTMLWindow2 get_opener
put_opener
Option   IHTMLWindow2 get_Option
parent   IHTMLWindow2 get_parent
print   IHTMLWindow3 print
prompt   IHTMLWindow2 prompt
resizeBy   IHTMLWindow2 resizeBy
resizeTo   IHTMLWindow2 resizeTo
screen   IHTMLWindow2 get_screen
screenLeft   IHTMLWindow3 get_screenLeft
screenTop   IHTMLWindow3 get_screenTop
scroll   IHTMLWindow2 scroll
scrollBy   IHTMLWindow2 scrollBy
scrollTo   IHTMLWindow2 scrollTo
self   IHTMLWindow2 get_self
setInterval   IHTMLWindow3 setInterval
setTimeout   IHTMLWindow3 setTimeout
showHelp   IHTMLWindow2 showHelp
showModalDialog   IHTMLWindow2 showModalDialog
showModelessDialog   IHTMLWindow3 showModelessDialog
status   IHTMLWindow2 get_status
put_status
top   IHTMLWindow2 get_top
toString   IHTMLWindow2 toString
window   IHTMLWindow2 get_window
XMLHttpRequest   IHTMLWindow5 get_XMLHttpRequest
put_XMLHttpRequest