August 8th, 2011, 08:27 AM
DWebBrowserEvents2::CommandStateChange () event
In BHO I need to catch the Back/Forward buttons.
For that I declared the method in my project:
Defining of that method:
SINK_ENTRY_EX(1, DIID_DWebBrowserEvents2, DISPID_COMMANDSTATECHANGE, CommandStateChange)
void STDMETHODCALLTYPE CommandStateChange( long Command, VARIANT_BOOL Enable);
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
Click Here to Expand Forum to Full Width