C language function:AssocQueryKey sample codesSearch sample code in the internet.It is the result.
TITLE : SHRegGetPath function (Windows)
TITLE : c# - How do I correctly retrieve the open command associated with an extension on Windows? - Stack Overflow
Your best bet is probably to use the Assoc* group of functions, such as AssocQueryKey() and AssocQueryString() via PInvoke. I don't know, however, whether one of the many classes that come with the .NET framework in its many incarnations wraps this for you already. But the Shell API gives you an option to retrieve this information........
TITLE : registry - Should I be closing HKEY? - Stack Overflow
if(AssocQueryKey(..., &lKey) == S_OK).......
TITLE : A programming and hacking the Windows registry using C and Win32 library functions with reference, notes and C program examples and codes samples