so kannst das feld füllen
Delphi-Quellcode:
procedure TForm1.SetFilename(Value: WideString);
var
Doc: IHTMLDocument2;
Elements: IHTMLElementCollection;
Element: IHTMLElement;
InputElement: IHTMLInputElement;
I, j: Integer;
FormItem: Variant;
pch: PChar;
str1: string;
begin
str1 := Value; //convert input value to string
pch := PChar(str1); //type cast to pointer
Doc := WebBrowser1.Document as IHTMLDocument2;
Elements := Doc.all;
for I := 0 to Elements.length - 1 do
begin
Element := Elements.item(I, EmptyParam) as IHtmlElement;
if Element.tagName = 'loadfile' then
begin
InputElement := Element as IHTMLInputElement;
if (SameText(InputElement.type_, 'file')) and
(SameText(InputElement.Name, 'deindateiname')) then
begin
FormItem := InputElement;
FormItem.Focus;
SendKeys(PCh, False); // NOTE the false flag
end;
end;
end;
end;
du brauchst dazu die SNDKEY32.PAS... ist auf der delphi cd in X:\INFO\EXTRAS\SENDKEYS