Thread: MDI Problem

  1. #1
    Registered User Rare177's Avatar
    Join Date
    May 2004
    Posts
    214

    MDI Problem

    I have a program which using MDI, i need the mdi client area to be resizable (not to the width and height of the parent window) so to do this i sized it in the parent window procedure and returned 0 (not letting it return DefFrameProc), this works fine except that when i maximize a mdi child window, it cannot be restored, minimized or closed, it does nothing on click of those 3 buttons, this works fine when i return DefFrameProc from WM_SIZE so what i'm asking, is there a way to stop the mdi client from resizing to the size of the parent or is there a way to make these 3 buttons work with my method, thanks.
    Good Help Source all round
    Good help for win programmers
    you will probably find something in here
    this thing also helps

    if you have never tried any of the above then maybe you should, they help alot

  2. #2
    Work in Progress..... Jaken Veina's Avatar
    Join Date
    Mar 2005
    Location
    Missouri. Go Imos Pizza!
    Posts
    256
    EDIT: I think I missed a bit of your post, so I don't know if this is exactly what you're looking for. Sorry.

    Well, put simply, when you click on any of those buttons, as with any other action you do, messages are sent to the window affected. By removing the DefWindowProc, the window isn't being told to do anything when it gets those messages. It gets them, but since it doesn't fit any of your case statements, it is processed by the default case, which tells it to do nothing. To fix this, you could do one of two things.

    You could add in cases for the messages that re sent for those buttons and process them the same as DefWindowProc, then keep the default at returning 0. This might be difficult, though, since it's not like you can go into the header and look at the code for the function. In headers, functions are generally prototyped only in the *.h, since that doesn't use extra memory in the compiled program. The actual definiton of a function can be found in the *.lib or *.a for that header, since libraries are only accessed if needed and therefore, it only adds extra code to your compiled program if you use that code. The downside is that libraries are precompiled, meaning that you can't go look at the code.

    Your other option is to add cases for the resizing messages, and simply set them to return 0. That way, the message never gets to the DefWindowProc, so it isn't resized, and you still get processing for every other message. This would be the solution I would use, since it prevents other problems arising from unprocessed messages, and it's just plain easier. You can do a google search or ask aruond here to find out what messages deal with resizing.
    Last edited by Jaken Veina; 04-11-2005 at 03:48 PM.

  3. #3
    Registered User Rare177's Avatar
    Join Date
    May 2004
    Posts
    214
    default breaks to return DefFrameProc,
    those 3 buttons process the WM_SIZE message also
    Good Help Source all round
    Good help for win programmers
    you will probably find something in here
    this thing also helps

    if you have never tried any of the above then maybe you should, they help alot

  4. #4
    Work in Progress..... Jaken Veina's Avatar
    Join Date
    Mar 2005
    Location
    Missouri. Go Imos Pizza!
    Posts
    256
    *smacks head* How could I have forgotten about WM_SIZE? Bah.

    In that case, you should just add a case for WM_SIZE and set it to do nothing. Then keep default returning DeFrameProc(). Other than that, I can't think of any other solutions.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 11:22 AM
  2. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  3. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  4. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM
  5. Laptop Problem
    By Boomba in forum Tech Board
    Replies: 1
    Last Post: 03-07-2006, 06:24 PM