Return to Snippet

Revision: 48346
at June 29, 2011 07:50 by the_coder


Initial Code
//nfilename: the path to the application 
//keyname: the name to appear in the registery
void AutoStartRegs(char *nfilename, char *keyname)
{
	HKEY key;

		RegCreateKeyEx(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Run", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &key, NULL); 
		RegSetValueEx(key, keyname, 0, REG_SZ, (const unsigned char *)nfilename, strlen(nfilename));
		RegCloseKey(key); 

	return;
}

Initial URL


Initial Description


Initial Title
Register Autostart Application

Initial Tags
c

Initial Language
C