如何得到当前的所有的窗口? 如题!我想得到当前WINDOWS打开的所有窗口! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用API函数EnumWindows,具体你看看帮助吧,很详细的!该函数能列处所有窗体! 给你个列子吧!新建个form(name:FormCallBack),一个listbox,一个buttonunit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type EnumWindowsProc = function (Hwnd: THandle; Param: Pointer): Boolean; stdcall;type TFormCallBack = class(TForm) ListBox1: TListBox; Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end;var FormCallBack: TFormCallBack;implementation{$R *.dfm}function GetTitle (Hwnd: THandle; Param: Pointer): Boolean; stdcall;var Text: string;begin SetLength (Text, 100); GetWindowText (Hwnd, PChar (Text), 100); FormCallBack.ListBox1.Items.Add ( IntToStr (Hwnd) + ': ' + Text); Result := True;end;procedure TFormCallBack.Button1Click(Sender: TObject);var EWProc: EnumWindowsProc;begin ListBox1.Items.Clear; EWProc := GetTitle; EnumWindows (@EWProc, 0);end;end. listview多选的问题 PC和GRPS通讯问题 朋友,帮我看一看,窗体所的有控件的回车转成Tab键出现严重问题 来者有分!!帮忙看看!帮忙看看这个为什么不能运行? 关于DataSet的RecNo属性............. 关于CM_MouseLeave事件的处理的一个问题 谁能给个皮肤控件? 关于ShowModal窗口的一点疑问??在线等待! 请问调用哪个函数能够直接登录指定网址的网站 DELPHI中的按钮 COM+导出软件包后,在98不可安装,XP却可以。请问是怎么回事儿? 为什么recordcount突然不能用了?
该函数能列处所有窗体!
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
EnumWindowsProc = function (Hwnd: THandle;
Param: Pointer): Boolean; stdcall;
type
TFormCallBack = class(TForm)
ListBox1: TListBox;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
FormCallBack: TFormCallBack;implementation{$R *.dfm}function GetTitle (Hwnd: THandle; Param: Pointer): Boolean; stdcall;
var
Text: string;
begin
SetLength (Text, 100);
GetWindowText (Hwnd, PChar (Text), 100);
FormCallBack.ListBox1.Items.Add (
IntToStr (Hwnd) + ': ' + Text);
Result := True;
end;procedure TFormCallBack.Button1Click(Sender: TObject);
var
EWProc: EnumWindowsProc;
begin
ListBox1.Items.Clear;
EWProc := GetTitle;
EnumWindows (@EWProc, 0);
end;end.