title: How to read a value from the Windows registry
body: <p>Given the key for some registry value (e.g. HKEY_LOCAL_MACHINE\blah\blah\blah\foo) how can I:</p>
  
  <ol>
  <li>Safely determine that such a key exists.</li>
  <li>Programmatically (i.e. with code) get its value.</li>
  </ol>
  
  <p>I have absolutely no intention of writing anything back to the registry (for the duration of my career if I can help it). So we can skip the lecture about every molecule in my body exploding at the speed of light if I write to the registry incorrectly. </p>
  
  <p>Prefer answers in C++, but mostly just need to know what the special Windows API incantation to get at the value is.</p>