没
没理头号
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure GetAllWin;
var
hCurrentWindow: HWnd;
szText: array[0..254] of char;
p: pTAppRec;
fStr: string;
begin
hCurrentWindow := GetWindow(Application.Handle, GW_HWNDFIRST);
while hCurrentWindow <> 0 do
begin
fStr := strpas(szText);
if GetWindowText(hCurrentWindow, @szText, 255) > 0 then
begin
if (fStr <> '')
and (fStr <> 'Default IME')
and IsWindowVisible(hCurrentWindow)
then
//过滤窗体
begin
new(p);
AList.Add(p);
p.fwnd := hCurrentWindow;
//获得窗体句柄
p.fname := fStr;
p.fstate := 1;
//
p.ftmp := format('%d', [GetWindowLong(hCurrentWindow, GWL_STYLE)]);
end;
end;
hCurrentWindow := GetNextWindow(hCurrentWindow, GW_HWNDNEXT);
end;
end;
上面这段代码好象总是有问题,列出不是我想我的?
我只有那些有窗体的应用程序,我该怎么做?
var
hCurrentWindow: HWnd;
szText: array[0..254] of char;
p: pTAppRec;
fStr: string;
begin
hCurrentWindow := GetWindow(Application.Handle, GW_HWNDFIRST);
while hCurrentWindow <> 0 do
begin
fStr := strpas(szText);
if GetWindowText(hCurrentWindow, @szText, 255) > 0 then
begin
if (fStr <> '')
and (fStr <> 'Default IME')
and IsWindowVisible(hCurrentWindow)
then
//过滤窗体
begin
new(p);
AList.Add(p);
p.fwnd := hCurrentWindow;
//获得窗体句柄
p.fname := fStr;
p.fstate := 1;
//
p.ftmp := format('%d', [GetWindowLong(hCurrentWindow, GWL_STYLE)]);
end;
end;
hCurrentWindow := GetNextWindow(hCurrentWindow, GW_HWNDNEXT);
end;
end;
上面这段代码好象总是有问题,列出不是我想我的?
我只有那些有窗体的应用程序,我该怎么做?