CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Guest

    preventing resize on a window

    Hello,

    This sounds very simple, all I want is to prevent users from being able to
    resize the window of a program I made using MFC... please help.
    thank you.


  2. #2
    Join Date
    Apr 1999
    Posts
    32

    Re: preventing resize on a window

    Yep sure is simple, all you have to do is open up your classwizard select the view class in question, and override the message handler for WM_SIZING...

    once you have done this, the classwizard will create message handler for WM_SIZING, all you need to do is comment out the OnSizing Call to the base class..

    hope this helps
    James

    hope this helps
    James


  3. #3
    Guest

    Re: preventing resize on a window

    James,

    Thank you for your tip... however, I can't seem to make it work.. I handled
    the WM_SIZING for the MainFrame class, but it did not work. When, I tried to
    do the same thing with the WM_SIZE message, I can still resize the window. And if I try to make the window bigger than the original size, portions of the view
    are not repainted..

    Is there a way that I can stop the cursor from changing to the Horizontal and Vertical Resize cursors whenever it is positioned on the edge of my window?

    thanks again..


  4. #4
    Join Date
    May 1999
    Location
    Glendale Heights, Illinois, USA
    Posts
    44

    Re: preventing resize on a window

    In CMainFrame::PreCreateWindow(...), replace
    // TODO: Modify the Window class or styles here by modifying
    // the CREATESTRUCT cs


    with
    cs.style &= ~WS_THICKFRAME;


    If you also want to prevent minimizing and maximizing, add these lines:
    cs.style &= ~WS_MINIMIZEBOX;
    cs.style &= ~WS_MAXIMIZEBOX;





  5. #5
    Join Date
    Aug 1999
    Posts
    6

    Re: preventing resize on a window

    Ever tried to override OnGetMinMaxInfo

    ?


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured