当我打开使用谷歌的网页:
WebBrowser1.Navigate('http://www.google.com.au/advanced_search?hl=en');
它用光标在编辑框中打开。
所以,当我使用:
WebBrowser1.ExecWB(OLECMDID_SELECTALL,OLECMDEXECOPT_PROMPTUSER,vaIn, vaOut);
它仅复制光标所在。 不是整个网页,这是我想要复制的内容。 我的代码是:
procedure Pause()
begin
//code to pause until page loads.
end;
procedure TForm2.Button22Click(Sender: TObject);
var s:String;
vaIn, vaOut: OleVariant;
begin
s:='http://www.google.com.au/advanced_search?hl=en';
WebBrowser1.Navigate(s);
while WebBrowser1.ReadyState <> READYSTATE_COMPLETE do
begin
Pause(1000);
end;
//------->I need to put code here so the SELECTALL line of code works.<----------
//------->So the cursor isn't in to editbox but as if it has clicked <----------
//------->the webpage <----------
WebBrowser1.ExecWB(OLECMDID_SELECTALL,OLECMDEXECOPT_PROMPTUSER,vaIn, vaOut);
end;
如何选择整个网页?