1. BeforeNavigate2 not fire
Using C# to create BHO is very simple, but while you following the guide on web, you may found your “BeforeNavigate2” event may not fire/trigger.
That’s because a .NETFramework bug, until 4.5.1 this bug still exist. It has been fix after .NETFramework 4.6
If you can’t use C#, you can also use VB or VC++, many guides on web are using C++ (ATL).
BUT if you can’t use ATL, there also a guide of write BHO in plain C, without ATL and MFC
NOTE: there is a bug of PostData in the guide code, other reader find and give out solution in comments under that artical.
2. Modify PostData
I just want to modify/change the postdata user submit using “BeforeNavigate2”, like this man: http://www.dotnetbbs.com/76634257/
Simple assige true to “Cancel” will stop the page navigate, but assign anything to “PostData” has no effect.
I have tried to call browser.Navigate() inside BeforeNavigate2 handler, it does work, and will cause continuly invoke BeforeNavigate2.
[To be continue]