How to read Binary/Hex data from the registry 
Author Message
 How to read Binary/Hex data from the registry

All,

How can I read binary\Hex data from the registry using VC++;  Thanks in
advancd.



Sun, 11 Jan 2004 03:26:18 GMT  
 How to read Binary/Hex data from the registry
Take a look at RegQueryValueEx()

Rick



Quote:
> All,

> How can I read binary\Hex data from the registry using VC++;  Thanks in
> advancd.



Sun, 11 Jan 2004 04:58:02 GMT  
 How to read Binary/Hex data from the registry
Sorry to bother you. I am using RegQueryValueEx()below is a sample of my
code. Can you see what I am doing worng. What I am trying to do is get the
data and make a small change to the 5 bit, then put it back.

int UpdateDeskView()

{

HKEY hKey;

DWORD dwSize = sizeof(DWORD);

DWORD dwLastError;

TCHAR szMessage[512];

TCHAR szData[256];

DWORD dwType = REG_DWORD_LITTLE_ENDIAN;

if(RegOpenKeyEx(HKEY_CURRENT_USER,
"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\DeskView",

0, KEY_ALL_ACCESS, &hKey) != ERROR_SUCCESS)

{

printf("\n%s value\n", GetLastErrorMsg(GetLastError()));

return 0;

Quote:
}

if(RegQueryValueEx(hKey, "Settings", NULL, &dwType, NULL, &dwSize) !=
ERROR_SUCCESS)

{

printf("\n%s value\n", GetLastErrorMsg(GetLastError()));

RegCloseKey(hKey);

return 0;

Quote:
}

HGLOBAL hGlobal = GlobalAlloc(GPTR, dwSize);

BYTE * pByte = (BYTE *)GlobalLock(hGlobal);

if(RegQueryValueEx(hKey, "Settings", NULL, &dwType,

(BYTE*)pByte, &dwSize) != ERROR_SUCCESS)

{

printf("\n%s value\n", GetLastErrorMsg(GetLastError()));

RegCloseKey(hKey);

return 0;

Quote:
}

printf("\n %x", pByte);

RegCloseKey(hKey);

Quote:
}



Quote:
> Take a look at RegQueryValueEx()

> Rick


in

> > All,

> > How can I read binary\Hex data from the registry using VC++;  Thanks in
> > advancd.



Sun, 11 Jan 2004 10:29:44 GMT  
 How to read Binary/Hex data from the registry



Quote:
> Sorry to bother you. I am using RegQueryValueEx()below is a sample of my
> code. Can you see what I am doing worng. What I am trying to do is get the
> data and make a small change to the 5 bit, then put it back.

> if(RegQueryValueEx(hKey, "Settings", NULL, &dwType, NULL, &dwSize) !=
> ERROR_SUCCESS)

the second null is supposed to be where the data goes


Mon, 12 Jan 2004 03:11:34 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. How to read Binary/Hex data from the registry

2. Reading Binary Data from the Registry

3. Read/Set Binary Data in registry

4. Hex to Binary => Binary to Hex

5. getting binary of HEX data from a file

6. HEX/Binary Reading/Writing

7. How can I write binary-data to registry?

8. Reading binary registry value

9. Read a binary value from the registry

10. How to write binary data into the registry?

11. How to write a binary data in registry

12. Store Binary Data in Registry

 

 
Powered by phpBB® Forum Software