In MSDN it says that RegEnumValue should not be used when calling function that change the registry keys being enumerated.
So does this also apply to deleting registry k
Your code does not work. When you delete index 0, the next item becomes index 0, and you do not delete that.
So yes, it applies to deleting key values.