// Then execute the following code:
// Dann diese Routine ausführen:
procedure TForm1.Button2Click(Sender: TObject);
var
i: Word;
ImageWidth, ImageHeight: Integer;
ImageHref, ImageFileSize, ImageTextAlternative: string;
Document: IHtmlDocument2;
begin
// Loop through all images of a TWebbrowser
// Schleife über alle Bilder im Webbrowser
for i := 0 to WebBrowser1.OleObject.Document.Images.Length - 1 do
begin
Document := WebBrowser1.Document as IHtmlDocument2;
// Retrieves the calculated width of the image.
ImageWidth := WebBrowser1.OleObject.Document.Images.Item(i).Width;
// Retrieves the height of the image.
ImageHeight := WebBrowser1.OleObject.Document.Images.Item(i).Height;
// Retrieves the file size of the image.
ImageFileSize := (Document.Images.Item(i, 0) as IHTMLImgElement).FileSize;
// Retrieves the entire URL that the browser uses to locate the image
ImageHref := (Document.Images.Item(i, 0) as IHTMLImgElement).Href;
// Retrieves a text alternative to the graphic.
ImageTextAlternative := (Document.Images.Item(i, 0) as IHTMLImgElement).alt;
// Show image information in a TListbox
ListBox1.Items.Add(Format('%s : %d x %d Pixels; %s Bytes; %s',
[ImageHref, ImageWidth, ImageHeight, ImageFileSize, ImageTextAlternative]));
end;
end;
在浏览器上添加一个按钮
{
This is a simple little example that allows you to add a button
to Internet Explorer 3.0 or above
Values:
ButtonText := The text you want to be displayed at the bottom of the button
MenuText := The tools option at the top of IE will now contain
a reference to your program.
MenuStatusbar := Script option we are not using this object. (Ignore)
CLSID := Your classID. I won`t explain it because its complex.
That it has to unique. You can use GUIDTOSTRING
To create a new CLSID with the unit ActiveX.

//aufrufen
var
s: String;
begin
if DownloadURL('http://www.swissdelphicenter.ch/', s) then
ShowMessage(s);
end;
打开一个新的窗口
{
Usually when you open a URL in new window in TWebBrowser it opens
the Internet Explorer. This tip creates a new instance of your
browser form and opens the new site in your browser.
}

procedure TForm1.Button1Click(Sender: TObject);
var
i, p: Integer;
s: string;
begin
ListBox1.Clear;
for i := 0 to Memo1.Lines.Count - 1 do
begin
if Pos('http://', Memo1.Lines.Strings[i]) > 0 then
begin
s := '';
{If the current line contains a "http://", read on until a space is found

end.
********************************************************
隐藏最大，最小化按钮
{
This article shows by example how to suppress the maximize and
minimize buttons on an form at runtime.
To disable an form's Minimize and Maximize buttons,
you need to use the SetWindowLong Windows API
function to change the style of the window.
}

// Have you noticed that when you try to close a MDIChild form
// the form minimizes but doesn't disappear from your Main form
// client area?
//
// With this tip you can learn how to really close the MDI child
// form and free the memory occupied by the form

Shuts down the system and then restarts the system.
Windows NT/2000/XP: The calling process must have the SE_SHUTDOWN_NAME privilege.

F?hrt Windows herunter und startet es neu.

EWX_SHUTDOWN

Shuts down the system to a point at which it is safe to turn off the power.
All file buffers have been flushed to disk, and all running processes have stopped.
If the system supports the power-off feature, the power is also turned off.
Windows NT/2000/XP: The calling process must have the SE_SHUTDOWN_NAME privilege.

F?hrt Windows herunter.

EWX_FORCE

Forces processes to terminate. When this flag is set,
the system does not send the WM_QUERYENDSESSION and WM_ENDSESSION messages.
This can cause the applications to lose data.
Therefore, you should only use this flag in an emergency.

Die aktiven Prozesse werden zwangsweise und ohne Rückfrage beendet.

EWX_FORCEIFHUNG

Windows 2000/XP: Forces processes to terminate if they do not respond to the
WM_QUERYENDSESSION or WM_ENDSESSION message. This flag is ignored if EWX_FORCE is used.

function BuildListPS: Boolean;
var
PIDs: array [0..1024] of DWORD;
Needed: DWORD;
I: Integer;
FileName: string;
begin
Result := EnumProcesses(@PIDs, SizeOf(PIDs), Needed);
if Result then
begin
for I := 0 to (Needed div SizeOf(DWORD)) - 1 do
begin
case PIDs[I] of
0:
// PID 0 is always the "System Idle Process" but this name cannot be
// retrieved from the system and has to be fabricated.
FileName := RsSystemIdleProcess;
2:
// On NT 4 PID 2 is the "System Process" but this name cannot be
// retrieved from the system and has to be fabricated.
if IsWinNT4 then
FileName := RsSystemProcess
else
FileName := ProcessFileName(PIDs[I]);
8:
// On Win2K PID 8 is the "System Process" but this name cannot be
// retrieved from the system and has to be fabricated.
if IsWin2k or IsWinXP then
FileName := RsSystemProcess
else
FileName := ProcessFileName(PIDs[I]);
else
FileName := ProcessFileName(PIDs[I]);
end;
if FileName <> '' then
List.AddObject(FileName, Pointer(PIDs[I]));
end;
end;
end;
begin
if IsWin3X or IsWinNT4 then
Result := BuildListPS
else
Result := BuildListTH;
end;

{
RegisterHotKey fails if the keystrokes specified for the hot key have
already been registered by another hot key.

Windows NT4 and Windows 2000/XP: The F12 key is reserved for use by the
debugger at all times, so it should not be registered as a hot key. Even
when you are not debugging an application, F12 is reserved in case a
kernel-mode debugger or a just-in-time debugger is resident.
}