//virus.cpp #include //#include int main(int argc, char *argv[]){ HKEY hkey; char szBuf[] = "C:\\Windows\\notepad.exe"; RegOpenKeyEx(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\Currentversion\\Run", 0, KEY_SET_VALUE, &hkey); RegSetValueEx (hkey, "notepad.exe", 0, REG_SZ, (LPBYTE) szBuf, strlen(szBuf) + 1); RegCloseKey(hkey); MessageBox(NULL,"Notepad added to startup...","Info",MB_OK); return 0; }