我的想法是这样的了:
var
h:hwnd;
temp:string;
begin
h:=findwindow(nil.'网叶标题');
if h<>0 then
begin
h:=findwindowex(h,0,'edit',nil);
if h<>0 then
begin
for i:=1 to length(temp) do
begin
sendemssage(h,wm_char,word(temp(i)),0);
end;
end;
end;
end;
同时:你也用这个方法捕获到你要取得的函数值,然后再获得edit的句柄,然后再传给edit
var
doc2: IHTMLDocument2;
disp: IDispatch;
inputEle: IHTMLInputElement;
iLoop: Integer;
htmlEle: IHTMLElement;
selectEle: IHTMLSelectElement;
begin
WebBrowser1.Navigate('');
//先到那个网站再说
doc2:=WebBrowser1.Document as IHTMLDocument2;
if Succeeded(disp.QueryInterface(IHTMLInputElement, inputEle)) then
//如果是input的话
if (CompareText(inputEle.type_, 'text') = 0) and
(CompareText(inputEle.name, 'NewUserName' = 0) then
inputEle.value := edit1.Text;//填值了呵呵
end;