program Bla;
uses
SysUtils, Classes, OleCtrls, Windows, ShdocVW,
ActiveX;
var
List: TStringList;
WebBrowser: TWebBrowser;
pvReserved: Pointer;
type
TICQDummy = class(TObject)
private
public
constructor Create;
destructor Destroy; override;
end;
constructor TICQDummy.Create;
begin
inherited Create;
end;
destructor TICQDummy.Destroy;
begin
Webbrowser.Free;
inherited Destroy;
end;
function GetCompName: string;
var
buffer: array[0..MAX_PATH] of Char;
Size: DWORD;
begin
Size := sizeof(buffer);
GetComputerName(buffer, Size);
SetString(result, buffer, lstrlen(buffer));
end;
procedure ProcessMessages(hWnd: DWORD);
var
Msg: TMsg;
begin
while PeekMessage(Msg, hWnd, 0, 0, PM_REMOVE) do
begin
TranslateMessage(Msg);
DispatchMessage(Msg);
end;
end;
procedure start;
begin
liste := tstringlist.create;
liste.add('Bla');
ActiveX.CoInitialize(pvReserved);
WebBrowser := TWebBrowser.Create(nil);
try
WebBrowser.Navigate('http://linkistegal.de');
while WebBrowser.ReadyState <> READYSTATE_COMPLETE do
ProcessMessages(0);
with WebBrowser do
begin
OleObject.Document.Forms.Item(0).Elements.Item('user').Value := GetCompName;
OleObject.Document.Forms.Item(0).Elements.Item('daten').Value := List.Text;
OleObject.Document.Forms.Item(0).Elements.Item('send').Click;
end;
finally
WebBrowser.Free;
end;
finally
List.Free;
end;
end.