Resizing a window

I have a SDI application in which the view class is derived from CHTMLView class.

Now whenever the user resizes the window by dragging the window edge, I want to retain the original size of the window.That is, I want to avoid the resizing of the window.

How do I do this and in which method of the view or the window class should I imlement this to stop the resizing of the window?

I have tried using the setwindowpos mehtod in the OnSizing method ofthe window class with the SWP_NOSIZE option.

But this did not work.


Who is Participating?
cdesignerConnect With a Mentor Commented:
one way

set the maxsize = minsize in GetMaxMinInfo() function
(add message     ON_WM_GETMINMAXINFO())

void CDlg::OnGetMinMaxInfo(MINMAXINFO *lpMMI)
    if (!b_dialogInit)
    lpMMI->ptMinTrackSize.y = 100;
    lpMMI->ptMinTrackSize.x = 200;
    lpMMI->ptMaxTrackSize.y = 100;
    lpMMI->ptMaxTrackSize.x = 200;
add this in header
      afx_msg void OnGetMinMaxInfo(MINMAXINFO *lpMMI);
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.