title: Deleting Keys from Registy
body: <p>I want to delete an Registrykey, but on this code I get always the Returnvalue 2 (file not found), but the path equals the parameter.</p>
  
  <pre><code>HKEY hKey;
  long lReturn = RegOpenKeyEx( HKEY_CURRENT_USER,
                               _T("test1\\test2\\test3"),
                               0L,
                               KEY_ALL_ACCESS,
                               &amp;hKey );
  lReturn = RegDeleteValue(hKey,(LPCWSTR)"value1");
  lReturn = RegDeleteValue(hKey,(LPCWSTR)"value2");
  
  lReturn = RegDeleteKey(hKey,(LPCWSTR)"test1\\test2\\test3");
  lReturn = RegDeleteKey(hKey,(LPCWSTR)"test1\\test2");
  lReturn = RegCloseKey(hKey);
  </code></pre>
  
  <p>If i change the RegDeleteKey parameter to:</p>
  
  <pre><code>lReturn = RegDeleteKey(HKEY_LOCAL_MACHINE,(LPCWSTR)"test1\\test2\\test3");
  </code></pre>
  
  <p>I get the Returnvalue 5(no access). Please help me to delete this Registryentry.</p>