Solved

how to restore all?

Posted on 1998-02-13
5
157 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses
Course of the Month8 days, 1 hour left to enroll

617 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