Since Windows Vista (I think) there has been the ability for the user to override the normal HKCR file association system, via the key
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\ .extension\UserChoice\
You need to check this key for the ProgId
value and use that if it exists, and treat HKCR\extension
as a default fallback only.