we're using your library in our project where we have placed dialogs withing dialogs which have no window ID. I noticed that it is indeed possible to use the resizer functions when manually assigning a unique window ID using the SetWindowLong function (i.e. SetWindowLong(m_hWnd, GWL_ID, windowID)).
However Cwnd::GetDlgItem still returns a zero pointer on this ID. Since this function is used several times in WndResizer, I wonder if this could cause any severe trouble. So far it seems to be working nicely when checking for this case. In particular, I added the following line to WndResizer.cpp line 50:
I am using a SDI application with a window derived from CFormView. I have the hook in the OnInitialUpdate for the CFormView derived dialog class. It is working great for the controls, but the SetMinimumSize is not working. Should the Mainform class be the root? Also, if I change the DPI, the controls are being cut off. Any suggestions for using it in this type of environment?
I think you will also have to create a member of CWndResizer in mainframe class and use it to set the minimum size of the frame after the form is created. Because CFormView does not recieve WM_SIZING message. Thus setting minimum of CFromView has no effect.
I voted 5 for three reasons: 1) The article itself was well-written and easy to follow, with lots of helpful information; 2) Your attitude and replies to comments were excellent, and show a willingness to consider each comment; 3) This article presents a practical solution to a major problem in any non-trivial application.
The only other thing I would say is that in testing on XP, there does seem to be some flicker. In my experience, flicker needs to be addressed in both OnSize and OnEraseBkgnd.
first of all, this class is great.
But i still have some problems.
I'd like to limit the Split-Container-size within
a property sheet. The function SetMinimumSize seems to have
no effect in this case.
To reproduce this behaviour just add the line
bOk = m_resizer.SetMinimumSize(IDC_LIST2, CSize(500,0));
to the Example08.cpp, this won't yield any differece at
That did the trick. Thank you very kindly. I was getting close, I knew that the gripper object was the culprit but hadn't chased down why it wasn't being deleted. This is a cool class set, it has saved me considerable time and hassle.