...get the Selected Objects in a TWebbrowser?

Author: Bögi
Homepage: http://www.boegi.de

Category: Internet / LAN

procedure TForm1.Button1Click(Sender: TObject);
begin
  if 
Webbrowser1.OleObject.Document.Selection.type = 'Control' then
  begin
    if 
Webbrowser1.OleObject.Document.Selection.CreateRange.CommonParentElement.tagName =
      'IMAGE' then
      
ShowMessage('An Image is selected');
  end
  else
  begin
    if 
Webbrowser1.OleObject.Document.Selection.createRange.Text = '' then
      
ShowMessage('Nothing is selected - ');
  end;
end;

 

printed from
www.swissdelphicenter.ch
developers knowledge base