Solved

MDI Child Windows

Posted on 1997-04-10
11
428 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi 2010 Export to pdf 2 332
Why can't I create any project with my delphi EXE file? 6 23
tidtcpserver connection lost handle 2 83
Performance of SQL statement 37 111
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 I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

785 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