The TWebBrowser Delphi component provides access to the Web browser functionality from your Delphi apps (to allow you to create a customized Web browsing application or to add Internet, file and network browsing, document viewing, and data downloading capabilities to your applications). Learn how to use the web browser control in Delphi programs.
Here's how to save a web page displayed inside a WebBrowser (TWebBrowser component) as a raw HTML file or into a single (MHT) file (MHTML format: web archive - single file) programmatically using Delphi.
A web form or a form on a web page allows a web page visitor to enter data that is, in most cases, sent to the server for processing. When using the web browser (TWebBrowser) Delphi control you can programmatically fill in web form fields and submit the fom - using Delphi code. Here's how.
Here's how to load "static" HML code from a string into a TWebBrowser.
Here's how to append (add) "static" HML code from a string into a TWebBrowser.
Here's how to call a stadard IE find dialog for the TWebBrowser component.
Here's how to call a standard IE View Source dialog (to examine raw HTML) for the TWebBrowser component.
How to print a document/page in a TWebBrowser. Also, how to call the printer setup dialog, the page setup and the print preview screen.
How to export your data to HTML using Delphi and ADO. This is the first step in publishing your database on the Internet - see how to create a static HTML table from an ADO query.
Here's the code to disable the context menu (the one a user gets when it right-clicks inside a TWebBrowser) for TWebBrowser in a Delphi application.
Web Browser screen shot is a graphics copy of the content on the web browser control - usually a web page (document).
When using ShellExecute to open a web site or a htm file with the default web browser you *don't* have the option to specify that you want to start a new instance of the browser - in general an existing window is used.
If, for whatever the reason is, you have to clear the web browser window, "reset" it, and display an empty page, you need to navigate to a "blank" page.
Here's how to execute a custom script (JavaScript or VBScript) function on a HTML document loaded in the TWebBrowser control.
To get the "href" attribute (link) of an "a" tag inside a document, while the mouse hovers over a document, you need to react on the "onmousemove" event of the IHTMLDocument2.
If you need to enable a user to change the contents of a document (web page) displayed by the TWebBrowser component, use the following trick...
When using the TWebBrowser component you might want to grab the full HTML source code from the page being displayed by the component.
If you decided to use (Microsoft) Word as a "printing engine" for your applications, you will probably want to have some kind of print and print preview functionality. Here's how to use the TWebBrowser control to preview and print Microsoft Word documents.
If you need to know the location of a document displayed in a TWebBrowser component, you need to get the Protocol property of the IHTMLLocation. Here's a function that returns true if a document in a WebBrowser is stored locally...
Here's how to search for a string in a web document (loaded in a TWebBrowser component) and highlight every occurence of it. The WBLocateHighlight locates every occurence of a string passed as a "Text" parameter in a document loaded in a TWebBrowser component passed as the "WB" parameter. The background of the located string is turned to red with the text in white
Here's how to save a web page displayed inside a WebBrowser (TWebBrowser component) as a raw HTML file or into a single (MHT) file (MHTML format: web archive - single file).