unit Unit1;
interface
uses
Winapi.Windows,
Winapi.Messages, System.SysUtils, System.Variants, System.Classes,
Vcl.Graphics,
Vcl.ddeman,
Vcl.Controls,
Vcl.Forms,
Vcl.Dialogs,
Winapi.ShellApi,
Vcl.StdCtrls,
Vcl.ExtCtrls;
type
TForm1 =
class(TForm)
Button1: TButton;
ListBox1: TListBox;
Timer1: TTimer;
procedure Button1Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
function Get_URL(Servicio:
string):
String;
var
Cliente_DDE: TDDEClientConv;
temp:PANSIChar;
begin
Result := '
';
Cliente_DDE:= TDDEClientConv.Create(
nil );
with Cliente_DDE
do
begin
SetLink( Servicio,'
WWW_GetWindowInfo');
temp := RequestData('
0xFFFFFFFF');
Result := StrPas(temp);
StrDispose(temp);
CloseLink;
end;
Cliente_DDE.Free;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
var i:integer;
begin
if Get_URL('
IEXPLORE')<>'
'
then listbox1.Items.Add(Get_URL('
IEXPLORE'));
if Get_URL('
firefox')<>'
'
then listbox1.Items.Add(Get_URL('
firefox'));
if Get_URL('
opera')<>'
'
then listbox1.Items.Add(Get_URL('
opera'));
for i:= listbox1.items.count-1
downto 0
do if listbox1.Items.IndexOf(listbox1.Items[i])<i
then listbox1.Items.Delete(i);
end;