|
AddressBar: Do not use AddressBar. It is included in the TEmbeddedWb interface because the IWebBrowser2 interface is shared with Internet Explorer. AddressBar shows or hides the URL address bar on Internet Explorer. TEmbeddedWb does not have an address bar.
EmbeddedWB1.AddressBar := true;
Align: Controls how the TWebBrowser component is
aligned on the firm to its parent control.
EmbeddedWB1.Align := alClient;
AlignDisabled: A read only boolean value that indicates the align state. var
Bool: Boolean; begin
bool := EmbeddedWB1.AlignDisabled; end;
Anchors: Controls the TAnchors (Left, Right and so on..).. EmbeddedWB1.Align := akTop;
Application: An IDispath. Use Application to access the interface for the application containing the WebBrowser control. If the application does not have an Automation interface, or if the interface is not accessible, Application provides access to the Automation interface of the Web browser control..
var
IHW: IHtmlwindow2;
begin
(EmbeddedWB1.Application as IServiceprovider).QueryService(IhtmlWindow2,IhtmlWindow2,
IHW);
IHW.confirm('This is a dialogbox!');
end;
Brush: Set a TBrush. EmbeddedWB1.Brush.Color := clRed;
BiDiMode: Set BiDiMode (LeftToRight and so on..). EmbeddedWB1.BiDiMode := bdLeftToRight;
BoundsRect: Set the bounds TRect. if Msg.message = WM_LBUTTONDOWN then
begin
if PtInRect(WebBrowser.BoundsRect, ScreenToClient(Msg.pt)) then
begin
Beep;
Handled := True;
end;
end;
Busy: Read Busy to determine whether the Web browser component is currently navigating to a new URL or downloading a document. If Busy is true, you can interrupt the current operation using the Stop method before starting a new operation.
Note: The Web browser receives events at the beginning and end of each operation, as well as at discrete points during a download operation.
begin
while Embeddedwb1.Busy do Application.ProcessMessages;
end;
Container: An IDispatch refering by index.Use Container to access the interface for the Web browser's parent or container. If the Web browser does not have a container with an Automation interface, Container is nil.
Embeddedwb1.Container = Panel1;
ControlInterface: Use ControlInterface to access the interface for the WebBrowser component. This interface lets an Automation controller access the properties, methods, and events of the Web browser. Embeddedwb1.ControlInterface.ExecWB(OLECMDID_PRINT,
OLECMDEXECOPT_DONTPROMPTUSER, vaIn, vaOut); or: begin
Embeddedwb1.ControlInterface.Document.QueryInterface(IID_IHTMLDocument, iDoc);
if not assigned(iDoc) then
begin
ShowMessage(' Nothing dowloaded ');
Exit;
end;
Cursor: Set the screen Cursor. Embeddedwb1.Cursor := crCross;
DefaultInterface: An IDispatch. Use DefaultInterface to access the default interface for the component. As implemented in TWebBrowser this is the same as the ControlInterface property procedure TMainForm.Embeddedwb1NewWindow2(Sender: TObject; var ppDisp:
IDispatch; var Cancel: WordBool);
var
NewChild: TChildForm;
begin
Cancel := False;
NewChild := CreateNewChild;
try
ppDisp := NewChild.Embeddedwb1.DefaultInterface as IDispatch;
except
NewChild.Free;
Cancel := True;
raise;
end;
end
DefaultDispatch: An IDispatch. An access to IDispatch. A major chapter for its own. procedure TForm1.WebBrowser1NewWindow2(Sender: TObject;
var ppDisp: IDispatch; var Cancel: WordBool);
var
frm: TForm1;
begin
frm:= TForm1.Create(self);
frm.Show;
ppDisp := frm.Embeddedwb1.DefaultDispatch;
end;
DisableRightClickMenu: A boolean value which set on and off the Right Click Menu. Embeddedwb1.DisableRightClickMenu := true;
Document: Use Document to access an IDispatch interface for manipulating the contents of the HTML document through the COM object model. If there is no active document, Document is nil. That is, you must first load a document using the Navigate or Navigate2 method before you can manipulate it using the Document interface. For more information about this interface, see the document object section of Microsoft's Dynamic HTML reference.. var
iall : IHTMLElement;
begin
if Assigned(Embeddedwb1.Document) then
begin
iall := (Embeddedwb1.Document AS IHTMLDocument2).body;
while iall.parentElement <> nil do
begin
iall := iall.parentElement;
end;
memo1.Text := iall.outerHTML;
end;
end;
DownloadOptions: Here you will set your Download Options by using boolean values in a set of options. By setting to:
-
DLCTL_NO_SCRIPTSand DLCTL_NO_JAVA: Scripts and Java applets will not be executed.
-
DLCTL_NO_DLACTIVEXCTLSand DLCTL_NO_RUNACTIVEXCTLS : ActiveX controls will not be downloaded or will not be executed.
-
DLCTL_DOWNLOADONLY: The page will only be downloaded, not displayed.
-
DLCTL_NO_FRAMEDOWNLOAD: The WebBrowser Control will download and parse a frameSet, but not the individual frame objects within the frameSet.
-
DLCTL_RESYNCHRONIZEand DLCTL_PRAGMA_NO_CACHE: These flags cause cache refreshes. With
DLCTL_RESYNCHRONIZE, the server will be asked for update status. Cached
files will be used if the server indicates that the cached information
is up-to-date. With DLCTL_PRAGMA_NO_CACHE, files will be re-downloaded
from the server regardless of the update status of the files.
-
DLCTL_NO_BEHAVIORS: Behaviors are not downloaded and are disabled in the document.
-
DLCTL_NO_METACHARSET_HTML: Character sets specified in meta elements are suppressed.
-
DLCTL_URL_ENCODING_DISABLE_UTF8and DLCTL_URL_ENCODING_ENABLE_UTF8: These flags function similarly to the DOCHOSTUIFLAG_URL_ENCODING_DISABLE_UTF8 and DOCHOSTUIFLAG_URL_ENCODING_ENABLE_UTF8 flags used with IDocHostUIHandler::GetHostInfo. The difference is that the DOCHOSTUIFLAG flags are checked only when the WebBrowser Control is first instantiated. The download flags here for the ambient property change are checked whenever the WebBrowser Control needs to perform a download.
-
DLCTL_NO_CLIENTPULL: No client pull operations will be performed.
-
DLCTL_SILENT: No user interface will be displayed during downloads.
-
DLCTL_FORCEOFFLINE: The WebBrowser Control always operates in offline mode.
-
DLCTL_OFFLINEIFNOTCONNECTEDand DLCTL_OFFLINE: These flags are the same. The WebBrowser Control will operate in offline mode if not connected to the Internet.
procedure TForm1.Button2Click(Sender: TObject);
begin
Embeddedwb1.DownloadOptions := Embeddedwb1.DownloadOptions
- [DLCTL_DLIMAGES]
+ [DLCTL_PRAGMA_NO_CACHE, DLCTL_NO_SCRIPTS];
Embeddedwb1.Go('http://www.microsoft.com');
end;
DragCursor: Set the cursor that is shown during drag operation. Embeddedwb1.DragCursor := crDrag;
DragMode: Set the drag operation (Manual or Automatic).
Embeddedwb1.DragMode := dmAutomatic;
EnableDDE: Use DDE to enable/disable
DDE message handling. EmbeddedWB1.EnableDDE:= true;
Enabled: Enable/disable the component. EmbeddedWB1.Enabled:= true;
fpExceptions: Enable/disable
floating-point exceptions. EmbeddedWB1.fpExceptions:= true;
FuIlName: A wide string which Unlike the Name property, FullName specifies a fully qualified path name.
stPath := EmbeddedWB1.FullName;
FullScreen: Do not use FullScreen. It is included in the TEmbeddedWB interface because the IWebBrowser2 interface is shared with Internet Explorer. FullScreen determines whether Internet Explorer is maximized.
Handle: Return the self HWND procedure TfrmMyBrowser.ApplicationEvents1Message(var Msg: tagMSG;
var Handled: Boolean);
begin
if (Msg.Message = WM_RBUTTONDOWN) or (Msg.Message =
WM_RBUTTONDBLCLK) then
begin
if IsChild(EmbeddedWB1.Handle, Msg.hwnd) then
begin
// Show your own Popupor or whatever you want here
Handled := True;
end;
end;
end;
Height: An integer value for reading or setting the height of the control. procedure TForm1.Button1Click(Sender: TObject);
var bmp: TBitmap; begin bmp:= TBitmap.Create; try bmp.Height:= EmbeddedWB1.Height; bmp.Width:= EmbeddedWB1.Width; finally bmp.Free; end;
end;
HelpContext: Use HelpContext to bring up the help topic specified by the Context parameter from the file specified in the CurrentHelpFile property. HelpContext generates an OnHelp event (either on the active form or on the application object itself). If there is no OnHelp event handler, or if the event handler indicates that WinHelp should be called, then HelpContext invokes the Windows help engine, passing it the context ID. For example, if the Context value is 714, the HelpContext method displays the screen with the context help ID of 714 in the help file specified by CurrentHelpFile. HelpContext returns false if CurrentHelpFile is an empty string, meaning the application has no help file assigned. In all other cases, HelpContext returns true EmbeddedWB1.HelpContext := 714.
HelpFile: A string that holds the help file name.
EmbeddedWB1.HelpFile := 'My Web BrowserHelp File';
HelpKeywords: A string that holds keywords for the help file. EmbeddedWB1.HelpKeywords := 'Navigate';
HelpType: Here you can choose the proper help method by Set a help type (Keyords or Context).. For information consult the Delphi
documentation.
Hint : A string that holds the component hint. EmbeddedWB1.Hint := 'My Web Browser';
HideBorders: A boolean which allow to Show/Hide the borders. EmbeddedWB1.HideBorders := false;
HideScrollBars: A boolean which allow to Show/Hide the ScrollBars. EmbeddedWB1.HideScrollBars := false;
HWND: Use HWND for Windows API calls that require a window handle. Use HWND instead of the Handle property when working with TEmbeddedWB controls.
int := EmbeddedWB1.Hwnd;
Left: An integer that read or set the left coordinate position of
the control. int := EmbeddedWB1.Left;
LocationName: Read LocationName to get the name of the resource currently displayed in the Web browser control. If the resource is an HTML page from the Web, LocationName is the title of that page. If the resource is a folder or file on the local network or on a disk, LocationName is the full UNC name of the folder or file.. stName := EmbeddedWB1.LocationName;
LocationURL: Read LocationURL to get the name of the resource currently displayed in the Web browser control. If the resource is an HTML page from the Web, LocationName is its URL. If the resource is a folder or file on the local network or on a disk, LocationName is the full UNC name of the folder or file.
Note: LocationURL is a read-only property. To direct the Web browser to display the resource at a specific URL, folder, or file, use the Navigate or Navigate2 method. stUrl := EmbeddedWB1.LocationUrl;
MenuBar: Do not use MenuBar. It is included in the TEmbeddedWB interface because the IWebBrowser2 interface is shared with Internet Explorer. MenuBar shows or hides the menu bar in Internet Explorer. TEmbeddedWB does not have a menu bar.
Name: Read Name to obtain the name of the executable that hosts the Web browser. Unlike the FullName property, Name does not include the path..
St := EmbeddedWB1.Name;
Offline: Set Offline to true to work offline with the Web browser. When the Web browser is offline, it can't read HTML pages using an Internet connection. Instead, you must specify a source document as a UNC filename.
Note: You can use Internet Explorer to save HTML pages to a local cache so that they are available for offline work.
EmbeddedWB1.Offline := false;
OleObject: Its a major chapter for itself. The property is a variant that returns the Active X browser data.
Var I: Integer; St : String; begin st := WB.OleObject.Document.Url; st := WB.OleObject.Document.title; st := WB.OleObject.Document.Body.ScrollHeight; st := WB.OleObject.Document.Body.ScrollWidth; i:= WB.OleObject.Document.Body.ScrollTop; i:= WB.OleObject.Document.Body.ScrollLeft; i:= WB.OleObject.Document.Body.ClientHeight; i:= WB.OleObject.Document.Body.ClientWidth; st := WB.OleObject.Document.referre;r st := WB.OleObject.document.cookie;
st := WB.OleObject.document.LastModified;
st := WB.OleObject.Document.Location.Protocol;
st := WB.OleObject.Document.defaultCharset
st := WB.OleObject.Document.ParentWindow;
st := WB.OleObject.Document.uniqueID; st := WB.OleObject.document.FileSize st := WB.OleObject.Document.fileCreatedDate
Parent: An IDispath Use Parent to access the interface for the Web browser's parent or container. If the Web browser does not have a container with an Automation interface, the value of Parent is the same as ControlInterface. Use the TopLevelContainer property to determine which interface is the value of Parent.. procedure TForm1.Button1Click(Sender: TObject);
var
WB: TEmbeddedWB;
begin
WB := TEmbeddedWB.Create(nil);
TControl(WB).Parent := panel1; // Or what ever...
Wb.Align:=alClient;
WB.Loaded;
WB.Visible := True;
end;
ParentShowHint: A boolean value that show / hide parent hint. EmbeddedWB1.ParentShowHint := false;
Path: Read Path to obtain the path of the executable that hosts the EmbeddedWB. var
st : string; begin
st := EmbeddedWB1.Path;
End;
PopupMenu: A linkage the popupmenu component. The popupmenu can replace the IE build-in right click menu.
PrintOptions: This property makes it possible to set
printoptions: header, footer, margins, paper orientation
programmatically. At design-time the properties are loaded
from registry and margins converted to the unit of
measurement found in your LocaleID. This means that the
properties will appear as in the Pagesetup dialog.
At run-time Embeddedwb checks the users
LocaleID and makes the nessecary conversions between inch/millimeters
and find the proper decimalseparator before it sends
strings to the pagesetup-dialog. This is important in
international applications.
If you call function "Print"
with printoptions.enabled:=true the pagesetup dialog will
be opened outside the screen and printoption-values
entered. Then the dialog is closed and then
"normal" Print-function called.
If you call PageSetup-Dialog with
Printoptions.enabled:=true the printoptions-values are
entered in the dialog before it opens.
Set PrintOptions.Enabled:=False if you do
not want to use PrintOptions. procedure
TForm1.Button1Click(Sender: TObject);
begin
with EmbeddedWB1.PrintOptions do
begin
Orientation:=Landscape;
Margins.Left:=16.75;
// always use the unit of measurement defined
on your own computer.
//EmbeddedWB converts
at run-time if nessecary.
Header:='This is my new header';
Enabled:=True;
end;
EmbeddedWB1.Print;
end;
ReadyState: Read ReadyState to obtain state information specific to the Web browser control. Use this information to avoid attempting to use the Web browser control when it is not ready to perform an action.. possible states:
const READYSTATE_UNINITIALIZED = 0;
Default initialisation state.
const READYSTATE_LOADING = 1;
Object is currently loading data.
const READYSTATE_LOADED = 2;
Object has been initialised.
const READYSTATE_INTERACTIVE = 3;
User can interact with the object but loading
has not yet finished.
const READYSTATE_COMPLETE = 4;
All of the object's data has been loaded.
while WebBrowser.ReadyState < READYSTATE_INTERACTIVE do
Application.ProcessMessages;
RegisterAsBrowser: Set RegisterAsBrowser to true when using the Web browser control to implement a top-level browser. EmbeddedWB1.RegisterAsBrowser:= false;
RegisterAsDropTarget: Set RegisterAsDropTarget to true to allow users to drop HTML documents onto the Web browser. When RegisterAsDropTarget is true, users can load a document by dragging it onto the Web browser. When RegisterAsDropTarget is false, dragging a document onto the Web browser has no effect. EmbeddedWB1.RegisterAsDropTarget:= false;
Resizeable: Do not use Resizable. It is included in the TEmbeddedWB interface because the IWebBrowser2 interface is shared with Internet Explorer. Resizable determines whether the Internet Explorer window can be resized.. EmbeddedWB1.Resizable := true;
ShowHint: A boolean value that show / hide hints. EmbeddedWB1.ShowHint := true;
Silent: Set Silent to true to prevent the Web browser control from displaying dialog boxes.. EmbeddedWB1.Silent
:= false;
StatusBar: Do not use StatusBar. It is included in the TEmbeddedWB interface because the IWebBrowser2 interface is shared with Internet Explorer. StatusBar shows or hides the status bar in Internet Explorer. TEmbeddedWB does not have a status bar.
StatusText: Do not use StatusText. It is included in the TEmbeddedWB interface because the IWebBrowser2 interface is shared with Internet Explorer. StatusText specifies the text that appears on the status bar in Internet Explorer. TEmbeddedWB does not have a status bar
TabOrder: An integer value for TTabOrder.
var
i := Integer; begin
i := EmbeddedWB1.TabOrder;
End;
TabStop: A boolean value that set TabStop. EmbeddedWB1.TabStop := false;
Tag: An integer value for tagging the component.
var
i := Integer; begin
i := EmbeddedWB1.Tag; End;
TheaterMode: Do not use TheaterMode. It is included in the TEmbeddedWB interface because the IWebBrowser2 interface is shared with Internet Explorer. TheaterMode changes the display of Internet Explorer to use theater or normal mode..)
ToolBar: Do not use ToolBar. It is included in the TEmbeddedWB interface because the IWebBrowser2 interface is shared with Internet Explorer. ToolBar determines which toolbar is displayed in Internet Explorer. TEmbeddedWB does not have any tool bars
Top: An Integer that read or set top coordinate position of the control. var
i := Integer; begin
i := EmbeddedWB1.Top; End;
Type_: A WideString that returns the name of the type of control. var
st : string; begin
st := EmbeddedWB1.Type_;
End;
UserAgent: This property helps you add your webbrowser-name to the useragent-string.
The user agent string is a small amount of text that is sent by
every browser with every request for a Web page. It identifies the specific
version of the browser that is requesting the page and what operating system it
is running under:
Mozilla/4.0 (compatible; MSIE
5.01; Windows NT 5.0)
What you enter in EmbeddedWB.Useragent is added to this
string:
EmbeddedWB1.UserAgent:='MyWebbrowser 1.13'; ->
Mozilla/4.0 (compatible; MSIE
5.01; Windows NT 5.0; MyWebbrowser 1.13)
The useragent propery write to the registry but removed the
useragent from the registry when you close the webbrowser-application.
Visible: A boolean value that read or set the component visiblity. If true then the control is visible. EmbeddedWB1.Visible := true;
Width: An Integer that read or set width of the control. EmbeddedWB1.Width := 300;
|