Bonjour,

Question simple, je voudrais lancer mon programme au boot, je créé donc ma clef de registre comme ceci:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
 
HKEY hKey;
 
	if (!RegOpenKeyExA(HKEY_CURRENT_USER, "Software\Microsoft\Windows\CurrentVersion\Run", 0, (KEY_ALL_ACCESS | KEY_WOW64_64KEY), &hKey))
	{
		printf("Echec RegOpenKeyExA: %d\n", GetLastError());
 
		return false;
	}	
 
	const char path[] = "C:\\Users\\toto\\Desktop\\prog.exe"; 
 
	if (!RegSetValueExW(hKey, L"prog", 0, REG_SZ, (BYTE*)path, sizeof(path)))
	{
		printf("Echec RegSetValueExA: %d\n", GetLastError());
 
		return false;
	}
 
	RegCloseKey(hKey);
J'ai aucune erreur, le code semble bien faire son boulot. Mais j'ai aucune clef de créé.

Pourquoi?

PS: Je suis sou win7 64bits, Visual studio express 2013.

Merci =)