In C++, Browser Helper Objects should use IEGetWriteableHKCU to know where they can right to the registry. What is the equivalent function for C#? I want to save user preferences, it looks like the right way to do it on Windows it to use the registry.
Asked
Active
Viewed 264 times
0
-
The registry is rarely the right place to put user preferences. The user's Application Data folder is almost always preferred. – Joel Coehoorn Feb 09 '12 at 17:38
-
I was looking for a "Best Practice" document from SM, but I couldn't find one. – Julien Feb 10 '12 at 18:53
-
that's because the best practice is not to write to the registry for this. – Joel Coehoorn Feb 10 '12 at 19:55
1 Answers
1
Seems to me it's just a function exported from IEFRAME.DLL :-
http://msdn.microsoft.com/en-us/library/ie/ms537315(v=vs.85).aspx
Therefore you can probably just use P/Invoke to call it, I might be a bit off on the signature here so anyone feel free to edit it:
[DllImport("ieframe.dll")]
public extern long IEGetWriteableHKCU(out IntPtr hKey);

Lloyd
- 29,197
- 4
- 84
- 98