Réponse acceptée !
Voici un exemple fonctionnel: char buffer[512]; char data[256]; HKEY hKey; DWORD taille=256; LONG retour=RegOpenKeyEx( HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run",0, KEY_QUERY_VALUE, &hKey); int index=0; retour=RegEnumValue(hKey,0,buffer,&taille,0,0,(LPBYTE)data,&taille); do { lstrcat(buffer," = "); lstrcat(buffer,data); MessageBox(0,buffer,"",0); index++; taille=256; // Réinitialisation de la taille des buffers retour=RegEnumValue(hKey,index,buffer,&taille,0,0,(LPBYTE)data,&taille); }while(retour!=ERROR_NO_MORE_ITEMS);
|