title: Add Application to Startup (Registry)
body: <p>I'm trying to add my software to registry, I have found some pieces of the codes I can use but not full working code C/C++ is new to me and can't create it on my own. But here is the basic idea: Check if reg key set if not create it. </p>
  
  <p>I was able to get my program location using this code:</p>
  
  <pre><code>TCHAR szPath[MAX_PATH];
  GetModuleFileName(NULL,szPath,MAX_PATH);
  </code></pre>
  
  <p>And was able to create the key with: (Not sure if it's the right way)</p>
  
  <pre><code>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>What is missing, A small check if the key isn't already there...</p>
  
  <p>Thank you!</p>