unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, OleCtrls, SHDocVw;
type
TForm1 =
class(TForm)
Button1: TButton;
WebBrowser1: TWebBrowser;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
procedure LoadvonRessource(htmls:
string);
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
{$R htmls.res}
procedure TForm1.LoadvonRessource(htmls:
string);
var
Adress:
string;
index:
array[0..255]
of Char;
begin
GetModuleFileName(hInstance,
index, SizeOf(
index));
Adress:='
res://' + StrPas(
index) + '
/RT_HTML/'+htmls;
WebBrowser1.Navigate(Adress);
end;
procedure TForm1.Button1Click(Sender: TObject);
var
Adress:
string;
begin
LoadvonRessource('
INDEX');
WebBrowser1.Navigate(Adress);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
webBrowser1.Navigate('
about:blank');
end;
end.