FIX: Border of Modeless CPropertySheet Is Not 3D in Windows NT (147206)
The information in this article applies to:
- The Microsoft Foundation Classes (MFC), when used with:
- Microsoft Visual C++, 32-bit Editions 4.0
This article was previously published under Q147206 SYMPTOMS
If you create a modeless CPropertySheet under Windows NT, its outer border
will not be a 3D border. A modal CPropertySheet will have a 3D border. Both
modal and modeless CPropertySheets have a 3D border under Windows 95.
CAUSE
MFC sets up a callback function for modeless CPropertySheets called
AfxPropSheetCallback(). This function checks for PSCB_PRECREATE, which is a
message that is received before a property sheet is created. In this
handler, MFC takes out the DS_MODALFRAME style.
Ctl3d32.dll is used by Windows NT to paint 3D borders for controls and
windows. For a dialog box to have a 3D border, CTL3D requires a style of
DS_MODALFRAME.
RESOLUTION- Derive a class from CPropertySheet (CMySheet) and override its
Create(). Comment the call to CWnd::Create() that the ClassWizard
puts in.
- Copy code from CPropertySheet::Create() in DLGPROP.CPP (as shown
below) into CMySheet::Create(), and change the parameters it takes
accordingly.
- Change this line:
m_psh.dwFlags |= (PSH_MODELESS|PSH_USECALLBACK);
to:
m_psh.dwFlags |= PSH_MODELESS;
The callback function isn't set so that PSCB_PRECREATE is not handled,
and the DS_MODALFRAME style is not removed. - Comment out this line:
m_psh.pfnCallback = AfxPropSheetCallback;
- Include <afxpriv.h> in MySheet.h.
- In MySheet.h, change the MySheet.Create to take the corresponding
parameters:
BOOL Create(CWnd* pParentWnd = NULL, DWORD dwStyle = WS_SYSMENU |
WS_POPUP | WS_CAPTION | DS_MODALFRAME | WS_VISIBLE,
DWORD dwExStyle = WS_EX_DLGMODALFRAME );
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article. This problem was corrected in Visual C++,
32-bit Edition, version 4.1.
Modification Type: | Major | Last Reviewed: | 10/24/2003 |
---|
Keywords: | kbBug kbDlg kbfix KbUIDesign kbVC410fix KB147206 |
---|
|