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

You can handle the Close (or/and Help) button by overriding the OnTabWndClickedButton() virtual method in a CExtTabPageContainerWnd-derived class. It can be also a class derived from CExtTabPageContainerFlatWnd, CExtTabPageContainerOneNoteWnd or CExtTabPageContainerWhidbeyWnd, which implement style page containers.


The following code shows how to override this method:

class CMyTabPageContainerWnd : public CExtTabPageContainerWnd 
{
public:
virtual bool OnTabWndClickedButton(
LONG nHitTest,
bool bButtonPressed,
INT nMouseButton, // MK_... values
UINT nMouseEventFlags
)
{
ASSERT_VALID( this );
if( nHitTest==__ETWH_BUTTON_CLOSE && !bButtonPressed )
{
// place your code here
return true;
}
else if( nHitTest==__ETWH_BUTTON_HELP && !bButtonPressed )
{
// place your code here
return true;
}
return
CExtTabPageContainerWnd::OnTabWndClickedButton(
nHitTest,
bButtonPressed,
nMouseButton,
nMouseEventFlags
);
}
}; // class CMyTabPageContainerWnd