No, unfortunately we don’t have such sample project. But this is simple to do. You should create your own CExtControlBar
-derived class and override the CExtControlBar::OnNcAreaButtonsReinitialize()
virtual method in it. Your method should look like:
void C_YOUR_ControlBar_CLASS_NAME::OnNcAreaButtonsReinitialize()
{
ASSERT_VALID( this );
INT nCountOfNcButtons = NcButtons_GetCount();
if( nCountOfNcButtons > 0 )
return;
NcButtons_Add( new CExtBarNcAreaButtonClose(this) );
#if (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
NcButtons_Add( new CExtBarNcAreaButtonAutoHide(this) );
#endif // (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
// NcButtons_Add( new CExtBarNcAreaButtonExpand(this) );
NcButtons_Add( new CExtBarNcAreaButtonMenu(this) );
NcButtons_Add( new CExtBarNcAreaButtonFloatingMaximizeRestore(this) );
}
The method above is very similar to the original
CExtControlBar::OnNcAreaButtonsReinitialize()
method. The only difference is the last line of code:
NcButtons_Add( new CExtBarNcAreaButtonFloatingMaximizeRestore(this) );
Prof-UIS contains the commented source code of the
CExtBarNcAreaButtonFloatingMaximizeRestore
class in the
.../Prof-UIS/Include/ExtControlBar.h and
.../Prof-UIS/Src/ExtControlBar.cpp files. You can copy this source code into your project. The
CExtBarNcAreaButtonFloatingMaximizeRestore
class is the beta implementation of the caption button you need.