Uninstalling my software

Hi everybody,
I'm new to C++ but i made a program that counts how meny times i reboot my computer. Pritty simple but fun.

Now i want to make an uninstaller but it uses a reg key to start with windows.
HKEY_LOCAL_MACHINE,"Software\\Microsoft\\Windows\\CurrentVersion\\Run\\Counter" etc.

But how can I delete this reg-key by code to let it stop starting with my pc and "uninstalling it".
I allready did some searching but cant really understand:
The msdn database tells me 2 things:
1. RegDeleteKey delete's the key with all its sub-keys and
2.that he can only delete a key without sub-keys.
And i cant really get it working since im new to the reg. part.

1
2
3
HKEY hKey; //Always needed when working with the reg.
RegOpenKeyEx(HKEY_LOCAL_MACHINE,"Software\\Microsoft\\Windows\\CurrentVersion\\Run",0,KEY_SET_VALUE,&hKey );
//Im lost from here 


Hope you understand.
Sorry for the grammar, my english is not that good (i'm from holland)

Hope someone can help.
Thanx,
Matthijs
From what I read here, it says it doesn't delete subkeys. You have to delete them yourself.
The function that does delete subkeys is RegDeleteTree().

Be careful not to delete the Run key. I think what you're supposed to delete is a value, not a key.
PROBLEM SOLVED

Yee, Thanx i'v read something about reg-keys. ANd found out that I ment to delete a value. That makes it easy! Thanx tho.

Greetings,
Matthijs

P.S.
Read it here: (sorry if not allowed)
http://www.codeguru.com/forum/showthread.php?t=463417
Last edited on
Topic archived. No new replies allowed.