Utilities
Function GetIEVersion :
String;
Use this function to determine
which version of Internet Explorer is installed on the computer.
The function returns the
fileversion of shdocvw.dll.
The following chart lists the different versions of the Shdocvw.dll
file and the corresponding versions of Internet Explorer:
Version Product
--------------------------------------------------------------
4.70.1155 Internet Explorer 3.0
4.70.1158 Internet Explorer 3.0 (OSR2)
4.70.1215 Internet Explorer 3.01
4.70.1300 Internet Explorer 3.02
4.71.1008.3 Internet Explorer 4.0 PP2
4.71.1712.5 Internet Explorer 4.0
4.72.2106.7 Internet Explorer 4.01
4.72.3110.3 Internet Explorer 4.01 Service Pack 1
4.72.3612.1707 Internet Explorer 4.01 SP2
5.00.0518.5 Internet Explorer 5 Developer Preview (Beta 1)
5.00.0910.1308 Internet Explorer 5 Beta (Beta 2)
5.00.2014.213 Internet Explorer 5
5.0.2717.2000 Internet Explorer 5 with Update for "Malformed
Favorites Icon" Security Issue installed
5.00.2721.1400 Internet Explorer 5 with Update for "ImportExport
Favorites()" Security Issue installed
5.00.2919.800 Internet Explorer 5 (Windows 2000 RC1, build 5.00.2072)
5.00.2919.3800 Internet Explorer 5 (Windows 2000 RC2, build 5.00.2128)
5.00.2919.6307 Internet Explorer 5.01
5.50.3825.1300 Internet Explorer 5.5 Developer Preview (Beta)
Link: Determing
Which Version of Internet Explorer you are using
Procedure NavigatePidl(pidl : PItemIdList);
Navigate2 provides the same capabilities as Navigate,
but it also can be used to navigate to a folder by specifying a
pointer to an item identifier list (PIDL). PIDLs were introduced
with Windows 95 and provide a way to uniquely identify an item
within the shell's namespace. PIDLs are also supported on NT 4.0.
Procedure NavigateFolder(CSIDL: Integer);
browsing on special folders—such as Desktop and My
Computer:
EmbeddedWb1.NavigateFolder(CSIDL_Desktop); |
Procedure SetFocusToDoc;
This procedure is added to
make it possible to TAB the way to the content of the webbrowser .
It is also useful for functions, that need to have the focus set on
the document in Webbrowser (ex. see OnShowHelp).
function HtmlHelp;
API call to make it easy to implement Help-file in
the webbrowser application. (see OnShowHelp).
function AssignDocument;
Opens a blank page in Webbrowser-control if document
is unassigned. Used in LoadFromStrings and LoadFromStream.
function LoadFromStrings(aStrings : TStrings) :
HRESULT;
Display content of aStream in EmbeddedWB.
EmbeddedWB1.LoadFromStrings(Memo1.Lines); |
function LoadFromStream(aStream : TStream) : HRESULT;
Display content of aStrings in EmbeddedWB.
procedure
TForm1.Button1Click(Sender: TObject);
var
T : TMemoryStream;
begin
T := TMemoryStream.Create;
try
T.LoadFromFile('C:\temp\test.htm');
EmbeddedWb1.LoadFromStream(T);
finally
T.Free;
end;
end;
|
function SaveToFile(const Fname : String) : HRESULT;
Save HTML-source from EmbeddedWB.Document to file Fname.
procedure
TForm1.Button2Click(Sender: TObject);
begin
EmbeddedWb1.Go('http://www.microsoft.com');
EmbeddedWb1.SaveToFile('c:\microsoft.htm');
end;
|
function SaveToStrings(aStrings : TStrings) : HRESULT;
Save EmbeddedWb.document to stringlist.
procedure
TForm1.Button1Click(Sender: TObject);
begin
EmbeddedWb1.Go('http://www.microsoft.com');
EmbeddedWb1.SaveToStrings(memo1.lines);
end;
|
function SaveToStream(aStream : TStream) : HRESULT;
Save EmbeddedWB.document to a stream. The following sample loads
a webpage in the browser. When download is completed the HTML-source
is displayed in Memo1 and saved to a file, using a TMemoryStream:
procedure
TForm1.Button3Click(Sender: TObject);
var
M : TMemoryStream;
begin
M:=TMemoryStream.Create;
EmbeddedWb1.Go('http://www.microsoft.com');
EmbeddedWb1.SaveToStream(M);
M.Seek(0,0);
Memo1.Lines.AddFromStream(M);
M.SavetoFile('c:\microsoft.htm');
M.Free;
end;
|
function RegisterNameSpace(clsid : TGUID) : HRESULT;
Register the temporary namespacehandler clsid.
There seems to be a unconfirmed bug in
IInternetProtocol.RegisterNameSpace, so namespace-patterns cannot be
added. Instead you can add your namespace in function
"Start" in your namespacehandler-object:
function
TMyNSHandler.Start(szUrl: PWideChar; OIProtSink:
IInternetProtocolSink; OIBindInfo: IInternetBindInfo; grfPI,
dwReserved: DWORD): HResult;
begin
if Pos('http://' + <NameSpace> + '/',
LowerCase(szUrl)) <> 1
then Result := INET_E_USE_DEFAULT_PROTOCOLHANDLER
else begin
...
end;
See demo in section APP.
|
function UnregisterNameSpace : HRESULT;
Unregister a temporary pluggable namespacehandler.
function RegisterMIMEFilter(clsid: TGUID; MIME :
PWideChar) : HRESULT;
Register the temporary pluggable MIME filter clsid to be
used for MIME-type MIME.
function UnregisterMIMEFilter(MIME : PWideChar) : HRESULT;
Unregister the a temporary pluggable MIME filter for MIME-type MIME.