Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem when main form is run in minimize state.

Status
Not open for further replies.

dlare9

Programmer
Apr 3, 2007
12
0
0
JP
hi,

I've created a function that would save all application's information to an ini file when the application(Form) closes.
The only problem occurs when you close the apllication and the main window is in minimized and then run the application
again. The application would open to the its last state (w/c is minimized) and when you restore (or maximize) the application
the child form and the other forms included in the application did not load.
Why does this happen? (the child form and the other forms included in the main form did not appear when the main
form run in minimize state).
Do I need to save the state (minimize, maximize or normal) of an application to an ini file.



Any help or link would be much appreciated

OS: WinXp
Tool: Borland C++ Builder v6


I appologize if my english is wrong, english is not my native language.


Regards,
Gerald
 
You may have to store info about the child forms, too. Without knowing much about your app, I suspect that the child forms info is being lost when your app is restored or maximized.

James P. Cottingham
-----------------------------------------
[sup]I'm number 1,229!
I'm number 1,229![/sup]
 
Maybe this code snippet can help your problem.

Currently, I`m working on my project using .ini file and I have my code using this.
put this on your ini.cpp or what you want.

ChildMax= IniFile->ReadBool(sct,"ChildWinMaximize");
IniFile->WriteBool( sct,"ChildWinMaximize",ChildMax);

then,

in your mainform, refer the above code, example.

if ((MDIChildCount==1) && (EV->ChildMax)) cp->WindowState = wsMaximized;

just get the idea on my code. goodluck
 
thanks for the idea.
I was able to fix my code.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top