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
Solved

MDI Child Windows

Posted on 1997-04-10
11
429 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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

860 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