Setting minimum size for a CFrameWnd
-
Hi, I'd like to make my CFrameWnd subclass not resize any smaller than a certain size. Everywhere I web-search, I see that the suggested way to do this is: void CWndDerived::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI) { // set the minimum tracking width // and the minimum tracking height of the window lpMMI->ptMinTrackSize.x = 200; lpMMI->ptMinTrackSize.y = 150; } I type this into my (very simple) app, and set a breakpoint at the start of this function. It is never called. Is this method still valid? (under Visual Studio 2005 c++) Thanks, Max
-
Hi, I'd like to make my CFrameWnd subclass not resize any smaller than a certain size. Everywhere I web-search, I see that the suggested way to do this is: void CWndDerived::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI) { // set the minimum tracking width // and the minimum tracking height of the window lpMMI->ptMinTrackSize.x = 200; lpMMI->ptMinTrackSize.y = 150; } I type this into my (very simple) app, and set a breakpoint at the start of this function. It is never called. Is this method still valid? (under Visual Studio 2005 c++) Thanks, Max
maxmaven wrote:
CWndDerived
Are you sure this class window is window you are trying to resize ? A quick test in simple
SDI
app, shows result as expected.Prasad Notifier using ATL | Operator new[],delete[][^]
-
Hi, I'd like to make my CFrameWnd subclass not resize any smaller than a certain size. Everywhere I web-search, I see that the suggested way to do this is: void CWndDerived::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI) { // set the minimum tracking width // and the minimum tracking height of the window lpMMI->ptMinTrackSize.x = 200; lpMMI->ptMinTrackSize.y = 150; } I type this into my (very simple) app, and set a breakpoint at the start of this function. It is never called. Is this method still valid? (under Visual Studio 2005 c++) Thanks, Max
maxmaven wrote:
I type this...
Did you use ClassWizard to add it? Is
BEGIN_MESSAGE_MAP()
correct?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
-
maxmaven wrote:
CWndDerived
Are you sure this class window is window you are trying to resize ? A quick test in simple
SDI
app, shows result as expected.Prasad Notifier using ATL | Operator new[],delete[][^]
Can you tell me exactly what you did? And are you in Visual Studio 2005, C++? I did: SDI: doesn't work SDI + DocView architecture: doesn't work SDI + Split Window: doesn't work Are you setting anything special? Or adding more than just the OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI) function? Thank you, Max
-
maxmaven wrote:
I type this...
Did you use ClassWizard to add it? Is
BEGIN_MESSAGE_MAP()
correct?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
-
Can you tell me exactly what you did? And are you in Visual Studio 2005, C++? I did: SDI: doesn't work SDI + DocView architecture: doesn't work SDI + Split Window: doesn't work Are you setting anything special? Or adding more than just the OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI) function? Thank you, Max
Have you seen David's[^] reply ? Are you sure macro
ON_WM_GETMINMAXINFO
is there as messsage map entry ?Prasad Notifier using ATL | Operator new[],delete[][^]
-
All I did was cut and paste the code into MainFrm.cpp, and add the function to the class declaration in MainFrm.h. Max
Then you are missing the entry in
BEGIN_MESSAGE_MAP()
. It's fine to add the actual code (i.e., that which is in between the curly braces) to your functions/methods, but use ClassWizard to add the prototypes.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
-
Have you seen David's[^] reply ? Are you sure macro
ON_WM_GETMINMAXINFO
is there as messsage map entry ?Prasad Notifier using ATL | Operator new[],delete[][^]
-
maxmaven wrote:
How do I add one for ON_WM_GETMINMAXINFO?
As has already been mentioned, use ClassWizard.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
-
Then you are missing the entry in
BEGIN_MESSAGE_MAP()
. It's fine to add the actual code (i.e., that which is in between the curly braces) to your functions/methods, but use ClassWizard to add the prototypes.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
-
How do I add the message map entry using a wizard? Do I use the "Add Member Function" wizard? Thanks, Max
Ctrl+W, unless you are using VS200x. Otherwise, see here.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb