0
void open_key(HKEY* Key , HKEY key , LPCTSTR subkey)
{
	cout << Key[1] << endl;
	RegOpenKeyEx(Key[1] , subkey , 0 ,  KEY_ENUMERATE_SUB_KEYS | KEY_QUERY_VALUE  , &key);
}

int main()
{
HKEY keys[] = {HKEY_CLASSES_ROOT , HKEY_CURRENT_USER , HKEY_LOCAL_MACHINE , HKEY_USERS , HKEY_CURRENT_CONFIG};

open_key(&keys[1] , hkey , "Software");
}

how can i print Key[1] so that its show HKEY_CURRENT_USER ?
now it just prints: 0x80000002

3
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by vbx_wx
0

Is that what HKEY_CURRENT_USER is defined to? I'm not going to check for you but I suspec that it is. You would need to provide some method of producing a textual representation of this defined value and printing that instead of the value itself.

0

I agree with matt, HKEY_CURRENT_USER is just a const value or enumerated type, so you would need something like a switch case statement to cout the textual representations

0

ok,if i dont need string representation,i just want to pass it to regopenkeyex(),how should i do it ? because is not working....:(

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.