In BHO I need to catch the Back/Forward buttons.

For that I declared the method in my project:

BEGIN_SINK_MAP(CAddonHandler)
...

SINK_ENTRY_EX(1, DIID_DWebBrowserEvents2, DISPID_COMMANDSTATECHANGE, CommandStateChange)

.....
END_SINK_MAP()


void STDMETHODCALLTYPE CommandStateChange( long Command, VARIANT_BOOL Enable);
Defining of that method:

void STDMETHODCALLTYPE CAddonHandler::CommandStateChange( long Command, VARIANT_BOOL Enable)
{
if ((Command == CSC_NAVIGATEFORWARD) || (Command == CSC_NAVIGATEBACK))
m_numberTransition = 5;
}

After building and run that method did began to catch all events of IE:

Enter URL from Address Bar, click on a link and etc. Why?

I noted the browser called that method two times:

the first is for CSC_NAVIGATEBACK, the second one is for CSC_NAVIGATEFORWARD

Any ideas