NO

Author Topic: MDI close button  (Read 8536 times)

nancy

  • Guest
MDI close button
« on: December 18, 2012, 08:43:26 PM »
Hallo,

I have the following problem: I have a MDI application. If  I maximize one of the child windows there should be a second set of minimize/restore/close buttons at the menu strip. But there isn't. 

CommonTater

  • Guest
Re: MDI close button
« Reply #1 on: December 18, 2012, 10:18:25 PM »
Check your window styles on the MDI Children... are you creating them with the buttons?

nancy

  • Guest
Re: MDI close button
« Reply #2 on: December 18, 2012, 10:35:23 PM »
The childs are build via the MDICREATESTRUCT. The style parameter is MDIS_ALLCHILDSTYLES.

CommonTater

  • Guest
Re: MDI close button
« Reply #3 on: December 18, 2012, 10:59:51 PM »
OK... I'll step out and let someone else take a try at this one...


Offline Stefan Pendl

  • Global Moderator
  • Member
  • *****
  • Posts: 582
    • Homepage
Re: MDI close button
« Reply #4 on: December 19, 2012, 03:05:59 PM »
Have you tried duplicating this with a simple test window allowing you to add MDI childes?

May be attach the project, so we can all work from the same source.
---
Stefan

Proud member of the UltraDefrag Development Team

czerny

  • Guest
Re: MDI close button
« Reply #5 on: December 20, 2012, 08:08:09 AM »
There are two examples 'MDIDlgs' and 'MidiDialogs2' at Christians site. The former lacks in the buttons. The later not. Unfortunately I can not find the relavant part.

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2113
Re: MDI close button
« Reply #6 on: December 20, 2012, 09:54:56 AM »
Have looked for code on John site?
http://www.johnfindlay.plus.com/
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

JohnF

  • Guest
Re: MDI close button
« Reply #7 on: December 21, 2012, 09:00:21 AM »
There is an MDI Wizard in the Wizards section on my web site.

John

nancy

  • Guest
Re: MDI close button
« Reply #8 on: December 21, 2012, 09:58:47 PM »
Thank you all!

But I do not want to start from scratch. Any hint?

CommonTater

  • Guest
Re: MDI close button
« Reply #9 on: December 21, 2012, 10:28:28 PM »
Thank you all!

But I do not want to start from scratch. Any hint?

There's no reason to do that, Nancy.... 

Something I do a lot when working on difficult code is to write a small "side program" to test certain things so I can understand how they work without messing up my main project.  For example ... I recently did some coding with a tree view control, but was having a bit of trouble getting stored data pointers back from it's LPARAM storage... so I wrote a small side program that I could afford to messup as royally as I needed to and stayed with it until I got it working... then I simply took the working solution and transplanted it into my main project.
 
Programmers do stuff like that all the time.  Some of my very best code is stored away in projects named test1, test2, mumble and glorp...
 

Offline Stefan Pendl

  • Global Moderator
  • Member
  • *****
  • Posts: 582
    • Homepage
Re: MDI close button
« Reply #10 on: December 22, 2012, 01:30:23 PM »
Some of my very best code is stored away in projects named test1, test2, mumble and glorp...

Oh yes, these projects are the best 8)

Always do some prototyping for complex sections and you will see how they get really simple ;)
---
Stefan

Proud member of the UltraDefrag Development Team

nancy

  • Guest
Re: MDI close button
« Reply #11 on: December 22, 2012, 01:59:41 PM »
Ok, I have installed Johns MDI-Wizard and created a new project.

But there are different problems with this code.
There should be a default child window at startup. But either it is not shown at all or it is vanishing at certain positions if I try to size it horizontally. The statusbar is not update correctly too.
I am not sure if it is ok to create a mdi child via CreateWindowEx. The MS docu recommends the creation via the MDICREATESTRUCT.

JohnF

  • Guest
Re: MDI close button
« Reply #12 on: December 22, 2012, 04:18:31 PM »
The Wizard used to work ok in previous versions of PellesC, there is obviously a problem with the latest version, will try to find time to fix it.

EDIT: The Wizard code works if one turns off the compiler optimization.

NOTE: As a general rule I don't use the compiler optimization - it seldom speeds things up but more importantly one never can be sure it will not create problems.

John
« Last Edit: December 23, 2012, 09:16:20 AM by JohnF »

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2107
Re: MDI close button
« Reply #13 on: December 22, 2012, 08:58:32 PM »
But I do not want to start from scratch. Any hint?
Does your MDI child code handle WM_SIZE message correctly?
I mean forward to DefMDIChildProc() too ?
May the source be with you

nancy

  • Guest
Re: MDI close button
« Reply #14 on: December 23, 2012, 05:03:43 PM »
Does your MDI child code handle WM_SIZE message correctly?
I mean forward to DefMDIChildProc() too ?

No! I am ashamed of myself! Thank you very much!