Solved

MDI Child Windows

Posted on 1997-04-10
11
432 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
[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
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Working with hours 3 87
Adoquery sql  left join does not work 25 119
IP without any Dots 1 99
Firemonkey how to swip panel with finger tap 1 40
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

734 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