I have a CPropertySheet.
When I use
ModifyStyle(DS_MODALFRAME, WS_POPUP | WS_THICKFRAME | WS_MAXIMIZEBOX);
inside an OnCreate handler everything is fine. The created window behaves as expected and is resizable.
When I use the same code, just a tick later in CPropertySheet::OnInitDialog than this code has only the effect that the correct frame is shown, also the cursor changes when I drag over the window border. But there is no resize feature.
Same happens for a CDialog when uses in OnInitDialog. Seams that some flags can't be changed after a window is created.
Is there more information about this problem?
You need to set the
nFlags
parameter toSWP_FRAMECHANGED
and maybe alsoSWP_DRAWFRAME
in your call toModifyStyle
. This way it will callSetWindowPos
internally, which will apply the new style. You also need to remove WS_SYSMENU instead of DS_MODALFRAME.Example: