function EnumWindowsProc(Wnd: HWND; List: TStrings): Boolean; stdcall;
var
ParentWnd: HWND;
ExStyle: DWORD;
Caption: array [0..255] of Char;
begin
if IsWindowVisible(Wnd) then
begin
ParentWnd:=GetWindowLong(Wnd,GWL_HWNDPARENT);
ExStyle:=GetWindowLong(Wnd,GWL_EXSTYLE);
if ((ParentWnd=0) or (ParentWnd=GetDesktopWindow)) and
((ExStyle and WS_EX_TOOLWINDOW=0) or (ExStyle and WS_EX_APPWINDOW<>0)) and
(GetWindowText(Wnd,Caption,SizeOf(Caption))>0) then
List.AddObject(Caption,Pointer(Wnd));
end;
Result:=True;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
EnumWindows(@EnumWindowsProc,Integer(ListBox1.Item s));
end;
27 Mart 2010 Cumartesi
Kaydol:
Kayıt Yorumları (Atom)
Hiç yorum yok:
Yorum Gönder