Skip to content

Instantly share code, notes, and snippets.

@Mandar-Shinde
Created November 19, 2015 09:48
Show Gist options
  • Save Mandar-Shinde/88b0d581d386dc5e25eb to your computer and use it in GitHub Desktop.
Save Mandar-Shinde/88b0d581d386dc5e25eb to your computer and use it in GitHub Desktop.
WinAPI Registry Delete
//
// Delete Registry (64bit machine - 64bit Registry)
//
HKEY hKey = NULL;
long lReturn = RegOpenKeyEx( HKEY_LOCAL_MACHINE,(L"SOFTWARE\\coderbox\\Boost"),0L,KEY_WRITE| KEY_WOW64_64KEY,&hKey );
if (lReturn == ERROR_SUCCESS)
{
lReturn = RegDeleteValueW(hKey, (L"OpenGL"));
RegCloseKey(hKey);
}
//
// Delete Registry (64bit machine - 32bit Registry ie. Wow6432Node )
//
HKEY hKey = NULL;
long lReturn = RegOpenKeyEx( HKEY_LOCAL_MACHINE,(L"SOFTWARE\\coderbox\\Boost"),0L,KEY_WRITE| KEY_WOW64_32KEY,&hKey );
if (lReturn == ERROR_SUCCESS)
{
lReturn = RegDeleteValueW(hKey, (L"OpenGL"));
RegCloseKey(hKey);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment