CFrameWnd and handling WM_GETMINMAXINFO
Jeff_Stong@bio-rad.com
Thursday, April 11, 1996
Visual C++ 4.0, Windows NT 3.51
I have a CScrollView derived class that will display an image captured
from a video camera. I would like to be able to restrict the size of
the enclosing CFrameWnd such that the user could make the frame window
smaller than required (the view will pop-up scroll bars as necessary),
but not be able to drag or maximize the window to anything larger than
the minimum size required to display the entire image.
CFrameWnd::OnGetMinMaxInfo() seems to be the most obvious place to
solve the problem. However, since this is a standard MFC frame window
it has all sort of goodies like dialog bars and dockable tool bars
which potentially make the calculations difficult. For obvious
reasons, I would like to rely on any code in MFC that may already do
most of the work. What I am really looking for is a method that
returns the size required for the frame for a given view size.
Does anyone know the proper CFrameWnd/CScrollView level functions that
I could call in order to compute the proper values to place into the
MINMAXINFO of CFrameWnd::OnGetMinMaxInfo()? Or is OnGetMinMaxInfo()
the wrong place to solve the problem? Ideally I would like to solve
the problem in my CScrollView-derived class. I haven't been
successful with this approach since the view only gets WM_SIZE
messages (no WM_GETMINMAXINFO messages) at which point its really too
late to do anything about the window resize operation.
Thanks,
Jeff
Glen Okita -- go@svpal.org
Monday, April 15, 1996
CWnd::CalcWindowRect() should return the the window size needed to
contain the view.
Glen Okita
ti desrever sediT -- Tides reversed it go@svpal.org
LeRoy Baxter -- lbaxter@cinfo.com
Wednesday, April 17, 1996
Unless you're using high resolution and 'Large Fonts'
----------
From: Glen Okita[SMTP:go@svpal.org]
Sent: Monday, April 15, 1996 8:17 AM
To: mfc-l@netcom.com
Subject: Re: CFrameWnd and handling WM_GETMINMAXINFO
CWnd::CalcWindowRect() should return the the window size needed to
contain the view.
Glen Okita
ti desrever sediT -- Tides reversed it go@svpal.org
Ted Heatherington -- theather@vcn.bc.ca
Saturday, April 20, 1996
[Mini-digest: 2 responses]
Ummm... I guess I feel dense Glen. Just HOW do I use this call? I to have
a CDialog styled view and would like to use WM_MaxMin, but this terse reply
isn't too helpful to a MFC newbie like me.
Ted
====================
>From: Glen Okita
>
>CWnd::CalcWindowRect() should return the the window size needed to
>contain the view.
> Glen Okita
>ti desrever sediT -- Tides reversed it go@svpal.org
>
>
-----From: "Arguelles, Alix"
Win95, VC4.0
What if you are using high resolution? What can you use to assure that
the window is opened to the appropriate size?
[Moderator's note: I don't think the issue is the resolution as
much as it is the use of large fonts, which are problematic
just about any time you don't let Windows do the size
calculations for you.]
----------
From: owner-mfc-l[SMTP:owner-mfc-l@netcom.com]
Sent: Wednesday, April 17, 1996 08:59 PM
To: 'mfc-l@netcom.com'
Subject: RE: CFrameWnd and handling WM_GETMINMAXINFO
Unless you're using high resolution and 'Large Fonts'
| Вернуться в корень Архива
|