For a Win32 API solution you use RegOpenKeyEx
to test for existence of a key.
Do note that you must not hard code Wow6432Node
. Use the KEY_WOW64_32KEY
flag to specify that you want to look in the 32 bit view of the registry.
You would want to pass
STANDARD_RIGHTS_READ | KEY_WOW64_32KEY
to the samDesired
argument of RegOpenKeyEx
.