一些常用的IHTMLXX接口
生活随笔
收集整理的這篇文章主要介紹了
一些常用的IHTMLXX接口
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
最近經(jīng)常用到IHTMLxx接口,所以把一些常用的都收集起來,免得每次都查MSDN,麻煩。 IHTMLDocument2、IHTMLElement、IHTMLElementCollection、ITHMLFormElement、IHTMLInputElement、IHTMLTable、IHTMLAnchorElement 類IHTMLDocument2 1.???????activeElement
當當前文檔已經(jīng)focus某個對象時,得到該網(wǎng)頁元素 2.???????alinkColor
得到或者設置文檔中所有活動鏈接的顏色 3.???????all??????get_all(IHTMLElementCollection **p)
得到所有網(wǎng)頁元素集合的接口 4.???????anchors????get_anchors(IHTMLElementCollection **p)
得到所有鏈接元素集合的接口 5.???????applets??????get_applets(IHTMLElementCollection **p)
得到所有小應用程序元素集合的接口 6.???????bgColor
設置或者得到網(wǎng)頁對象的背景色 7.???????body???????????????????get_body(IHTMLElement **p)
得到body對象的集合 8.???????charset
得到或者設置網(wǎng)頁所有的編碼 9.???????cookie
得到或者設置cookie 10.???createElement_x
創(chuàng)建一個網(wǎng)頁元素(比如創(chuàng)建一個表、按鈕等) 11.???createStyleSheet 12.???defaultCharset
得到默認字符集 13.???designMode
得到或者設置文檔編輯的設計模式 14.???domain
得到或者設置當前文檔的域 15.???elementFromPoint
從坐標點得到網(wǎng)頁元素 16.???embeds??????????????get_embeds(IHTMLElementCollection **p)
從網(wǎng)頁中得到embeds對象集合 17.???execCommand 18.???execCommandShowHelp 19.???fgColor
得到或設置前景色 20.???fileCreatedDate????????fileModifiedDate??????fileUpdateDate????????filesize
獲得文件創(chuàng)建的日期、修改的日期、更新的日期,文件大小 21.???forms?????????get_forms(IHTMLElementCollection **p)
獲得表單元素集合的接口 22.???frames???????get_frames(IHTMLFramesCollection2 **p)
獲得幀元素集合的接口 23.???p_w_picpaths
獲得圖像元素集合的接口 24.???lastModified 25.???linkColor
得到或者設置網(wǎng)頁鏈接的顏色 26.???links????????????get_links(IHTMLElementCollection **p)
得到鏈接元素集合的接口 27.???location?????get_location(IHTMLLocation **p)
得到當前對象的location 28.???mimeType 29.???nameProp
得到文檔文件的標題 30.???onafterupdate
得到或者設置一個指向onafterupdate事件的指針 31.???onbeforeupdate 32.???onclick 33.???ondblclick 34.???ondragstart 35.???onerrorupdate 36.???onhelp 37.???onkeydown 38.???onkeypress 39.???onkeyup 40.???onmousedown 41.???onmousemove 42.???onmouseout 43.???onmouseover 44.???onmouseup 45.???onreadystatechange 46.???onrowenter 47.???onrowexit 48.???onselectstart 49.???open
打開一個新的窗口,指向給定的URL 50.???parentWindow
得到一個窗口容器對象的引用 51.???plugins
得到所有embed對象集合的接口 52.???protocol
得到或者設置URL所用的協(xié)議(比如HTTP HTTPS等) 53.???queryCommandEnabled 54.???queryCommandState 55.???queryCommandSupported 56.???queryCommandText 57.???queryCommandValue 58.???readState 59.???referrer 60.???scripts???????get_scripts(IHTMLElementCollection **p)
得到scripts元素集合的接口 61.???selection 62.???styleSheets 63.???title
得到或者設置文檔標題 64.???URL
得到或者設置當前文檔的URL 65.???vlinkColor
得到或者設置已打開過的鏈接的顏色 66.???write??????????writeln
向文檔中寫HTML 類IHTMLElementCollection 1.???????_newEnum 2.???????Item???????????item(VARIANT name,??VARIANT index, IDispatch **pdisp);
從集合中獲得對象 3.???????length???????get_length(long *p)
得到或者設置集合中有多少對象 4.???????tags????????????HRESULT tags(VARIANT tagName, IDispatch **pdisp )
獲得標簽名 類IHTMLElement 1.???????all????????????????get_all(IDispatch **p)
得到當前對象中的所有元素集合的接口 2.???????children?????get_children(IDispatch **p)
得到當前對象的子對象集合的接口 3.???????className
得到或者設置當前對象的類名 4.???????click
模擬點擊,產(chǎn)生一個onclick事件 5.???????contains
確認給定的元素是否在對象內 6.???????document??????????????????get_document(IHTMLDocument2 **p)
得到文檔接口 7.???????filters??????????????????get_filters(IHTMLFiltersCollection **p)
得到一個集合過濾器 8.???????getAttribute 9.???????id?????????????????get_id(BSTR *p)
得到對象的ID 10.???innerHTML????????get_innerHTML(BSTR *p)
在對象的開始標簽和結束標簽之間得到或者設置HTML 11.???innerText 12.???insertAdjacentHTML 13.???insertAdjacentText 14.???isTextEdit
確認對象是否是TextRange對象 15.???lang???language
設置或者得到使用的語言 16.???onafterupdate
得到或者設置一個指向onafterupdate事件的指針 17.???onbeforeupdate 18.???onclick 19.???ondblclick 20.???ondragstart 21.???onerrorupdate 22.???onhelp 23.???onkeydown 24.???onkeypress 25.???onkeyup 26.???onmousedown 27.???onmousemove 28.???onmouseout 29.???onmouseover 30.???onmouseup 31.???onreadystatechange 32.???onrowenter 33.???onrowexit 34.???onselectstart 35.???outerHTML 36.???outerText 37.???parentElement
得到對象的父對象值 38.???parentTextEdit 39.???recordNumber 40.???removeAttribute 41.???scrollIntoView 42.???setAttribute 43.???sourceIndex 44.???style 45.???tagname 46.???title 類ITHMLFormElement 1.?????????_newEnum??????Retrieves an enumerator for the collection. 2.?????????action??????Sets or retrieves the URL to which the form content is sent for processing. 3.?????????dir???Sets or retrieves the reading order of the object.? 4.?????????elements?????????get_elements(IDispatch **p);
????得到表單內元素的接口 5.?????????encoding??????????Sets or retrieves the MIME encoding for the form.? 6.?????????item?????????HRESULT item(VARIANT name, VARIANT index, IDispatch **pdisp)
????獲得表單內元素集合的接口 7.?????????length
????獲得表單個數(shù) 8.?????????method????????????Sets or retrieves how to send the form data to the server. 9.?????????name????????????????Sets or retrieves the name of the object. 10.?????onreset????????????Sets or retrieves a pointer to the event handler function associated with an event.? 11.?????onsubmit?????????Sets or retrieves a pointer to the event handler function associated with an event.? 12.?????reset
????模擬表單重置 13.?????submit
????模擬表單提交 14.?????tags??????????????????Retrieves a collection of objects that have the specified HTML tag name.? 15.???target?????????????????Sets or retrieves the window or frame at which to target content.? 類IHTMLInputElement 1.?????????align????????Sets or retrieves how the object is aligned with adjacent text.? 2.?????????alt????????????Sets or retrieves a text alternative to the graphic.? 3.?????????border?????Sets or retrieves the width of the border to draw around the object.? 4.?????????checked Sets or retrieves the state of the check box or radio button. 5.?????????complete?????????Retrieves whether the object is fully loaded. 6.?????????createTextRange????Creates a TextRange object for the element. 7.?????????defaultChecked???????Sets or retrieves the state of the check box or radio button.? 8.?????????defaultValue???Sets or retrieves the initial contents of the object.? 9.?????????disabled???????????Sets or retrieves a value that indicates whether the user can interact with the object.? 10.?????dynsrc??????????????Sets or retrieves the address of a video clip or VRML world to display in the window.? 11.?????form??????????????????Retrieves a reference to the form that the object is embedded in.? 12.?????height???????????????Sets or retrieves the height of the object.? 13.?????hspace?????????????Sets or retrieves the horizontal margin for the object.? 14.?????indeterminate?????????Sets or retrieves whether the user has changed the status of a check box. 15.?????loop???????????????????Sets or retrieves the number of times a sound or video clip will loop when activated.? 16.?????lowsrc?????????????Sets or retrieves a lower resolution p_w_picpath to display.? 17.?????maxLength??????Sets or retrieves the maximum number of characters that the user can enter in a text control.? 18.?????name????????????????Sets or retrieves the name of the object. 19.?????onabort????????????Sets or retrieves a pointer to the event handler function associated with the onabort event.????An onabort event occurs when loading the object causes an error. 20.?????onchange????????Sets or retrieves a pointer to the event handler function associated with the onchange event.??????????An onchange event occurs when the content of the object changes. 21.?????onchange????????Sets or retrieves a pointer to the event handler function associated with the onchange event.??????????An onchange event occurs when the content of the object changes. 22.?????onerror????????????Sets or retrieves a pointer to the event handler function associated with the onerror event. An onerror event occurs when loading the object causes an error. 23.?????onload??????????????Sets or retrieves a pointer to the event handler function associated with the onload event. The onload event occurs immediately after the browser loads the object. 24.?????onselect????????????????????Sets or retrieves a pointer to the event handler function associated with the onselect event. An onselect event occurs at the beginning of a user-initiated select. This event can be canceled, and it participates in the bubbling model. 25.?????readOnly??????????Sets or retrieves the value indicated whether the content of the object is read-only. 26.?????readyState??????Retrieves a value that indicates the current state of the object. 27.?????select???????????????Highlights the input area of a form element.? 28.?????size?????????????????????????????Sets or retrieves the size of the control.? 29.?????src????????????Sets or retrieves a URL to be loaded by the object.? 30.?????start????????Sets or retrieves when a video clip file should begin playing. 31.?????status?????Sets or retrieves the value indicating whether the control is selected. 32.?????type?????????Retrieves or initially sets (IHTMLInputElement only) the type of input control represented by the object. 33.?????value???????Sets or retrieves the default or selected value of the control. 34.?????vrml?????????Sets or retrieves the IHTMLDocument2::URL of the virtual reality modeling language (VRML) world to be displayed in the window.? 35.?????vspace????Sets or retrieves the vertical margin for the object.? 36.?????width???????Sets or retrieves the calculated width of the object.? IHTMLAnchorElement accessKey???????Sets or retrieves the accelerator key for the object. blur??????????Causes the element to lose focus and fires the onblur event. focus???????Causes the element to receive the focus and executes the code specified by the onfocus event.? hash????????Sets or retrieves the subsection of the IHTMLAnchorElement::href property that follows the number sign (#). host?????????Sets or retrieves the hostname and port number of the location or URL. hostname????????Sets or retrieves the host name part of the location or URL.? href??????????Sets or retrieves the destination URL or anchor point.? Methods??????????Sets or gets the list of HTTP methods supported by the object. mimeType???????Retrieves the MIME type for the file. name???????Sets or retrieves the name of the object. nameProp???????Retrieves the file name specified in the href or src property of the object. onblur?????Sets or retrieves a pointer to the event handler function associated with the onblur event. onfocus???Sets or retrieves a pointer to the event handler function associated with the onfocus event. pathname???????Sets or retrieves the file name or path specified by the object.? port?????????Sets or retrieves the port number associated with a URL. protocol Sets or retrieves the protocol portion of a URL.? protocolLong Gets the long name of the protocol, such as Hypertext Transfer Protocol, used by the browser to locate the item associated with the anchor. rel????????????Sets or retrieves the relationship between the object and the destination of the link. rev???????????Sets or retrieves the relationship between the object and the destination of the link. search?????Sets or retrieves the substring of the href property that follows the question mark.? tabIndex??????????Sets or retrieves the index that defines the tab order for the object. target?????Sets or retrieves the window or frame at which to target content.? urn???????????Sets or gets a Uniform Resource Name (URN) for a target document.? IHTMLTable align??????????????????Sets or retrieves a value that indicates the table alignment.? background?????Sets or retrieves the background picture tiled behind the text and graphics in the object.? bgColor????????????Deprecated. Sets or retrieves the background color behind the object.? border?????S???????ets or retrieves the width of the border to draw around the object.? borderColor????Sets or retrieves the border color of the object.? borderColorDark????Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. borderColorLight????Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. caption?????????????Retrieves the caption object of the table.? cellPadding?????Sets or retrieves the amount of space between the border of the cell and the content of the cell.? cellSpacing??????Sets or retrieves the amount of space between cells in a table.? cols???????????????????Sets or retrieves the number of columns in the table.? createCaption?????????Creates an empty caption element in the table. createTFoot????Creates an empty tFoot element in the table.? createTHead???????????Creates an empty tHead element in the table.? dataPageSize????????????????????Sets or retrieves the number of records displayed in a table bound to a data source.? deleteCaption?????????Deletes the caption element and its contents from the table.? deleteRow??????Removes the specified row (tr) from the element and from the rows collection.? deleteTFoot?????????????Deletes the tFoot element and its contents from the table.? deleteTHead????????????Deletes the tHead element and its contents from the table.? frame???????????????Sets or retrieves the way the border frame around the table is displayed.? height???????????????Sets or retrieves the height of the object.? insertRow???????Creates a new row (tr) in the table, and adds the row to the rows collection.? nextPage?????????Displays the next page of records in the data set to which the table is bound. onreadystatechange??????Sets or retrieves a pointer to the event handler function associated with the onreadystatechange event. previousPage???????????Displays the previous page of records in the data set to which the table is bound. readyState??????Retrieves a value that indicates the current state of the object. refresh?????????????Refreshes the content of the table. This might be necessary after a call to a method such as IHTMLStyleSheet::removeRule, when the page does not automatically reflow. rows?????????????????Retrieves a collection of all rows in the table. This is a collection of all the tr elements???????defined in the tHead, tBody, and tFoot elements of the table.? rules?????????????????Sets or retrieves which dividing lines (inner borders) are displayed.? tBodies????????????Returns a collection of TBODY elements defined in this table. The length of this collection is the count of table bodies returned.? tFoot?????????????????Retrieves an IHTMLTableSection pointer to the foot section of a table. tHead???????????????Retrieves an IHTMLTableSection pointer to the head section of a table. width????????????????Sets or retrieves the width of the object. 本文來自CSDN博客,轉載請標明出處:http://blog.csdn.net/starflier/archive/2010/06/02/5641431.aspx
轉載于:https://blog.51cto.com/wellwy/492066
與50位技術專家面對面20年技術見證,附贈技術全景圖總結
以上是生活随笔為你收集整理的一些常用的IHTMLXX接口的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: MSDE 1433端口
- 下一篇: 【联盟】三星大容量MLC FLASH 换