Advertisement
shifat627

registry programming in C

Jun 12th, 2016
412
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. #include<windows.h>
  2. #include<stdio.h>
  3.  
  4. main()
  5. {
  6.  
  7.  
  8. HKEY i;
  9. char info[200];
  10. DWORD l;
  11. RegCreateKey(HKEY_CURRENT_USER,"Software\\shifat2",&i);
  12. RegSetValueExA(i,"hello",0,REG_SZ,"hello shifat",12);
  13. RegCloseKey(i);
  14.  
  15. RegOpenKeyA(HKEY_LOCAL_MACHINE,"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run",&i);
  16. RegQueryValueExA(i,"welcome",0,NULL,(LPBYTE)info,&l);
  17. RegCloseKey(i);
  18. printf("%s",info);
  19. _getch();
  20.  
  21. return 0;
  22. }
  23.  
  24.  
  25.  
  26.  
  27.  
  28. /*
  29.  
  30. values of hkey
  31.  
  32. HKEY_CLASSES_ROOT 0x80000000
  33. HKEY_CURRENT_USER 0x80000001
  34. HKEY_LOCAL_MACHINE 0x80000002
  35. HKEY_USERS 0x80000003
  36. HKEY_CURRENT_CONFIG 0x80000005
  37.  
  38. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement