Cry about...
Delphi Programming with TWebBrowser


TWebBrowser - Methods


TWebBrowser supports the following methods:


ClientToWindow

procedure ClientToWindow(var pcx: SYSINT; var pcy: SYSINT);


ExecWB

procedure ExecWB(cmdID: OLECMDID; cmdexecopt: OLECMDEXECOPT); overload;
procedure ExecWB(cmdID: OLECMDID; cmdexecopt: OLECMDEXECOPT; var pvaIn: OleVariant); overload;
procedure ExecWB(cmdID: OLECMDID; cmdexecopt: OLECMDEXECOPT; var pvaIn: OleVariant;
var pvaOut: OleVariant); overload;


GetProperty

Retrieves the value of the component's property.

function GetProperty(const Property_: WideString): OleVariant;


GoBack

Show the previous URL/item in the history list (if there is one).

procedure GoBack;

Calling this procedure when there is no previous item in the history will generate an error. See also OnCommandStateChange event.


GoForward

Navigate forwards to the next URL/item in the history list (if there is one).

procedure GoForward;

Calling this procedure when there is no next item in the history will generate an error. See also OnCommandStateChange event.


GoHome

Loads the home/start page.

procedure GoHome;


GoSearch

Opens the search page.

procedure GoSearch;


Navigate

Navigate to the URL (or file) specified.

procedure Navigate(const URL: WideString); overload;
procedure Navigate(const URL: WideString; var Flags: OleVariant); overload;
procedure Navigate(const URL: WideString; var Flags: OleVariant; var TargetFrameName: OleVariant); overload;
procedure Navigate(const URL: WideString; var Flags: OleVariant;
var TargetFrameName: OleVariant; var PostData: OleVariant); overload;
procedure Navigate(const URL: WideString; var Flags: OleVariant;
var TargetFrameName: OleVariant; var PostData: OleVariant;
var Headers: OleVariant); overload;

For an example of how to navigate, posting data at the same time see http://www.scalabium.com/faq/dct0139.htm.


Navigate2

Navigate to the URL (or file) specified.

procedure Navigate2(var URL: OleVariant); overload;
procedure Navigate2(var URL: OleVariant; var Flags: OleVariant); overload;
procedure Navigate2(var URL: OleVariant; var Flags: OleVariant; var TargetFrameName: OleVariant); overload;
procedure Navigate2(var URL: OleVariant; var Flags: OleVariant;
var TargetFrameName: OleVariant; var PostData: OleVariant); overload;
procedure Navigate2(var URL: OleVariant; var Flags: OleVariant;
var TargetFrameName: OleVariant; var PostData: OleVariant;
var Headers: OleVariant); overload;


PutProperty

Sets the value of one of the component's properties.

procedure PutProperty(const Property_: WideString; vtValue: OleVariant);


QueryStatusWB

function QueryStatusWB(cmdID: OLECMDID): OLECMDF;


Quit

procedure Quit;


Refresh

Reloads the currently displayed item.

procedure Refresh;


Refresh2

Reloads the currently displayed item.

procedure Refresh2; overload;
procedure Refresh2(var Level: OleVariant); overload;

where:-

Level is one of:

TRefreshConstants = (
REFRESH_NORMAL = 0,
Default.
REFRESH_IFEXPIRED = 1,
Refresh only occurs if the page has expired.
REFRESH_CONTINUE = 2,
For WebBrowser internal use. Do not use.
REFRESH_COMPLETELY = 3 );
Sends "pragma:nocache" to the server, requesting that the returned copy is refreshed and not a cached version.

ShowBrowserBar

procedure ShowBrowserBar(var pvaClsid: OleVariant); overload;
procedure ShowBrowserBar(var pvaClsid: OleVariant; var pvarShow: OleVariant); overload;
procedure ShowBrowserBar(var pvaClsid: OleVariant; var pvarShow: OleVariant;
var pvarSize: OleVariant); overload;


Stop

Stops any pending navigation or download and any dynamic page elements (such as sounds).

procedure Stop;


See also: http://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser_methods.aspx.

To report any errors or omissions please e-mail me (brian@cryer.co.uk).


These notes are believed to be correct for Delphi 6 and 7 with Internet Explorer 6 and 7, and may apply to other versions as well.



About the author: is a dedicated software developer and webmaster. For his day job he develops websites and desktop applications as well as providing IT services. He moonlights as a technical author and consultant.