سؤال

i am new to Browser helper object i got the below link http://www.codeproject.com/Articles/37044/Writing-a-BHO-in-Plain-C which helps me to understand BHO but using this how can i acheive --in internet explorer when i open a PDFs file it has to throw an event and i need to catch it and find what extension it is trying to open and if its is PDFs then raise a popup message.

هل كانت مفيدة؟

المحلول

In your IObjectWithSite::SetSite() implementation find and hook a sink object to the DWebBrowserEvents2 connection point of the browser object passed into the SetSite function. Now in your event sink's IDispatch::Invoke implementation check if the URL parameter is a string ends with PDF.

If you do not want to show the PDF at all, you probably want to consider handling the PDF MIME type by yourself.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top