You could just try to read the value from the registry and see if you get an
error trying to read it. Of course, if you are not an admin user you will
fail unless you have permission for the key with, most likely, a 5 (can't
access) error, but you'll have to watch for that on limited user logins
anyway. This class has a KeyExists() function that might be useful to you
to:
http://www.codeproject.com/system/CRegistry.asp
Tom
"Jerry" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I need to delete a Registry value (not a key). I called RegDeleteValue
> expecting it returns ERROR_SUCCESS either if the value gets deleted or
> it doesn't exist there at all. However, if the value doesn't exist
> there, RegDeleteValue returns an error of "Invalid handle", which may
> something failure cases too.
>
> I wonder if there's way to check the existance of a registry value?
> Therefore I can call RegDeleteValue only if the value exists there.
>
> In addition, I had thought RegDeleteValue would return something like
> "Value doesn't exist". If so, I wouldn't have to check the value's
> existance in advance.
>
> Thanks!
>