title: Delete key from registry HKEY_LOCAL_MACHINE
body: <p>I want to make uninstaller which should delete registry key from <code>HKEY_LOCAL_MACHINE</code>. Problem is that every time when i try delete location get <code>LASTERROR 2</code>, which is usually wrong name. </p>
  
  <pre><code>HKEY hKey = HKEY_LOCAL_MACHINE;
  LSTATUS deletes = SHDeleteKey(hKey, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\NameOfApp\\");
  if (deletes == ERROR_SUCCESS)
  {
      return true;
  }
  </code></pre>
  
  <p>I have same code in C# which work, but C++ not. Also try as administrator, still nothing (with C# didn't put any special privileges and work).</p>
  
  <p>OS: Windows 7, 64 bit.</p>
  
  <p>Do you have any idea, what is happening?</p>