CHtmlEditCtrlBase Class
Represents an HTML editing component.
template <class T> class CHtmlEditCtrlBase
Name | Description |
---|---|
CHtmlEditCtrlBase::AddToGlyphTable | Adds an entry to the glyph table, which specifies images to display for specific tags in design mode. |
CHtmlEditCtrlBase::Bold | Toggles the bold state of the selected text. |
CHtmlEditCtrlBase::Button | Overwrites a button control on the current selection. |
CHtmlEditCtrlBase::CheckBox | Overwrites a check box control on the current selection. |
CHtmlEditCtrlBase::ClearSelection | Clears the current selection. |
CHtmlEditCtrlBase::Copy | Copies the current selection to the clipboard. |
CHtmlEditCtrlBase::Cut | Copies the current selection to the clipboard and then deletes it. |
CHtmlEditCtrlBase::Delete | Deletes the current selection. |
CHtmlEditCtrlBase::DropDownBox | Overwrites a drop-down selection control on the current selection. |
CHtmlEditCtrlBase::EmptyGlyphTable | Removes all entries from the glyph table, which hides all images displayed for tags in design mode. |
CHtmlEditCtrlBase::ExecCommand | Executes a command. |
CHtmlEditCtrlBase::Font | Opens a font dialog box to enable the user to change the text color, font, and font size of the current selection. |
CHtmlEditCtrlBase::GetAbsolutePosition | Returns whether an element's position property is "absolute." |
CHtmlEditCtrlBase::GetBackColor | Retrieves the background color of the current selection. |
CHtmlEditCtrlBase::GetBlockFormat | Retrieves the current block format tag. |
CHtmlEditCtrlBase::GetBlockFormatNames | Retrieves the strings corresponding to the available block format tags. |
CHtmlEditCtrlBase::GetBookMark | Retrieves the name of a bookmark anchor. |
CHtmlEditCtrlBase::GetDocument | Retrieves the document object. |
CHtmlEditCtrlBase::GetDocumentHTML | Retrieves the HTML of the current document. |
CHtmlEditCtrlBase::GetDocumentTitle | Retrieves the document's title. |
CHtmlEditCtrlBase::GetEvent | Retrieves an interface pointer to the event object that contains information relevant to the most recent event. |
CHtmlEditCtrlBase::GetEventSrcElement | Retrieves the object that fired the event. |
CHtmlEditCtrlBase::GetFontFace | Retrieves the font name for the current selection. |
CHtmlEditCtrlBase::GetFontSize | Retrieves the font size for the current selection. |
CHtmlEditCtrlBase::GetForeColor | Retrieves the foreground (text) color of the current selection. |
CHtmlEditCtrlBase::GetFrameZone | Returns the security zone of the current page in the web browser. |
CHtmlEditCtrlBase::GetIsDirty | Indicates whether the HTML document has changed. |
CHtmlEditCtrlBase::GetShowAlignedSiteTags | Returns whether a glyph is displayed for all elements that have a styleFloat property. |
CHtmlEditCtrlBase::GetShowAllTags | Returns whether the WebBrowser displays glyphs to show the location of all tags in a document. |
CHtmlEditCtrlBase::GetShowAreaTags | Retrieves whether the WebBrowser displays a glyph for area tags. |
CHtmlEditCtrlBase::GetShowBRTags | Retrieves whether the WebBrowser displays a glyph for br tags. |
CHtmlEditCtrlBase::GetShowCommentTags | Retrieves whether the WebBrowser displays a glyph for comment tags. |
CHtmlEditCtrlBase::GetShowMiscTags | Retrieves whether the WebBrowser displays all the tags shown in Microsoft Internet Explorer 4.0. |
CHtmlEditCtrlBase::GetShowScriptTags | Retrieves whether the WebBrowser displays a glyph for all the script tags. |
CHtmlEditCtrlBase::GetShowStyleTags | Retrieves whether the WebBrowser displays a glyph for all the style tags. |
CHtmlEditCtrlBase::GetShowUnknownTags | Retrieves whether the WebBrowser displays a glyph for all unknown tags. |
CHtmlEditCtrlBase::HorizontalLine | Overwrites a horizontal line on the current selection. |
CHtmlEditCtrlBase::HyperLink | Inserts a hyperlink on the current selection. |
CHtmlEditCtrlBase::IE50Paste | Performs a paste operation compatible with Microsoft Internet Explorer 5. |
CHtmlEditCtrlBase::Iframe | Overwrites an inline frame on the current selection. |
CHtmlEditCtrlBase::Image | Overwrites an image on the current selection. |
CHtmlEditCtrlBase::Indent | Increases the indent of the selected text by one indentation increment. |
CHtmlEditCtrlBase::InsFieldSet | Overwrites a box on the current selection. |
CHtmlEditCtrlBase::InsInputButton | Overwrites a button control on the current selection. |
CHtmlEditCtrlBase::InsInputHidden | Inserts a hidden control on the current selection. |
CHtmlEditCtrlBase::InsInputImage | Overwrites an image control on the current selection. |
CHtmlEditCtrlBase::InsInputPassword | Overwrites a password control on the current selection. |
CHtmlEditCtrlBase::InsInputReset | Overwrites a reset control on the current selection. |
CHtmlEditCtrlBase::InsInputSubmit | Overwrites a submit control on the current selection. |
CHtmlEditCtrlBase::InsInputUpload | Overwrites a file upload control on the current selection. |
CHtmlEditCtrlBase::Is1DElement | Determines if an element is statically positioned. |
CHtmlEditCtrlBase::Is2DElement | Determines if an element is absolutely positioned. |
CHtmlEditCtrlBase::Italic | Toggles the current selection between italic and nonitalic. |
CHtmlEditCtrlBase::JustifyCenter | Centers the format block in which the current selection is located. |
CHtmlEditCtrlBase::JustifyLeft | Left-justifies the format block in which the current selection is located. |
CHtmlEditCtrlBase::JustifyRight | Right-justifies the format block in which the current selection is located. |
CHtmlEditCtrlBase::ListBox | Overwrites a list box selection control on the current selection. |
CHtmlEditCtrlBase::Marquee | Overwrites an empty marquee on the current selection. |
CHtmlEditCtrlBase::NewDocument | Creates a new document. |
CHtmlEditCtrlBase::OrderList | Toggles the current selection between an ordered list and a normal format block. |
CHtmlEditCtrlBase::Outdent | Decreases by one increment the indentation of the format block in which the current selection is located. |
CHtmlEditCtrlBase::Paragraph | Overwrites a line break on the current selection. |
CHtmlEditCtrlBase::Paste | Overwrites the contents of the clipboard on the current selection. |
CHtmlEditCtrlBase::PrintDocument | Prints the current document. |
CHtmlEditCtrlBase::PrintPreview | Opens the Print Preview window for the current document using either the default print preview template or a custom template. |
CHtmlEditCtrlBase::QueryStatus | Call this method to query the status of commands. |
CHtmlEditCtrlBase::RadioButton | Overwrites a radio control on the current selection. |
CHtmlEditCtrlBase::RefreshDocument | Refreshes the current document. |
CHtmlEditCtrlBase::RemoveFormat | Removes the formatting tags from the current selection. |
CHtmlEditCtrlBase::SaveAs | Saves the current Web page to a file. |
CHtmlEditCtrlBase::SelectAll | Selects the entire document. |
CHtmlEditCtrlBase::Set2DPosition | Allows absolutely positioned elements to be moved by dragging. |
CHtmlEditCtrlBase::SetAbsolutePosition | Sets an element's position property to "absolute" or "static." |
CHtmlEditCtrlBase::SetAtomicSelection | Set atomic selection mode. |
CHtmlEditCtrlBase::SetAutoURLDetectMode | Turns automatic URL detection on and off. |
CHtmlEditCtrlBase::SetBackColor | Sets the background color of the current selection. |
CHtmlEditCtrlBase::SetBlockFormat | Sets the current block format tag. |
CHtmlEditCtrlBase::SetBookMark | Creates a bookmark anchor for the current selection or insertion point. |
CHtmlEditCtrlBase::SetCSSEditingLevel | Selects which CSS level (CSS1 or CSS2) the editor will support, if any. |
CHtmlEditCtrlBase::SetDefaultComposeSettings | Call this method to set the default compose settings. |
CHtmlEditCtrlBase::SetDesignMode | Set design mode. |
CHtmlEditCtrlBase::SetDisableEditFocusUI | Disables the hatched border and handles around an element that has edit focus. |
CHtmlEditCtrlBase::SetDocumentHTML | Sets the HTML of the current document. |
CHtmlEditCtrlBase::SetFontFace | Sets the font for the current selection. |
CHtmlEditCtrlBase::SetFontSize | Sets the font size for the current selection. |
CHtmlEditCtrlBase::SetForeColor | Sets the foreground (text) color of the current selection. |
CHtmlEditCtrlBase::SetIE5PasteMode | Sets the paste operation to be compatible with Microsoft Internet Explorer 5. |
CHtmlEditCtrlBase::SetLiveResize | Causes the WebBrowser to update an element's appearance continuously during a resizing or moving operation. |
CHtmlEditCtrlBase::SetMultiSelect | Enables multiple selection. |
CHtmlEditCtrlBase::SetOverrideCursor | Commands the WebBrowser never to change the mouse pointer. |
CHtmlEditCtrlBase::SetOverwriteMode | Toggles the text-entry mode between insert and overwrite. |
CHtmlEditCtrlBase::SetRespectVisInDesign | Hides invisible elements in design mode. |
CHtmlEditCtrlBase::SetShowAlignedSiteTags | Displays a glyph for all elements that have a styleFloat property. |
CHtmlEditCtrlBase::SetShowAllTags | Displays glyphs to show the location of all tags in a document. |
CHtmlEditCtrlBase::SetShowAreaTags | Displays a glyph for all the area tags. |
CHtmlEditCtrlBase::SetShowBRTags | Displays a glyph for all the br tags. |
CHtmlEditCtrlBase::SetShowCommentTags | Displays a glyph for all the comment tags. |
CHtmlEditCtrlBase::SetShowMiscTags | Displays all the tags shown in Microsoft Internet Explorer 4.0. |
CHtmlEditCtrlBase::SetShowScriptTags | Displays a glyph for all the script tags. |
CHtmlEditCtrlBase::SetShowStyleTags | Displays a glyph for all the style tags. |
CHtmlEditCtrlBase::SetShowUnknownTags | Displays a glyph for all the unknown tags. |
CHtmlEditCtrlBase::TextArea | Overwrites a multiline text input control on the current selection. |
CHtmlEditCtrlBase::TextBox | Overwrites a text control on the current selection. |
CHtmlEditCtrlBase::UnBookmark | Removes any bookmark from the current selection. |
CHtmlEditCtrlBase::Underline | Toggles the current selection between underlined and not underlined. |
CHtmlEditCtrlBase::Unlink | Removes any hyperlink from the current selection. |
CHtmlEditCtrlBase::UnorderList | Toggles the current selection between an ordered list and a normal format block. |
T
The name of the derived class.
CHtmlEditCtrlBase
provides member functions for the WebBrowser's HTML editing commands, such as Bold. (Alternately, you can call ExecCommand to execute the IDM_BOLD command.)
CHtmlEditCtrlBase
is not intended to stand on its own. It is designed to be a base class for derived classes that expose the HTML editing functionality of the WebBrowser (see CHtmlEditCtrl and CHtmlEditView).
CHtmlEditCtrlBase
Header: afxhtml.h
Adds an entry to the glyph table, which specifies images to display for specific tags in design mode.
HRESULT AddToGlyphTable(
LPCTSTR szTag,
LPCTSTR szImgUrl,
unsigned short nTagType,
unsigned short nAlignment,
unsigned short nPosInfo,
unsigned short nDirection,
unsigned int nImgWidth,
unsigned int nImgHeight) const;
szTag
The tag name (for example, "P" or "table").
szImgUrl
The image URL.
nTagType
Tag type: 0 means the image is for the opening tag only. 1 means the image is for the closing tag only. 2 means the image is for both the opening and closing tags. Single tags such as br and comment must be added with the tag type set to 0.
nAlignment
Alignment (rectangular elements only): This parameter indicates that the image is for an element with an alignment attribute. Left = 0, center = 1, right = 2, and undefined = 3. Left, right, or center attributes must be explicitly set on the element.
nPosInfo
Positioning information. Determines what cascading style sheets (CSS) positioning value the glyph applies to, where static positioning = 0, absolute positioning = 1, relative positioning = 2, and all = 3. This field enables you to specify one glyph for a tag when it is not positioned and another glyph to show an anchor point when the tag is positioned.
nDirection
The direction. This parameter specifies the image for a tag based on the reading order of the current language. 0 specifies left to right, 1 specifies right to left, 2 specifies top to bottom, 3 specifies bottom to top, and 4 specifies all. You normally set this field to 4.
nImgWidth
The image width in pixels.
nImgHeight
The image height in pixels.
Returns S_OK on success, or an error HRESULT on failure.
For more information on the parameters, see "Glyph Table String Format" in Using Editing Glyphs.
This method sends the IDM_ADDTOGLYPHTABLE command ID to the WebBrowser control.
Toggles the bold state of the selected text.
HRESULT Bold() const;
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_BOLD command ID to the WebBrowser control.
Overwrites a button control on the current selection.
HRESULT Button(LPCTSTR szId = NULL) const;
szId
The ID of the button control.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_BUTTON command ID to the WebBrowser control.
Overwrites a check box control on the current selection.
HRESULT CheckBox(LPCTSTR szId = NULL) const;
szId
The ID of the check box control.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_CHECKBOX command ID to the WebBrowser control.
Clears the current selection.
HRESULT ClearSelection() const;
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_CLEARSELECTION command ID to the WebBrowser control.
Copies the current selection to the clipboard.
HRESULT Copy() const;
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_COPY command ID to the WebBrowser control.
Copies the current selection to the clipboard and then deletes it.
HRESULT Cut() const;
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_CUT command ID to the WebBrowser control.
Deletes the current selection.
HRESULT Delete() const;
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_DELETE command ID to the WebBrowser control.
Overwrites a drop-down selection control on the current selection.
HRESULT DropDownBox(LPCTSTR szId = NULL) const;
szId
The ID of the drop-down selection control.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_DROPDOWNBOX command ID to the WebBrowser control.
Removes all entries from the glyph table, which hides all images displayed for tags in design mode.
HRESULT EmptyGlyphTable() const;
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_EMPTYGLYPHTABLE command ID to the WebBrowser control.
Executes a command.
HRESULT ExecCommand(
long cmdID,
long cmdExecOpt,
VARIANT* pInVar = NULL,
VARIANT* pOutVar = NULL) const;
HRESULT ExecCommand(
const GUID* pGuid,
long cmdID,
long cmdExecOpt,
VARIANT* pInVar = NULL,
VARIANT* pOutVar = NULL) const;
cmdID
The command ID to be executed. For a list, see MSHTML Command Identifiers.
cmdExecOpt
Values taken from the OLECMDEXECOPT enumeration, which describe how the object should execute the command.
pInVar
The input arguments.
pOutVar
The command output.
pGuid
The GUID of the command group.
Returns S_OK on success, or an error HRESULT on failure.
This method provides the functionality of IOleCommandTarget::Exec.
Opens a font dialog box to enable the user to change the text color, font, and font size of the current selection.
HRESULT Font() const;
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_FONT command ID to the WebBrowser control.
Returns whether an element's position property is "absolute."
HRESULT GetAbsolutePosition(bool& bCurValue) const;
bCurValue
TRUE if the element's position property is set to "absolute."
Returns S_OK on success, or an error HRESULT on failure.
For more information, see IDM_ABSOLUTE_POSITION Command ID.
Retrieves the background color of the current selection.
HRESULT GetBackColor(int& nColor) const;
nColor
The background color.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_BACKCOLOR Command ID to the WebBrowser control.
Retrieves the current block format tag.
HRESULT GetBlockFormat(CString& strFormat) const;
strFormat
The current block format tag.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_BLOCKFMT command ID to the WebBrowser control.
Retrieves the strings corresponding to the available block format tags.
HRESULT GetBlockFormatNames(CStringArray& sa) const;
sa
The available block format tags, as an array of strings.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_GETBLOCKFMTS command ID to the WebBrowser control.
Retrieves the name of a bookmark anchor.
HRESULT GetBookMark(CString& strAnchor) const;
strAnchor
The name of a bookmark anchor.
Returns S_OK on success, or an error HRESULT on failure.
For more information, see IDM_BOOKMARK Command ID.
Retrieves the document object.
HRESULT GetDocument(IHTMLDocument2** ppDoc) const;
ppDoc
The document object.
Returns S_OK on success, or an error HRESULT on failure.
Retrieves the HTML of the current document.
HRESULT GetDocumentHTML(CString& szHTML) const;
szHTML
The HTML.
Returns S_OK on success, or an error HRESULT on failure.
Retrieves the document's title.
HRESULT GetDocumentTitle(CString& szTitle) const;
szTitle
The document's title.
Returns S_OK on success, or an error HRESULT on failure.
Retrieves an interface pointer to the event object that contains information relevant to the most recent event.
HRESULT GetEvent(IHTMLEventObj** ppEventObj) const;
ppEventObj
The event object.
Returns S_OK on success, or an error HRESULT on failure.
Retrieves the object that fired the event.
HRESULT GetEventSrcElement(IHTMLElement** ppSrcElement) const;
ppSrcElement
The element that fired the event.
Returns S_OK on success, or an error HRESULT on failure.
Retrieves the font name for the current selection.
HRESULT GetFontFace(CString& strFace) const;
strFace
The font name.
Returns S_OK on success, or an error HRESULT on failure.
If the current selection uses more than one font, strFace will be an empty string.
This method sends the IDM_FONTNAME command ID to the WebBrowser control.
Retrieves the font size for the current selection.
HRESULT GetFontSize(short& nSize) const;
nSize
The font size.
Returns the HTML font size (1-7). Returns 0 if the selection contains multiple font sizes.
This method sends the IDM_FONTSIZE command ID to the WebBrowser control.
Retrieves the foreground (text) color of the current selection.
HRESULT GetForeColor(int& nColor);
nColor
The foreground color.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_FORECOLOR Command ID to the WebBrowser control.
Returns the security zone of the current page in the web browser.
HRESULT GetFrameZone(short& nZone) const;
nZone
The security zone.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_GETFRAMEZONE command ID to the WebBrowser control.
Indicates whether the HTML document has changed.
HRESULT GetIsDirty() const;
Indicates whether the document has changed. GetIsDirty
returns an HRESULT from IPersistStorage::IsDirty.
Returns whether a glyph is displayed for all elements that have a styleFloat
property.
HRESULT GetShowAlignedSiteTags(bool& bCurValue) const;
bCurValue
TRUE if a glyph is displayed for all elements that have a styleFloat
property; FALSE if no glyph is displayed.
Returns S_OK on success, or an error HRESULT on failure.
For more information, see IDM_SHOWALIGNEDSITETAGS Command ID.
Returns whether the WebBrowser displays glyphs to show the location of all tags in a document.
HRESULT GetShowAllTags(bool& bCurValue) const;
bCurValue
TRUE if the WebBrowser displays glyphs to show the location of all tags in a document; FALSE if it does not.
Returns S_OK on success, or an error HRESULT on failure.
For more information, see IDM_SHOWALLTAGS Command ID.
Retrieves whether the WebBrowser displays a glyph for area tags.
HRESULT GetShowAreaTags(bool& bCurValue) const;
bCurValue
TRUE if the WebBrowser displays a glyph for area tags, FALSE if it does not.
Returns S_OK on success, or an error HRESULT on failure.
For more information, see IDM_SHOWAREATAGS Command ID.
Retrieves whether the WebBrowser displays a glyph for br tags.
HRESULT GetShowBRTags(bool& bCurValue) const;
bCurValue
TRUE if the WebBrowser displays a glyph for br tags, FALSE if it doesn't.
Returns S_OK on success, or an error HRESULT on failure.
For more information, see IDM_SHOWWBRTAGS Command ID.
Retrieves whether the WebBrowser displays a glyph for comment tags.
HRESULT GetShowCommentTags(bool& bCurValue) const;
bCurValue
TRUE if the WebBrowser displays a glyph for comment tags, FALSE if it doesn't.
Returns S_OK on success, or an error HRESULT on failure.
For more information, see IDM_SHOWCOMMENTTAGS Command ID.
Retrieves whether the WebBrowser displays all the tags shown in Microsoft Internet Explorer 4.0.
HRESULT GetShowMiscTags(bool& bCurValue) const;
bCurValue
TRUE if the WebBrowser displays all the tags shown in Microsoft Internet Explorer 4.0, FALSE if it does not.
Returns S_OK on success, or an error HRESULT on failure.
For more information, see IDM_SHOWMISCTAGS Command ID.
Retrieves whether the WebBrowser displays a glyph for all the script tags.
HRESULT GetShowScriptTags(bool& bCurValue) const;
bCurValue
TRUE if the WebBrowser displays a glyph for all the script tags, FALSE if it does not.
Returns S_OK on success, or an error HRESULT on failure.
For more information, see IDM_SHOWSCRIPTTAGS Command ID.
Retrieves whether the WebBrowser displays a glyph for all the style tags.
HRESULT GetShowStyleTags(bool& bCurValue) const;
bCurValue
TRUE if the WebBrowser displays a glyph for all the style tags, FALSE if it does not
Returns S_OK on success, or an error HRESULT on failure.
For more information, see IDM_SHOWSTYLETAGS Command ID.
Retrieves whether the WebBrowser displays a glyph for all unknown tags.
HRESULT GetShowUnknownTags(bool& bCurValue) const;
bCurValue
TRUE if the WebBrowser displays a glyph for all unknown tags, FALSE if it does not.
Returns S_OK on success, or an error HRESULT on failure.
For more information, see IDM_SHOWUNKNOWNTAGS Command ID.
Overwrites a horizontal line on the current selection.
HRESULT HorizontalLine(LPCTSTR szId = NULL) const;
szID
The ID for the horizontal line.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_HORIZONTALLINE command ID to the WebBrowser control.
Inserts a hyperlink on the current selection.
HRESULT HyperLink(LPCTSTR szUrl = NULL) const;
szUrl
The hyperlink URL.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_HYPERLINK command ID to the WebBrowser control.
Performs a paste operation that's compatible with Internet Explorer 5.
HRESULT IE50Paste(LPCTSTR szData) const;
szData
The string to paste.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_IE50_PASTE command ID to the WebBrowser control.
Overwrites an inline frame on the current selection.
HRESULT Iframe(LPCTSTR szId = NULL) const;
szId
The ID for the inline frame.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_IFRAME command ID to the WebBrowser control.
Overwrites an image on the current selection.
HRESULT Image(LPCTSTR szUrl = NULL) const;
szUrl
The path and file name of the image to be inserted.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_IMAGE command ID to the WebBrowser control.
Increases the indent of the selected text by one indentation increment.
HRESULT Indent() const;
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_INDENT command ID to the WebBrowser control.
Overwrites a box on the current selection.
HRESULT InsFieldSet(LPCTSTR szId = NULL) const;
szId
The ID for the box.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_INSFIELDSET command ID to the WebBrowser control.
Overwrites a button control on the current selection.
HRESULT InsInputButton(LPCTSTR szId = NULL) const;
szId
The ID for the button control.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_INSINPUTBUTTON command ID to the WebBrowser control.
Inserts a hidden control on the current selection.
HRESULT InsInputHidden(LPCTSTR szId = NULL) const;
szId
The ID for the hidden control.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_INSINPUTHIDDEN command ID to the WebBrowser control.
Overwrites an image control on the current selection.
HRESULT InsInputImage(LPCTSTR szId = NULL) const;
szId
The ID for the image control.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_INSINPUTIMAGE command ID to the WebBrowser control.
Overwrites a password control on the current selection.
HRESULT InsInputPassword(LPCTSTR szId = NULL) const;
szId
The ID for the password control.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_INSINPUTPASSWORD command ID to the WebBrowser control.
Overwrites a reset control on the current selection.
HRESULT InsInputReset(LPCTSTR szId = NULL) const;
szId
The ID for the reset control.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_INSINPUTRESET command ID to the WebBrowser control.
Overwrites a submit control on the current selection.
HRESULT InsInputSubmit(LPCTSTR szId = NULL) const;
szId
The ID for the submit control.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_INSINPUTSUBMIT command ID to the WebBrowser control.
Overwrites a file upload control on the current selection.
HRESULT InsInputUpload(LPCTSTR szId = NULL) const;
szId
The ID for the file upload control.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_INSINPUTUPLOAD command ID to the WebBrowser control.
Determines if an element is statically positioned.
HRESULT Is1DElement(bool& bValue) const;
bValue
TRUE if the element is statically positioned, FALSE otherwise.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_1D_ELEMENT command ID to the WebBrowser control.
Determines if an element is absolutely positioned.
HRESULT Is2DElement(bool& bValue) const;
bValue
TRUE if the element is absolutely positioned, FALSE otherwise.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_2D_ELEMENT command ID to the WebBrowser control.
Toggles the current selection between italic and nonitalic.
HRESULT Italic() const;
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_ITALIC command ID to the WebBrowser control.
Centers the format block in which the current selection is located.
HRESULT JustifyCenter() const;
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_JUSTIFYCENTER command ID to the WebBrowser control.
Left-justifies the format block in which the current selection is located.
HRESULT JustifyLeft() const;
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_JUSTIFYLEFT command ID to the WebBrowser control.
Right-justifies the format block in which the current selection is located.
HRESULT JustifyRight() const;
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_JUSTIFYRIGHT command ID to the WebBrowser control.
Overwrites a list box selection control on the current selection.
HRESULT ListBox(LPCTSTR szId = NULL) const;
szId
The ID for the list box control.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_LISTBOX command ID to the WebBrowser control.
Overwrites an empty marquee on the current selection.
HRESULT Marquee(LPCTSTR szId = NULL) const;
szId
The ID for the marquee.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_MARQUEE command ID to the WebBrowser control.
Creates a new document.
HRESULT NewDocument() const;
Returns S_OK on success, or an error HRESULT on failure.
Toggles the current selection between an ordered list and a normal format block.
HRESULT OrderList(LPCTSTR szId = NULL) const;
szId
The ID for the ordered list.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_ORDERLIST command ID to the WebBrowser control.
Decreases by one increment the indentation of the format block in which the current selection is located.
HRESULT Outdent() const;
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_OUTDENT command ID to the WebBrowser control.
Overwrites a line break on the current selection.
HRESULT Paragraph(LPCTSTR szId = NULL) const;
szId
The ID for the paragraph.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_PARAGRAPH command ID to the WebBrowser control.
Overwrites the contents of the clipboard on the current selection.
HRESULT Paste() const;
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_PASTE command ID to the WebBrowser control.
Prints the current document.
HRESULT PrintDocument() const;
HRESULT PrintDocument(LPCTSTR szPrintTemplate) const;
HRESULT PrintDocument(bool bShowPrintDialog) const;
szPrintTemplate
Path to a print template; if none is specified, the default print template is used.
bShowPrintDialog
If TRUE, shows the Print dialog.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_PRINT command ID to the WebBrowser control.
Opens the Print Preview window for the current document using either the default print preview template or a custom template.
HRESULT PrintPreview() const;
HRESULT PrintPreview(LPCTSTR szPrintTemplate) const;
szPrintTemplate
Path to a print template.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_PRINTPREVIEW command ID to the WebBrowser control.
Call this method to query the status of commands.
long QueryStatus(long cmdID) const;
cmdID
The command ID. Command identifiers are taken from the CGID_MSHTML command group. These commands are defined in Mshtmcid.h. You can also find the list online at MSHTML Command Identifiers.
Returns an OLECMDF indicating the status for cmdID, or 0 on failure.
Overwrites a radio control on the current selection.
HRESULT RadioButton(LPCTSTR szId = NULL) const;
szId
The ID of the radio button.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_RADIOBUTTON command ID to the WebBrowser control.
Refreshes the current document.
HRESULT RefreshDocument() const;
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_REFRESH Command ID to the WebBrowser control.
Removes the formatting tags from the current selection.
HRESULT RemoveFormat() const;
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_REMOVEFORMAT command ID to the WebBrowser control.
Saves the current Web page to a file.
HRESULT SaveAs(LPCTSTR szPath = NULL) const;
szPath
The path and file name to which to save the Web page.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_SAVEAS command ID to the WebBrowser control.
Selects the entire document.
HRESULT SelectAll() const;
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_SELECTALL command ID to the WebBrowser control.
Allows absolutely positioned elements to be moved by dragging.
HRESULT Set2DPosition(bool bNewValue) const;
bNewValue
If TRUE, absolutely positioned elements can be moved by dragging.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_2D_POSITION command ID to the WebBrowser control.
Sets an element's position property to "absolute" or "static."
HRESULT SetAbsolutePosition(bool bNewValue) const;
bNewValue
If TRUE, the element's position property is "absolute"; if FALSE, it is "static."
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_ABSOLUTE_POSITION command ID to the WebBrowser control.
Set atomic selection mode.
HRESULT SetAtomicSelection(bool bNewValue) const;
bNewValue
If TRUE, any element that has an ATOMICSELECTION attribute set to TRUE will be selectable only as a unit.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_ATOMICSELECTION command ID to the WebBrowser control.
Turns automatic URL detection on and off.
HRESULT SetAutoURLDetectMode(bool bNewValue) const;
bNewValue
If TRUE, automatic URL detection is enabled.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_AUTOURLDETECT_MODE command ID to the WebBrowser control.
Sets the background color of the current selection.
HRESULT SetBackColor(int nColor) const;
HRESULT SetBackColor(LPCTSTR szColor) const;
nColor
The color. See pvaIn in IDM_BACKCOLOR Command ID.
szColor
The color. See pvaIn in IDM_BACKCOLOR Command ID.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_BACKCOLOR_ command ID to the WebBrowser control.
Sets the current block format tag.
HRESULT SetBlockFormat(LPCTSTR szFormat) const;
szFormat
The format tag.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_BLOCKFMT_command ID to the WebBrowser control.
Creates a bookmark anchor for the current selection or insertion point.
HRESULT SetBookMark(LPCTSTR szAnchorName) const;
szAnchorName
The anchor name.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_BOOKMARK command ID to the WebBrowser control.
Selects which CSS level (CSS1 or CSS2) the editor will support, if any.
HRESULT SetCSSEditingLevel(short nLevel) const;
nLevel
The CSS level. Pass 0 if you do not want CSS support.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_CSSEDITING_LEVEL command ID to the WebBrowser control.
Call this method to set the default compose settings.
HRESULT SetDefaultComposeSettings(
LPCSTR szFontName = NULL,
unsigned short nFontSize = 3,
COLORREF crFontColor = 0xFF000000,
COLORREF crFontBgColor = 0xFF000000,
bool bBold = false,
bool bItalic = false,
bool bUnderline = false) const;
szFontName
The font name.
nFontSize
The font size.
crFontColor
The font color.
crFontBgColor
The font background color.
bBold
Pass TRUE for bold text.
bItalic
Pass TRUE for italic text.
bUnderline
Pass TRUE for underlined text.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_COMPOSESETTINGS command ID to the WebBrowser control.
Set design mode.
BOOL SetDesignMode(BOOL bMode) const;
bMode
If TRUE, turns design mode on.
Returns TRUE on success, FALSE on failure.
Disables the hatched border and handles around an element that has edit focus.
HRESULT SetDisableEditFocusUI(bool bNewValue) const;
bNewValue
If TRUE, disables the hatched border and handles around a site selectable element when the element has "edit focus" in design mode; that is, when the text or contents of the element can be edited.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_DISABLE_EDITFOCUS_UI command ID to the WebBrowser control.
Sets the HTML of the current document.
HRESULT SetDocumentHTML(LPCTSTR szHTML) const;
szHTML
The HTML.
Returns S_OK on success, or an error HRESULT on failure.
Sets the font for the current selection.
HRESULT SetFontFace(LPCTSTR szFace) const;
szFace
The font name.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_FONTNAME Command ID to the WebBrowser control.
Sets the font size for the current selection.
HRESULT SetFontSize(unsigned short size) const;
size
The HTML font size (1-7). A value of 0 sets the font size to 1.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_FONTSIZE command ID to the WebBrowser control.
Sets the foreground (text) color of the current selection.
HRESULT SetForeColor(LPCTSTR szColor) const;
HRESULT SetForeColor(int nColor) const;
szColor
The color.
nColor
The color.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_FORECOLOR command ID to the WebBrowser control.
Sets the paste operation to be compatible with Microsoft Internet Explorer 5.
HRESULT SetIE5PasteMode(bool bNewValue) const;
bNewValue
If TRUE, all paste operations are compatible with Internet Explorer 5; if FALSE, paste operations are compatible with Internet Explorer 5.5.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_IE50_PASTE_MODE command ID to the WebBrowser control.
Causes the WebBrowser to update an element's appearance continuously during a resizing or moving operation, rather than updating only at the completion of the move or resize.
HRESULT SetLiveResize(bool bNewValue) const;
bNewValue
If TRUE, causes the WebBrowser to update an element's appearance continuously during a resizing or moving operation; if FALSE, it updates only at the completion of the move or resize.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_LIVERESIZE command ID to the WebBrowser control.
Enables multiple selection.
HRESULT SetMultiSelect(bool bNewValue) const;
bNewValue
If TRUE, allows for the selection of more than one site-selectable element at a time when the user holds down the SHIFT or CTRL keys.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_MULTIPLESELECTION command ID to the WebBrowser control.
Commands the WebBrowser never to change the mouse pointer.
HRESULT SetOverrideCursor(bool bNewValue) const;
bNewValue
If TRUE, the WebBrowser will not change the mouse pointer.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_OVERRIDE_CURSOR command ID to the WebBrowser control.
Toggles the text-entry mode between insert and overwrite.
HRESULT SetOverwriteMode(bool bMode) const;
bMode
If TRUE, text-entry mode is overwrite; if FALSE, text-entry mode is insert.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_OVERWRITE command ID to the WebBrowser control.
Hides invisible elements in design mode.
HRESULT SetRespectVisInDesign(bool bNewValue) const;
bNewValue
If TRUE, any elements that have a visibility set to "hidden" or display property set to "none" will not be shown in both design mode and browse mode; if FALSE, those elements will be displayed only in browse mode.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_RESPECTVISIBILITY_INDESIGN command ID to the WebBrowser control.
Displays a glyph for all elements that have a styleFloat
property.
HRESULT SetShowAlignedSiteTags(bool bNewValue) const;
bNewValue
If TRUE, displays a glyph for all elements that have a styleFloat
property.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_SHOWALIGNEDSITETAGS command ID to the WebBrowser control.
Displays glyphs to show the location of all tags in a document.
HRESULT SetShowAllTags(bool bNewValue) const;
bNewValue
If TRUE, displays glyphs to show the location of all tags in a document.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_SHOWALLTAGS command ID to the WebBrowser control.
Displays a glyph for all the area tags.
HRESULT SetShowAreaTags(bool bNewValue) const;
bNewValue
If TRUE, displays a glyph for all the area tags.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_SHOWAREATAGS command ID to the WebBrowser control.
Displays a glyph for all the br tags.
HRESULT SetShowBRTags(bool bNewValue) const;
bNewValue
If TRUE, displays a glyph for all the br tags.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_SHOWWBRTAGS command ID to the WebBrowser control.
Displays a glyph for all the comment tags.
HRESULT SetShowCommentTags(bool bNewValue) const;
bNewValue
If TRUE, displays a glyph for all the comment tags.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_SHOWCOMMENTTAGS command ID to the WebBrowser control.
Displays all the tags shown in Microsoft Internet Explorer 4.0.
HRESULT SetShowMiscTags(bool bNewValue) const;
bNewValue
If TRUE, displays all the tags shown in Microsoft Internet Explorer 4.0.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_SHOWMISCTAGS command ID to the WebBrowser control.
Displays a glyph for all the script tags.
HRESULT SetShowScriptTags(bool bNewValue) const;
bNewValue
If TRUE, displays a glyph for all the script tags.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_SHOWSCRIPTTAGS command ID to the WebBrowser control.
Displays a glyph for all the style tags.
HRESULT SetShowStyleTags(bool bNewValue) const;
bNewValue
If TRUE, displays a glyph for all the style tags.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_SHOWSTYLETAGS command ID to the WebBrowser control.
Displays a glyph for all the unknown tags.
HRESULT SetShowUnknownTags(bool bNewValue) const;
bNewValue
If TRUE, displays a glyph for all the unknown tags.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_SHOWUNKNOWNTAGS command ID to the WebBrowser control.
Overwrites a multiline text input control on the current selection.
HRESULT TextArea(LPCTSTR szId = NULL) const;
szId
The ID of the multiline text input control.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_TEXTAREA command ID to the WebBrowser control.
Overwrites a text control on the current selection.
HRESULT TextBox(LPCTSTR szId = NULL) const;
szId
The ID of the text control.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_TEXTBOX command ID to the WebBrowser control.
Removes any bookmark from the current selection.
HRESULT UnBookmark() const;
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_UNBOOKMARK command ID to the WebBrowser control.
Toggles the current selection between underlined and not underlined.
HRESULT Underline() const;
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_UNDERLINE command ID to the WebBrowser control.
Removes any hyperlink from the current selection.
HRESULT Unlink() const;
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_UNLINK command ID to the WebBrowser control.
Toggles the current selection between an ordered list and a normal format block.
HRESULT UnorderList(LPCTSTR szId = NULL) const;
szId
The ID of the unordered list.
Returns S_OK on success, or an error HRESULT on failure.
This method sends the IDM_UNORDERLIST command ID to the WebBrowser control.