如果只得到任务栏窗口的标题!

飞天凤凰601 2005-05-16 01:52:48
现在做的这程序,得到了很多无用的窗口.能不能只得到显示在任务栏的窗口?
我原来的程序如下:
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;
在此在先谢
...全文
70 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
programgirl 2005-05-16
  • 打赏
  • 举报
回复
hCurrentWindow := GetACTIVEWindow();
.
.
.
hCurrentWindow:=GetNextWindow(hCurrentWindow,gw_hwndnext);
...
飞天凤凰601 2005-05-16
  • 打赏
  • 举报
回复
顶.............

1,183

社区成员

发帖
与我相关
我的任务
社区描述
Delphi Windows SDK/API
社区管理员
  • Windows SDK/API社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧