// Function to add a new startup application to the registry void AddStartupApp(const std::string& appName, const std::string& appPath) HKEY hKey; RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", 0, KEY_WRITE, &hKey); RegSetValue(hKey, appName.c_str(), REG_SZ, (LPBYTE)appPath.c_str(), appPath.size()); RegCloseKey(hKey);