1

I am using Microsoft's Web Browser ActiveX control in an MFC application. I want to be able to change the default MIME handler for PDF.

https://msdn.microsoft.com/en-us/library/ie/ms775148(v=vs.85).aspx

It appears to me that web browser control must use the registry based file type association

HKEY_CLASSES_ROOT\MIME\Database\Content Type\application/pdf

I want to be able to set web browser control to use the pdf application I tell it to use at runtime, rather than using the system registered default.

I cannot find any API that will allow me to do this. Is it possible?

  • 2
    Probably do-able but tedious, using [Asynchronous Pluggable Protocols](https://msdn.microsoft.com/en-us/library/aa767743%28v=vs.85%29.aspx). – noseratio Mar 04 '15 at 10:34
  • 1
    ok - thanks. I will accept this as the answer. –  Mar 10 '15 at 10:23

1 Answers1

0

I initially proposed in the comments to create an Asynchronous Pluggable Protocol handler to customize the player for this MIME type, but I think there might be an easier approach.

You might be able to redirect the HKEY_CLASSES_ROOT\MIME\Database\Content Type\application/pdf registry key to your own custom version (per-process) with RegOverridePredefKey API, as explained here.

Community
  • 1
  • 1
noseratio
  • 59,932
  • 34
  • 208
  • 486