• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 188
  • Last Modified:

how to restore all?

how do i get the windowstate of my MDI Child forms
and restore them to their previous windowstates?
0
superboy
Asked:
superboy
  • 3
  • 2
1 Solution
 
d003303Commented:
Use the same code like in your question "How to close all?", just with this adjustment :

procedure TMainForm.Button1Click(Sender: TObject);
var I: byte;
begin
LockWindowUpdate(Handle);
if MDIChildCount>0 then
  for I := MDIChildCount-1 downto 0 do
  // here we go
  ShowWindow(MDIChildren[I].Handle, SW_RESTORE);
LockWindowUpdate(0);
end;

Slash/d003303
0
 
d003303Commented:
Your question appears two times (bad network connection while Submit pressed, I guess :-)), you should delete the second one.
0
 
superboyAuthor Commented:
the code
u gave me i replace the part to
with MainForm do  (without the MDIChildCount >0)
for I := 0 to MDIChildCount-1 do ... etc
and it work but it appears to have some problem with my tile
function...when i tile it and do a restore all , my application crashed...
0
 
superboyAuthor Commented:
does LockWindowUpdate(Handle); make a app hang sometimes?
0
 
d003303Commented:
Have you locked with MainForm.Handle or just the local scope Handle property ?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now