how to read windows registry
-
Hi to all, I am using windows registry. please look the following.
const char* subkey ="Software\\Microsoft\\Windows NT\\CurrentVersion";
if(RegOpenKey(HKEY\_LOCAL\_MACHINE,subkey,&hKey)== ERROR\_SUCCESS) { cout<<"register is opened"; } else { cout<<"still not working"; }
Above one is working correctly. And also displaying the message correctly. But when subkey i written like follows it is not working.
const char* subkey ="Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows Messaging Subsystem";
I am not getting the exact problem please address the solution.... Thanks in advance.....
To invent something, you need a mountain of junk in your mind. ---------------------Thomas alva edison
-
Hi to all, I am using windows registry. please look the following.
const char* subkey ="Software\\Microsoft\\Windows NT\\CurrentVersion";
if(RegOpenKey(HKEY\_LOCAL\_MACHINE,subkey,&hKey)== ERROR\_SUCCESS) { cout<<"register is opened"; } else { cout<<"still not working"; }
Above one is working correctly. And also displaying the message correctly. But when subkey i written like follows it is not working.
const char* subkey ="Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows Messaging Subsystem";
I am not getting the exact problem please address the solution.... Thanks in advance.....
To invent something, you need a mountain of junk in your mind. ---------------------Thomas alva edison
Sorry friends , I got the solution. I am reading incorrectly. I am reading in local machine instead of reading current user. Any way it is working thanks......
To invent something, you need a mountain of junk in your mind. ---------------------Thomas alva edison
-
Sorry friends , I got the solution. I am reading incorrectly. I am reading in local machine instead of reading current user. Any way it is working thanks......
To invent something, you need a mountain of junk in your mind. ---------------------Thomas alva edison
You can use ATL class CRegKey to do registry operations
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
Never mind - my own stupidity is the source of every "problem" - Mixturecheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You
-
Hi to all, I am using windows registry. please look the following.
const char* subkey ="Software\\Microsoft\\Windows NT\\CurrentVersion";
if(RegOpenKey(HKEY\_LOCAL\_MACHINE,subkey,&hKey)== ERROR\_SUCCESS) { cout<<"register is opened"; } else { cout<<"still not working"; }
Above one is working correctly. And also displaying the message correctly. But when subkey i written like follows it is not working.
const char* subkey ="Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows Messaging Subsystem";
I am not getting the exact problem please address the solution.... Thanks in advance.....
To invent something, you need a mountain of junk in your mind. ---------------------Thomas alva edison
sampath-padamatinti wrote:
But when subkey i written like follows it is not working.
Per MSDN: If RegOpenKey() fails, the return value is a nonzero error code defined in Winerror.h. You can use the FormatMessage function with the FORMAT_MESSAGE_FROM_SYSTEM flag to get a generic description of the error.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius