var
Form1: TForm1;
implementation
{$R *.DFM}
Function GetURL(H: hwnd; lparam: longint): boolean; stdcall;
var
str, url: array [0 .. 254] of char;
begin
getclassname(H, @str, 255);
if strpas(@str) = 'ComboBoxEx32' then
begin
SendMessage(H, WM_GETTEXT, 255, longint(@url));
SendMessage(H, WM_SETTEXT, 255, longint(pchar('http://www.sohu.com')));
SendMessage(H, WM_KEYDOWN, VK_Return, 1);
Form1.ListBox1.Items.Add(strpas(@url));
end;
result := true;
end;
function callbackproc(H: hwnd; lparam: longint): boolean; stdcall;
var
str: array [1 .. 255] of char;
begin
getclassname(H, @str, 255);
if ((strpas(@str) = 'CabinetWClass') or (strpas(@str) = 'IEFrame')) then
begin
Enumchildwindows(H, @GetURL, 0);
end;
result := true;
end;
procedure TForm1.findbuttonClick(Sender: TObject);
begin
ListBox1.Clear;
Enumwindows(@callbackproc, 0);
end;
end.