Solved

how to restore all?

Posted on 1998-02-13
5
149 Views
Last Modified: 2010-04-04
how do i get the windowstate of my MDI Child forms
and restore them to their previous windowstates?
0
Comment
Question by:superboy
  • 3
  • 2
5 Comments
 
LVL 4

Accepted Solution

by:
d003303 earned 10 total points
ID: 1359140
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
 
LVL 4

Expert Comment

by:d003303
ID: 1359141
Your question appears two times (bad network connection while Submit pressed, I guess :-)), you should delete the second one.
0
 

Author Comment

by:superboy
ID: 1359142
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
 

Author Comment

by:superboy
ID: 1359143
does LockWindowUpdate(Handle); make a app hang sometimes?
0
 
LVL 4

Expert Comment

by:d003303
ID: 1359144
Have you locked with MainForm.Handle or just the local scope Handle property ?
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question