程序到windows的启动项(C++实现)
TCHAR exepath[MAX_PATH]; GetModuleFileName(0, exepath, MAX_PATH); HKEY hKey; LONG lnRes = RegOpenKeyEx( HKEY_CURRENT_USER, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", 0,KEY_WRITE, &hKey ); if( ERROR_SUCCESS == lnRes ) { lnRes = RegSetValueEx(hKey, "YourProgramsName", 0, REG_SZ, exepath, strlen(exepath)); }
待后续分析解释