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

Create a class derived from CExtTabPageContainerWnd or from any other class derived from CExtTabPageContainerWnd (e.g. CExtTabPageContainerOneNoteWnd) and override the OnTabWndSelectionChange() virtual method. Please do not forget to call the method of its parent class if you want only to monitor these events. The method is called twice. First, the bPreSelectionTest parameter is set to true and you can return false if you want to ignore the selection change event. The second time, this parameter is equal to false and the selected tab item is already changed. Here is a sample code snippet:

virtual bool CYourTabPageContainerWnd::OnTabWndSelectionChange(    
LONG nOldItemIndex,
LONG nNewItemIndex,
bool bPreSelectionTest
)
{
bool bRetVal =
CExtTabPageContainerWnd::OnTabWndSelectionChange(
nOldItemIndex,
nNewItemIndex,
bPreSelectionTest
);
if( bRetVal )
{
if( bPreSelectionTest )
{
///POINTA:
/// BEFORE A NEW PAGE BECOMES ACTIVE
/// (the previous page window is still on the top
...
}
else
{
///POINTB:
/// WHEN THE NEW PAGE IS ACTIVATED
/// (the new page is visible)
...
}
}
return bRetVal;
}