title: If Registry Key Does Not Exist
body: <p>I'm adding my program to start up with:</p>
  
  <pre><code>TCHAR szPath[MAX_PATH];
  GetModuleFileName(NULL,szPath,MAX_PATH);
  HKEY newValue;
  RegOpenKey(HKEY_CURRENT_USER,"Software\\Microsoft\\Windows\\CurrentVersion\\Run",&amp;newValue);
  RegSetValueEx(newValue,"myprogram",0,REG_SZ,(LPBYTE)szPath,sizeof(szPath));
  RegCloseKey(newValue);
  return 0;
  </code></pre>
  
  <p>And I wanted to add a check if key doesn't exists only then to create it. And something else is weird with my code I have checked the registry for my key and I see in the data column my application path + "..." (after .exe) and when I double click to check the data the popup opens and it's fine it's .exe only not .exe...</p>
  
  <p>Thanks for you help :)</p>