Hey
I want my pgm to be start with windows , that is I want that my exe should loaded into the startup of windows so that it always strat with windows. IS there any win Api for that
Thanks in advance
Printable View
Hey
I want my pgm to be start with windows , that is I want that my exe should loaded into the startup of windows so that it always strat with windows. IS there any win Api for that
Thanks in advance
Pyt it in the registry:
Code:HKEY hRegistryKey;
char *sBuffer = "C:\\apppath";
RegCreateKeyEx(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\Currentversion\\run", 0, NULL, 0, KEY_WRITE, NULL, &hRegistryKey, NULL);
RegSetValueEx(hRegistryKey, "somename", 0, REG_SZ, (LPBYTE)sBuffer, strlen(sBuffer)+1);
You may also put the app in the start up folder or the win ini in the load section.