现在做的这程序,得到了很多无用的窗口.能不能只得到显示在任务栏的窗口?
我原来的程序如下:
procedure TForm1.Button3Click(Sender: TObject);
var
  hCurrentWindow: HWnd;
  szText: array[0..254] of char;
begin
hCurrentWindow := GetWindow(Handle, GW_HWNDFIRST);
   while hCurrentWindow <> 0 do
   begin
     if GetWindowText(hCurrentWindow, @szText, 255)>0 then
    begin
    inc(ii);
       form1.Edit1.Text:=inttostr(ii);
      form1.Memo1.Text:=form1.Memo1.Text+chr(13)+chr(10)+inttostr(ii)+'--'+sztext;    end;
    hCurrentWindow:=GetWindow(hCurrentWindow, GW_HWNDNEXT);
end;
在此在先谢