Solved

how to restore all?

Posted on 1998-02-13
5
142 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
build html 5 client that connect to indy Tidtcpserver 3 357
Best Firemonkey component pack 1 88
How to debug For loops? 3 46
TEMBEDDEDWB how can i change its user agent ? 8 50
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

863 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now