procedure TFrm_Main.Button1Click(Sender: TObject);
var
H: THandle;
sText: array[0..200] of char;
ListItem: TListItem;
begin
H := 0;
LV_Info.Items.BeginUpdate;
H := FindWindowEx(0, H, 'IEFrame', nil);
while H <> 0 do
begin
GetWindowText(H, @sText, 255);
ListItem := LV_Info.Items.Add;
ListItem.Caption := StrPas(@sText);
H := FindWindowEx(0, H, 'IEFrame', nil);//第二个参数为何要为'H',如果为
//0,我的程序就陷入死循环了,帮助里 //里讲的第二个参数 不是子窗体的
//句柄么???
end;
LV_Info.Items.EndUpdate;
end;
//还有我如果用findwindow如何实现这个功能谢谢
var
H: THandle;
sText: array[0..200] of char;
ListItem: TListItem;
begin
H := 0;
LV_Info.Items.BeginUpdate;
H := FindWindowEx(0, H, 'IEFrame', nil);
while H <> 0 do
begin
GetWindowText(H, @sText, 255);
ListItem := LV_Info.Items.Add;
ListItem.Caption := StrPas(@sText);
H := FindWindowEx(0, H, 'IEFrame', nil);//第二个参数为何要为'H',如果为
//0,我的程序就陷入死循环了,帮助里 //里讲的第二个参数 不是子窗体的
//句柄么???
end;
LV_Info.Items.EndUpdate;
end;
//还有我如果用findwindow如何实现这个功能谢谢
'IEFrame'的窗口,不包括H,如果为0,找到的始终是桌面的第一个IE窗口,当然要死循环了