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
21
#include <windows.h>
#include <stdio.h>
 
 
int main()
 
{
  // Déclaration du handle
  HKEY hKey;
 
  //On ouvre la clé HKLM\Software\Microsoft\Windows\CurrentVersion\Run
  if( RegOpenKeyEx( HKEY_LOCAL_MACHINE, "Software\Microsoft\Windows\CurrentVersion\Run", 
      0,KEY_ALL_ACCESS,&hKey ) == ERROR_SUCCESS )
  {
    printf("Ouverture reussie !\n");
    RegCloseKey( hKey );
  }
   else printf("Ouverture NON reussie!\n");
 
   getchar(); 
}
Le test n'est jamais vrai