Solved

how to restore all?

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

ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Intraweb submit form as a POST request 4 304
build html 5 client that connect to indy Tidtcpserver 3 397
Magic Software info 18 131
Error E2158 compiling with Delphi XE10 Seattle 2 100
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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

772 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