Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
653 views
in Technique[技术] by (71.8m points)

internet explorer - IE BHO in EPM (Enhanced Protected Mode)

I'm trying to make my IE BHO work on Win8 (IE10 and IE11 preview) with EPM turned on. I've found a few articles about the subject from MS (http://blogs.msdn.com/b/ieinternals/archive/2012/03/23/understanding-ie10-enhanced-protected-mode-network-security-addons-cookies-metro-desktop.aspx) but they still don't provide actual examples on how to make this work. I have compiled my BHO in both 32 and 64 bit, added the category (CATID_AppContainerCompatible) as stated in the article but still I don't get any web browser events from IE. Can anybody point to a more detailed example on how to make this work ?

Here is how my rgs file looks like:


HKCR
{
    TestBHO.TestScript.1 = s 'TestScript Class'
    {
        CLSID = s '{051FB9EC-79EA-4F8E-9EC2-F1FF4462FB09}'
    }
    TestBHO.TestScript = s 'TestScript Class'
    {
        CLSID = s '{051FB9EC-79EA-4F8E-9EC2-F1FF4462FB09}'
        CurVer = s 'TestBHO.TestScript.1'
    }
    NoRemove CLSID
    {
        ForceRemove {051FB9EC-79EA-4F8E-9EC2-F1FF4462FB09} = s 'TestScript Class'
        {
            ProgID = s 'TestBHO.TestScript.1'
            VersionIndependentProgID = s 'TestBHO.TestScript'
            ForceRemove 'Programmable'
            InprocServer32 = s '%MODULE%'
            {
                val ThreadingModel = s 'Apartment'
            }
            'TypeLib' = s '{2D9CE0FA-2040-4A24-807E-0C0BF4E9ECE7}'
            'Implemented Categories' = s ''
            {
                {59fb2056-d625-48d0-a944-1a85b5ab2640} = s ''   
                    {
                    }
            }
        }
    }
}

Note that in IE's Manage Add-ons Page I see my BHO as Enabled and supports both 32bit and 64bit, but the DLL is not even loaded.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The DEFINE_GUID call simply defines the GUID value constant in your code, it's not actually doing anything to register your object with the COM component category (which is stored in the registry).

See http://msdn.microsoft.com/en-us/library/windows/desktop/ms692551(v=vs.85).aspx and http://msdn.microsoft.com/en-us/library/windows/desktop/ms694322(v=vs.85).aspx

You can see which objects are registered into the various categories using the OLEView tool.

Also, be sure to place your BHO's DLL with an AppContainer-readable folder (e.g. a subfolder of the Program Files folder). If you fail to do so, your DLL will not be loaded by the IE instance in Enhanced Protected Mode.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...