I am using the API function 'RegCreateKeyEx' to write a value to the registry. This function needs a param 'samDesired' and I give it the constant 'REG_CREATEKEY Or KEY_SET_VALUE' where
REG_CREATEKEY = &H4
and
KEY_SET_VALUE = &H2
This ensures that if the subkey does not exist, it will be created.

However I need to know if the subkey does not exist and after that decide whether to create it or not.

I tried to give the function only KEY_SET_VALUE and catch the error, but no error appears, the returnvalue is zero and the (non-existing) subkey is not created, value is not set.

Can anybody help me with this problem ?

Thx,
JHN