Thanks to the support of Stack Overflow I have been able to create my own CResizingMFCPropertySheet
that supports resizing. Now, I went to add a resize anchor and I used this code:
void CResizingMFCPropertySheet::InitialiseResizeIcon()
{
CRect rcIcon, rcClient;
m_bmpResize.LoadOEMBitmap(OBM_SIZE);
m_lblResize.Create(0, WS_CHILD | WS_VISIBLE | SS_BITMAP,
CRect(0, 0, 16, 16), this, IDC_STATIC_RESIZE);
m_lblResize.SetBitmap(m_bmpResize);
GetClientRect(rcClient);
m_lblResize.GetClientRect(rcIcon);
m_lblResize.SetWindowPos(&CWnd::wndTop, rcClient.right - rcIcon.Width(),
rcClient.bottom - rcIcon.Height(), 0, 0, SWP_NOSIZE);
}
(Note: The above code is revised and no longer uses dynamic layout - doesn't work).
The method gets called in OnInitDialog
. When the sheet is first displayed it looks OK:
You can see the anchor in the bottom right. Now, when i go to resize the window:
As you can see it is not rendering the anchor properly.
Update
I have set WS_CLIPSIBLINGS
and it makes no difference.
Update
Just to let everyone know the reason the new themed gripper was not working right was because I did not add the OnNcHitTest
handler etc.