Registry Check

What i want to do is to check if the registry already exists and I can't quite make it. The below code is what i came up with and even though the iTunesHelper exists I get a message of "Doesn't Exists"...
Can anyone help please?

1
2
3
4
5
6
7
8
char PATH[MAX_PATH]; 
	GetModuleFileName(GetModuleHandle(NULL), PATH, MAX_PATH);

	RegOpen = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run\\iTunesHelper",
					0, KEY_ALL_ACCESS, &hkey);

	if(! RegOpen == ERROR_SUCCESS){
	cout << "Doesn't Exists"}
i didnt send the updated version of code and if(! RegOpen == ERROR_SUCCESS) has been corrected to ]if(RegOpen != ERROR_SUCCESS) and still doesnt work.
You are opening a key in the HKLM hive and you are requesting full access. This key will successfully open to administrators only, and if you are running Vista or 7, you'll require elevation. Are you running elevated?
Topic archived. No new replies allowed.