Professional User Interface Suite, Copyright FOSS Software Inc. Help Published with Permission.

You can fake icons in the title bar by implementing your own non-client buttons. Each control bar can have several non-client area buttons (like the X button when the control bar is in the floating state). The buttons can be aligned to the left or to the right. They can also paint their own areas. In the MDI sample (provided with the library) you can see the Task Panel control bar with two buttons (<- and ->) aligned to the right. They are clickable. What you need to do is to write your own button, which is not clickable and which will paint an icon in its area.

These buttons are derived from the CExtBarNcAreaButton class. So, you need to implement the button similar to that of <- (or ->) in the MDI sample, but the OnNcAreaDraw() method should paint an icon and OnNcAreaClicked() should do nothing. This button should return false in the OnQueryVisibility() method if the control bar is not in the floating state.

To insert your button into the caption of the control bar, create a class derived from CExtControlBar (or CExtToolControlBar, or CExtMenuControlBar). Override the OnNcAreaButtonsReinitialize() virtual method in your control bar:

void CMyControlBar::OnNcAreaButtonsReinitialize()
INT nCountOfNcButtons = NcButtons_GetCount();
       if( nCountOfNcButtons > 0 )
       NcButtons_Add( new CMyIconButton(this) );

As we mentioned before, CMyIconButton should be derived from CExtBarNcAreaButton. Please find the CBarNcTaskAreaBtn class in the MainFrm.h file of the MDI sample and use it as a guide of writing custom non-client buttons.

NOTE: The vertical height of a floating mini-frame window is usually less than 16 pixels. You may need to paint icons with the height a little bit less than 16. These icons may be 16x16 or 32x32, but any meaningful image should be approximately 12x12. Otherwise your icon may not fit the caption height.