Solved

MDI Child Windows

Posted on 1997-04-10
11
425 Views
Last Modified: 2010-04-06
I've been fooling with the API call SW_HIDEWINDOW to hide my MDI child windows. Problem is that when I show them, the window status has been changed to ws_normal. I need to show and hide Child windows in a maximized state.
0
Comment
Question by:ericw
  • 7
  • 4
11 Comments
 
LVL 3

Accepted Solution

by:
mheacock earned 40 total points
ID: 1335300
Immediately set the window state to maximized right after your
show window command.
0
 

Author Comment

by:ericw
ID: 1335301
Tries This, But Seems To Be Over-ridden By The MDI Parent. This is how its hidden:

 ShowWindow(MyChild.Handle, SW_HIDE);

I Then Show it By :

SetWindowPos(MyChild.handle, 0,0,0,0,0,SWP_NOSIZE OR SWP_NOMOVE OR SWP_SHOWWINDOW);

It's here that the problem lies .... Child Is Now Visible, But No Maximized And Without Focus.
0
 
LVL 3

Expert Comment

by:mheacock
ID: 1335302
Have you tried:

   ShowWindow(MyChild.Handle, SW_SHOWMAXIMIZED);

I can't help much for for only 25 pts.  If this does help,
I do hope you'll see fit to not grade this at the minimum.
0
 
LVL 3

Expert Comment

by:mheacock
ID: 1335303
Ignore the comment about the grading...I didn't notice you were
the same person that asked the splitting file question.  You
graded well there.

But I still can't help much more for only 25 pts.  I hope my
last comment solves your problem though.
0
 
LVL 3

Expert Comment

by:mheacock
ID: 1335304
I see you raised the points, did the solution help?
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

Author Comment

by:ericw
ID: 1335305
ShowWindow(MyChild.Handle, SW_SHOWMAXIMIZED);

Nope, Seems to work if you have one MDI child, but goes adrift if you are cycling between 4 and 5.
It starts showing the wrong one ( and I double checked my code) despite being given the window handle ????
I think this was why I switched to SetWindowPos.
0
 
LVL 3

Expert Comment

by:mheacock
ID: 1335306
Are you using D1 or D2?  I'm presuming D2.
0
 
LVL 3

Expert Comment

by:mheacock
ID: 1335307
Okay...I think I have it....

   SendMessage(MDIParent.Handle, WM_MDIMAXIMIZE, WParam(MDIChild.Handle), 0);

Check in the help file for the Windows Message, WM_MDIMAXIMIZE.  I'm not sure if the WParam, cast will work, but I do believe it is defined in Windows.pas.  Anyhow, I'm very positive that this is the correct way to maximize an MDI child.
0
 

Author Comment

by:ericw
ID: 1335308
I'm using Delphi 1.0, but I'll try the revised SendMessage. It should still work for D1, or at least something fairly similar should be available
0
 
LVL 3

Expert Comment

by:mheacock
ID: 1335309
The call is the same...Win32 or Win16.
0
 

Author Comment

by:ericw
ID: 1335310
SendMessage(MDIParent.Handle, WM_MDIMAXIMIZE, WParam(MDIChild.Handle), 0);

Tried This In Several Different Flavours....All Failed };<

Finally Ended Up Cycling Thru The List Of ChildWindows.....This Must Be Some Or Other MDI Problem.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

759 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

18 Experts available now in Live!

Get 1:1 Help Now