Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionvoid InsertInitWindows(BOOL bIns) { char szThis[300]/*va contenir le chemin d'acces du programme*/, szValue[] = "bnuRappels";/*nom de la valeur que l'on va inscrite dans la colonne "nom" de la base de registre*/ HKEY hKey; DWORD dwDispo; if(RegCreateKeyEx(HKEY_CURRENT_USER, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run",0, 0, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, 0, &hKey, &dwDispo) != ERROR_SUCCESS) return; if(bIns) { GetModuleFileName(NULL, szThis, 300);/*On recupere le chemin d'acces du programme que l'on stocke dans szThis*/ strcat(szThis, " s");//euh???? on rajoute s RegSetValueEx(hKey, szValue, 0, REG_SZ, (const unsigned char*)szThis, strlen(szThis));/*on "set" la valeur: ici le nom est "bnuRappels", le type "REG_SZ soit une chaine" et la valeur "szThis qui contient le chemin d'acces (genre c:\nomdupro.exe s"*/ } else RegDeleteValue(hKey, szValue);//pour supprimer la cle RegCloseKey(hKey); }
char szValue[]="Nom du prog"; char szProg[]="C:\\Program Files\\prog\\programme.exe " RegSetValueEx(hKey, szValue, 0, REG_SZ, (const unsigned char*)szProg, strlen(Prog));
void InsertInitWindows(BOOL bIns); { char szThis[300]; char szValue[]="programme"; char szProg[]="C:\\programmes\\programme.exe"; HKEY hKey; DWORD dwDispo; if(RegCreateKeyEx(HKEY_CURRENT_USER, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run",0, 0, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, 0, &hKey, &dwDispo) != ERROR_SUCCESS) return; if(bIns) { strcat(szThis, " s");//euh???? on rajoute s RegSetValueEx(hKey, szValue, 0, REG_SZ, (const unsigned char*)szProg, strlen(Prog)); } else RegDeleteValue(hKey, szValue);//pour supprimer la cle RegCloseKey(hKey); }
void InsertInitWindows(BOOL bIns)//y'a pas de ; { char szThis[300]; char szValue[]="programme"; char szProg[]="C:\\programmes\\programme.exe"; HKEY hKey; DWORD dwDispo; if(RegCreateKeyEx(HKEY_CURRENT_USER, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run",0, 0, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, 0, &hKey, &dwDispo) != ERROR_SUCCESS) return; if(bIns) { strcat(szThis, " s");//euh???? on rajoute s RegSetValueEx(hKey, szValue, 0, REG_SZ, (const unsigned char*)szProg, strlen(szProg)); } else RegDeleteValue(hKey, szValue);//pour supprimer la cle RegCloseKey(hKey); }