Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Manipulasi REGEDIT menggunakan bahsa C++
#1
slam kenal smwx para master,,
sya newbie, pngen buat program sperti berikut,,,

Code:
#include <iostream> #include <cstring> #include <windows.h> #include <cstdlib> using namespace std; HKEY hkey; LONG lresult; void information() { cout << "ganti path" << endl << endl << "Example " << endl << "ganti C:\picture.jpg" << endl; } int main(int argc, char* argv[]) { unsigned int len = strlen(argv[1]); char *szpath = (char *) malloc(len+1); if (szpath != NULL) { strcpy(szpath, argv[1]); } if (argc == 2) { lresult = RegOpenKeyEx(HKEY_CURRENT_USER, "ControlPanel\\Dekstop", 0, KEY_ALL_ACCESS, &hkey); if(lresult == ERROR_SUCCESS) { lresult = RegSetValueEx((HKEY)hkey, "Wallpaper", 0, REG_SZ, (BYTE *) szpath, strlen(argv[1])); if(lresult == ERROR_SUCCESS) { cout << "succes" << endl; } } else { return false; } } else { information(); } RegCloseKey(hkey); system("pause"); return 0; }
pada saat sya compile source code di atas tidak muncul apa2 mlah kluar pringatan stop working ganti.exe ,,,
tyz pada saat sya debug muncul peringatan An acces violation(segmentation fault) rased in your program

tlong pencerahannya para master,,,

terima kasih,,,
Garing
Reply


Messages In This Thread
Manipulasi REGEDIT menggunakan bahsa C++ - by gakperlukperluwong - 03-10-2012, 07:47 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [ask] output menu menggunakan while dan for, masuk dulu om dari nubi nubito-cyber404 6 74 05-02-2012, 04:20 PM
Last Post: areg_noid
  Simple Encryption menggunakan XOR RieqyNS13 3 90 04-24-2012, 04:08 AM
Last Post: spy

Forum Jump:


Users browsing this thread: 1 Guest(s)