eran Posted January 3, 2004 Posted January 3, 2004 Hi, I am trying to use the APIs to read write to the registry: QueryBinaryValue and SetBinaryValue to the first value in each key. meaning. lets asume i have the following path in my registry HKEY_CLASSES_ROOT\*\shel\\Get Path\command in Command i have the first key (Default). i want to Query and se valuse. in some reason i don't succeed to. i use the open function. itreturn success. but the Query and set binary fails... 10x, Quote
Administrators PlausiblyDamp Posted January 3, 2004 Administrators Posted January 3, 2004 Does that registry key exist in your registry? (Do you mean shell not shel)? Also why use the APIs when .Net provides classes to access the registry anyway? Dim rk As Microsoft.Win32.RegistryKey rk = Microsoft.Win32.Registry.ClassesRoot.OpenSubKey("*", True) Dim b() As Byte b = DirectCast(rk.GetValue("test"), Byte()) b(1) = 43 rk.SetValue("test2", b) The value of test wsa added just for this sample. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
eran Posted January 4, 2004 Author Posted January 4, 2004 PlausiblyDamp, 10x. i just realized i needed in order to get the value of the "(Default)" key, to set "LPCTSTR pszValueName" parameter to "". this is fine. the new problem is, that the Create method(which creates a new key, is not as straight forward as it seems. i used it as followed: Create(HKEY_CLASSES_ROOT,"*\\shell"); Now i get lots of compilation error. I searched the internet and saw that the implimintation of this api should be as followed: Create(HKEY_CLASSES_ROOT,"CLSID\\{6270AEE4-AA41-11d4-A25D-008048B63F94}"); Now what is this I asked? Microsoft, in their help didn't talk about that. now i need to use the SetGUIDValue method. so... what the h... is going on here? i just wanted to create new key for "HKEY_CLASSES_ROOT\*" which should be look like "HKEY_CLASSES_ROOT\*\shell" If you have any idae, please help. Quote
Administrators PlausiblyDamp Posted January 4, 2004 Administrators Posted January 4, 2004 Dim rk As Microsoft.Win32.RegistryKey rk = Microsoft.Win32.Registry.ClassesRoot.OpenSubKey("*", True) rk.CreateSubKey("shell") Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.