LONG lResult; HKEY hKey; const wchar_t* lpSubKey=L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon"; lResult=RegOpenKeyExW(HKEY_LOCAL_MACHINE, lpSubKey, 0, KEY_SET_VALUE|KEY_READ, &hKey); if(lResult == ERROR_SUCCESS) qDebug()<<"its okay!:) "<<lResult; const wchar_t* lpName=L"Shell"; const wchar_t* lpValueEx=L"test.exe"; lResult=RegSetValueExW(hKey, lpName, 0, REG_SZ, (BYTE*)lpValueEx, ((DWORD)wcslen(lpValueEx)+1)*sizeof(wchar_t)); RegCloseKey(hKey); if (lResult != ERROR_SUCCESS) qDebug()<<"OOOpps!"<<lResult;