windows registry stuff
Hey I need to get the desktop background to use in my game, so I need to read the registry for the HKEY_CURRENT_USER\Control Panel\Desktop\wallpaper key, so I think I need to use the RegQueryInfoKey function, but I can''t figure out how to read the data... How would I read the data into a regular string so I can use it to open the bmp?
Pseudo-pseudo-code from memory:
There are params to the functions to figure out key type and security, I omitted those because I don't remember their exact order and they really aren't too important for reading a single value.
Edited by - JonStelly on October 3, 2000 11:56:02 AM
LPTSTR lpName = new TCHAR[256];
DWORD cbName = 256 * sizeof(TCHAR);
RegCreateKeyEx(HKEY_CURRENT_USER, _T("Control Panel\\Desktop"), &hkKey);
RegQueryValueEx(hkKey, _T("wallpaper"), (LPVOID)lpName, &cbName);
RegCloseKey(hkKey);
There are params to the functions to figure out key type and security, I omitted those because I don't remember their exact order and they really aren't too important for reading a single value.
Edited by - JonStelly on October 3, 2000 11:56:02 AM
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement