2012-02-22 10 views
2

私はBHOからWindowsレジストリの情報を読み書きする必要があります。 Windows Vista/7では、HKEY_CURRENT_USER \ Software \ AppDataLow \ Softwareの下に新しいキーを作成します。保護されたモードでも、これは正常に動作します。Windows XP:IEからレジストリに書き込む場所は?

ただし、XPでは動作しません。レジストリをHKEY_CURRENT_USER \ Software \ Classes \ SoftwareまたはHKEY_CURRENT_USER \ Softwareに変更しようとしました。

BHOからWindows XPで使用する正しいレジストリキーは何ですか? IEGetWriteableHKCUは、Windows XPに存在しません

、それが最初にVistaの前にWindows Vista

+0

私はあなたがここでトラブルを引き起こさないためにIE6を必要と思う。低特権パスはVistaまで追加されませんでした。 –

+0

XPでは、HKCU \ Software \ YourExtensionのようなものを試してみましたか?ユーザー管理者ですか? –

+0

なぜHKEY_LOCAL_MACHINEの下に書きませんか? – MEYWD

答えて

4

に加え、あなたは別のアプローチを使用する必要があります... BHOのインストール時には、Windows/IEどのキーを伝える必要があります(秒)あなたはBHOから書き込み可能になりたい...

これを処理する全体のAPIファミリがあり

(MSDNへのWinXP SP2からサポートし、最大応じて):

3

IE 7,8,9、(デスクトップ)を制限 "保護モード" で10個のランタブレジストリは特別な "書き込み可能"セクションに書き込みます。 IEにポインタを要求する必要があります。

(C#の)

// C# PInvoke declaration for needed IE method. 
[DllImport("ieframe.dll")] 
public static extern int IEGetWriteableHKCU(ref IntPtr phKey); 

// ... 
     // somewhere inside other method: 
     IntPtr phKey = new IntPtr(); 
     var answer = IEGetWriteableHKCU(ref phKey); 
     RegistryKey writeable_registry = RegistryKey.FromHandle(
      new Microsoft.Win32.SafeHandles.SafeRegistryHandle(phKey, true) 
     ); 
     RegistryKey registryKey = writeable_registry.OpenSubKey(RegistryPathString, true); 
     if (registryKey == null) { 
      registryKey = writeable_registry.CreateSubKey(RegistryPathString); 
     } 
     registryKey.SetValue("Mode", mode); 
     writeable_registry.Close(); 

参照:

についてモードを保護: http://www.codeproject.com/Articles/18866/A-Developer-s-Survival-Guide-to-IE-Protected-Mode

についてはモード保護の強化: http://blogs.msdn.com/b/ieinternals/archive/2012/03/23/understanding-ie10-enhanced-protected-mode-network-security-addons-cookies-metro-desktop.aspx

関連する問題