{"id":5506,"date":"2015-09-09T21:20:12","date_gmt":"2015-09-09T13:20:12","guid":{"rendered":"http:\/\/gemchen.cn\/?p=5506"},"modified":"2015-09-09T21:20:12","modified_gmt":"2015-09-09T13:20:12","slug":"using-ie-bho","status":"publish","type":"post","link":"https:\/\/gemchen.cn\/?p=5506","title":{"rendered":"Using IE BHO"},"content":{"rendered":"<p>\u5173\u4e8eIE\u63d2\u4ef6BHO\uff0c\u7f51\u4e0a\u5f88\u591a\u6587\u7ae0\uff0c\u6211\u5c31\u4e0d\u518d\u5e9f\u8bdd\u4ecb\u7ecd\u3002\u8fd9\u73a9\u610f\u53ef\u4ee5\u8bf4\u662f\u975e\u5e38\u5371\u9669\u7684\u4e00\u79cd\u4e1c\u897f\uff0c\u52ab\u6301\u6d4f\u89c8\u5668\uff0c\u76d7\u53d6\u7528\u6237\u5bc6\u7801\u7b49\u90fd\u53ef\u4ee5\u505a\u3002<\/p>\n<p>\u6bd4\u5982\uff1a\u300a\u4e24\u5206\u949f\u642d\u5efaBHO\u94a9\u5b50\u300bhttp:\/\/www.vckbase.com\/index.php\/wv\/1597<br \/>\n\u518d\u6bd4\u5982\uff1a\u300aC#\u5f00\u53d1BHO\u63d2\u4ef6UrlTrack\u300bhttp:\/\/blog.csdn.net\/lee576\/article\/details\/3057820<\/p>\n<p>\u7c7b\u4f3c\u7684\u6587\u7ae0\u4e0d\u80dc\u679a\u4e3e\uff0c\u6211\u5728\u5b9e\u9645\u4f7f\u7528\u4e2d\u53d1\u73b0\u4e86\u51e0\u4e2a\u95ee\u9898\u8bb0\u5f55\u4e0b\u6765\u5e0c\u671b\u80fd\u5e2e\u52a9\u540e\u6765\u8005\u5c11\u8d70\u5f2f\u8def\u3002<\/p>\n<p>1. BeforeNavigate2 not fire<br \/>\nUsing C# to create BHO is very simple, but while you following the guide on web, you may found your &#8220;BeforeNavigate2&#8221; event may not fire\/trigger.<br \/>\nThat&#8217;s because a .NETFramework bug, until 4.5.1 this bug still exist. It has been fix after .NETFramework 4.6<\/p>\n<p>If you can&#8217;t use C#, you can also use VB or VC++, many guides on web are using C++ (ATL).<br \/>\nBUT if you can&#8217;t use ATL, there also a guide of write BHO in plain C, without ATL and MFC<br \/>\nhttp:\/\/www.codeproject.com\/Articles\/37044\/Writing-a-BHO-in-Plain-C<br \/>\nNOTE: there is a bug of PostData in the guide code, other reader find and give out solution in comments under that artical.<\/p>\n<p>2. Modify PostData<br \/>\nI just want to modify\/change the postdata user submit using &#8220;BeforeNavigate2&#8221;, like this man: http:\/\/www.dotnetbbs.com\/76634257\/<br \/>\nSimple assige true to &#8220;Cancel&#8221; will stop the page navigate, but assign anything to &#8220;PostData&#8221; has no effect.<br \/>\nI have tried to call browser.Navigate() inside BeforeNavigate2 handler, it does work, and will cause continuly invoke BeforeNavigate2.<\/p>\n<p>[To be continue]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5173\u4e8eIE\u63d2\u4ef6BHO\uff0c\u7f51\u4e0a\u5f88\u591a\u6587\u7ae0\uff0c\u6211\u5c31\u4e0d\u518d\u5e9f\u8bdd\u4ecb\u7ecd\u3002\u8fd9\u73a9\u610f\u53ef\u4ee5\u8bf4\u662f\u975e\u5e38\u5371\u9669\u7684\u4e00\u79cd\u4e1c\u897f\uff0c\u52ab\u6301\u6d4f\u89c8\u5668\uff0c\u76d7\u53d6\u7528\u6237\u5bc6\u7801\u7b49\u90fd\u53ef\u4ee5\u505a\u3002 \u6bd4\u5982\uff1a\u300a\u4e24\u5206\u949f\u642d\u5efaBHO\u94a9\u5b50\u300bhttp:\/\/www.vckbase.com\/&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[10],"class_list":["post-5506","post","type-post","status-publish","format-standard","hentry","category-dev","tag-bho"],"_links":{"self":[{"href":"https:\/\/gemchen.cn\/index.php?rest_route=\/wp\/v2\/posts\/5506","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gemchen.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gemchen.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gemchen.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gemchen.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5506"}],"version-history":[{"count":0,"href":"https:\/\/gemchen.cn\/index.php?rest_route=\/wp\/v2\/posts\/5506\/revisions"}],"wp:attachment":[{"href":"https:\/\/gemchen.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5506"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gemchen.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5506"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gemchen.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5506"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}