|
-
Apr 7th, 2003, 06:50 PM
#1
Thread Starter
Fanatic Member
Really simple Registry help, ASAP plz
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\TIT"
In the Run key, it has a value TIT (which holds "hello"). I just want it deleted (using cpp of course).
This is my current code, problem is that the type of lKeyVal is wrong I think.
Code:
#include <windows.h>
#include <iostream.h>
int main()
{
long rEt;
HWND lKeyVal;
rEt = RegOpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run\\TIT", lKeyVal);
rEt = RegDeleteValue(lKeyVal, "TIT");
rEt = RegCloseKey(lKeyVal);
return(0);
}
-
Apr 7th, 2003, 09:10 PM
#2
Addicted Member
hWnd is a handle for a window. hKey is what you want.
-
Apr 7th, 2003, 09:19 PM
#3
Thread Starter
Fanatic Member
Ok, this is my code, It does not work.. I don't know why, I passed the reference (PHKEY):
Code:
#include <windows.h>
#include <iostream.h>
int main()
{
long rEt;
HKEY PHKEY_X;
rEt = RegOpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run\\TIT", &PHKEY_X);
rEt = RegDeleteValue(PHKEY_X, "TIT");
rEt = RegCloseKey(PHKEY_X);
return 0;
}
-
Apr 7th, 2003, 09:24 PM
#4
Addicted Member
What errors do you get? Check ret.
-
Apr 7th, 2003, 09:31 PM
#5
Thread Starter
Fanatic Member
2, 6, 6 In that order of rEt being used
-
Apr 8th, 2003, 02:59 PM
#6
Thread Starter
Fanatic Member
I am logged in as admin on XP pro.. does that have anything to do with it? maybe if I mess with access rights? but hOw.
-
Apr 8th, 2003, 03:37 PM
#7
Addicted Member
Use FormatMessage() in winerror.h to find out what those error numbers mean.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|