Forms Delphi

Title: How to Count the window handles used by your app
function EnumProc(wnd: HWND; var count: DWORD): Bool; stdcall;
begin
Inc(count);
result := True;
EnumChildWindows(wnd, @EnumProc, integer(@count));
end;
procedure TForm1.Button1Click(Sender: TObject);
var
count: DWORD;
begin
count := 0;
EnumThreadWindows(GetCurrentThreadID, @EnumProc, Integer(@count));
Caption := Format('%d window handles in use', [count]);
end;