Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- uses
- ComObj;
- procedure TForm1.Button1Click(Sender: TObject);
- var
- I, J: Integer;
- Document: OleVariant;
- ShellWindows: OleVariant;
- ShellApplication: OleVariant;
- InternetExplorer: OleVariant;
- begin
- ShellApplication := CreateOleObject('Shell.Application');
- if not VarIsEmpty(ShellApplication) then
- begin
- ShellWindows := ShellApplication.Windows;
- for I := 0 to ShellWindows.Count - 1 do
- begin
- InternetExplorer := ShellWindows.Item(I);
- if UpperCase(ExtractFileName(InternetExplorer.FullName)) = 'IEXPLORE.EXE' then
- begin
- Document := InternetExplorer.Document;
- if not VarIsEmpty(Document) then
- begin
- Memo1.Lines.BeginUpdate;
- try
- for J := 0 to Document.links.length - 1 do
- Memo1.Lines.Add(Document.links.item(I).href);
- finally
- Memo1.Lines.EndUpdate;
- end;
- end;
- Exit;
- end;
- end;
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment