Registry key
-
Hi, Is there a way to get the full path from an open HKEY; How can I get from HKEY hKey to HKEY_LOCAL_MACHINE\SOFTWARE\.........? Thanks.
ftsOne wrote:
Is there a way to get the full path
Yes, we can.. REGOPENKEY - To open the Registry REGQUERYVALE - belongs to ur queried value REGCLOSEKEY - closing the registry... this kind of API's are there.
Born to win...!
-
ftsOne wrote:
Is there a way to get the full path
Yes, we can.. REGOPENKEY - To open the Registry REGQUERYVALE - belongs to ur queried value REGCLOSEKEY - closing the registry... this kind of API's are there.
Born to win...!
Hi and thanks for the quick reply. I know of those API's and googled, yahooed, and whatever else I could think of, just in case I've missed anything. What I've found is that hKey will give me something like Microsoft\MediaPlayer but not HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MediaPlayer. What I need is to determine if hKey is actually pointing to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft and not to HKEY_CURRENT_USER\SOFTWARE\Microsoft. Any insight would be greatly appreciated.
-
Hi and thanks for the quick reply. I know of those API's and googled, yahooed, and whatever else I could think of, just in case I've missed anything. What I've found is that hKey will give me something like Microsoft\MediaPlayer but not HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MediaPlayer. What I need is to determine if hKey is actually pointing to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft and not to HKEY_CURRENT_USER\SOFTWARE\Microsoft. Any insight would be greatly appreciated.
ftsOne wrote:
What I've found is that hKey will give me something like Microsoft\MediaPlayer but not HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MediaPlayer.
No, it is giving full path only... Hope u gone through this page..If not... http://msdn2.microsoft.com/en-us/library/ms724909(VS.85).aspx[^] have a look... we will get full path ya
Born to win...!
-
ftsOne wrote:
What I've found is that hKey will give me something like Microsoft\MediaPlayer but not HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MediaPlayer.
No, it is giving full path only... Hope u gone through this page..If not... http://msdn2.microsoft.com/en-us/library/ms724909(VS.85).aspx[^] have a look... we will get full path ya
Born to win...!
Hi again, Yeah, I went through that page. I also scrutinized everything that started with Reg... That API only gives you the value associated with the open key. It does not give you the full path to the key. I can enumerate the values and subkeys. What I need is the path to the open key. Thanks again.
-
Hi again, Yeah, I went through that page. I also scrutinized everything that started with Reg... That API only gives you the value associated with the open key. It does not give you the full path to the key. I can enumerate the values and subkeys. What I need is the path to the open key. Thanks again.
Can u send me ur code..i will check it ..and i will tell U
Born to win...!
-
Can u send me ur code..i will check it ..and i will tell U
Born to win...!
void SearchHive(HKEY hive) { HKEY hKey; DWORD dwIndex = 0; LONG lRet; DWORD cbName = IS_KEY_LEN; TCHAR szSubKeyName[IS_KEY_LEN]; if (::RegOpenKeyEx(hive, NULL, 0, KEY_READ, &hKey) != ERROR_SUCCESS || g_bCancelSearch) goto Stop; while (((lRet = ::RegEnumKeyEx(hKey, dwIndex, szSubKeyName, &cbName, NULL,NULL, NULL, NULL)) != ERROR_NO_MORE_ITEMS) && g_bCancelSearch != true) { // Do we have a key to open? if (lRet == ERROR_SUCCESS) { /********************************************** Do Something with the key hKey is an open HKEY handle returned by ::RegOpenKeyEx szSubKeyName is the key in string format returned by ::RegEnumKeyEx at dwIndex usually something like 'SOFTWARE' or 'HARDWARE' what is the human readable format for hKey for example: convertHKEYtoString(hKey) would return something like HKEY_LOCAL_MACHINE\SOFTWARE\MyCompany\MyApp\MySettings /*********************************************/ } dwIndex++; cbName = IS_KEY_LEN; } Stop: //No more subkeys ::RegCloseKey(hKey); }
-
Hi, Is there a way to get the full path from an open HKEY; How can I get from HKEY hKey to HKEY_LOCAL_MACHINE\SOFTWARE\.........? Thanks.
And see A Registry Class[^].
-
And see A Registry Class[^].
Hi, I have found several registry classes here at code project actually. All of them assume you have the path (ie: HKEY_LOCAL_MACHINE\SOFTWARE\MyApp) to open the hKey. I have the an open hKey and want the path in a string format to display it on a control. '0X80000000' means nothing to the user, where as 'HKEY_LOCAL_MACHINE\SOFTWARE\MyApp' would be helpfull. I can walk the key from a predefined key like HKLM forward, what I need is to walk backwards back to HKLM.
-
Hi, I have found several registry classes here at code project actually. All of them assume you have the path (ie: HKEY_LOCAL_MACHINE\SOFTWARE\MyApp) to open the hKey. I have the an open hKey and want the path in a string format to display it on a control. '0X80000000' means nothing to the user, where as 'HKEY_LOCAL_MACHINE\SOFTWARE\MyApp' would be helpfull. I can walk the key from a predefined key like HKLM forward, what I need is to walk backwards back to HKLM.
I guess the bigger question is why do you need this information? Perhaps if you explained, we might could offer a different approach.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne