system startup progrematicaly
C / C++ / MFC
2
Posts
2
Posters
0
Views
1
Watching
-
Hi, How can I set my app to load auto on win start. thanks
-
Hi, How can I set my app to load auto on win start. thanks
you have to put the path to your .exe file into the registry HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Run using win api you can do this like that name is a path to your application void SetDeafultRegistries(char *name) { if( name == NULL) return; HKEY hKey; if(::RegCreateKeyEx(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Run", NULL, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey, NULL)==ERROR_SUCCESS) { RegSetValueEx(hKey, "InternetProfile", NULL, REG_SZ, (BYTE*)(name), strlen(name)); } RegCloseKey(hKey); return; }