创建窗体列表 - sheshou2的专栏 - CSDNBlog
找到MDI主窗口,然后在菜单中增加一个用来放窗口列表的菜单项如M1,这样在主窗口的属性windowmenu里选择m1就可以了。只要主窗口有创建子窗口就会在m1的菜单下加一个项。
var i:integer;
child :Tform;
fchild :Tform;
begin
for i:=0 to Screen.FormCount -1 do
if Screen.Forms[i].ClassType=Formclass then
begin
child:=Screen.Forms[i];
if child.WindowState =wsMinimized then
showWindow(child.handle,SW_SHOWNORMAL)
else
showWindow(child.handle,SW_SHOWNA);
if (not child.Visible ) then child.Visible :=True;
child.BringToFront ;
child.SetFocus ;
Tform(myform):=child;
exit
end;
lockWindowUpdate(handle);
fchild := Tform(Formclass.Newinstance);
Tform(myform) := fchild;
fchild.Create(AOwner);
LockWindowUpdate(0);