请教一下,如何得到本机上所有已注册的文件类型及其类型注释?

解决方案 »

  1.   

    这些内容 都在注册表中的HKEY_CLASSES_ROOT下,读取注册表即可。
      

  2.   

    用程序读注册表  
    在HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts
    下的项 均为当前用户所注册的文件类型
      

  3.   

    可是那要怎么得到象文件夹选项里面的注释呢?
    不知道nero怎么实现的
      

  4.   

    你不会是没找到数据吧
    以txt为例, 首先找到.txt看到他指向txtfile,然后找到txtfile,发现
    [HKEY_CLASSES_ROOT\txtfile]
    @="文本文档"[HKEY_CLASSES_ROOT\txtfile\DefaultIcon]
    @=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
      00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,73,00,68,00,\
      65,00,6c,00,6c,00,33,00,32,00,2e,00,64,00,6c,00,6c,00,2c,00,2d,00,31,00,35,\
      00,32,00,00,00[HKEY_CLASSES_ROOT\txtfile\shell][HKEY_CLASSES_ROOT\txtfile\shell\EditWithVS]
    @="&Edit with Visual Studio"[HKEY_CLASSES_ROOT\txtfile\shell\EditWithVS\command]
    @="\"C:\\Program Files\\Microsoft Visual Studio\\Common\\IDE\\IDE98\\devenv.exe\" \"%1\""[HKEY_CLASSES_ROOT\txtfile\shell\EditWithVS\ddeexec]
    @="Open(\"%1\")"[HKEY_CLASSES_ROOT\txtfile\shell\EditWithVS\ddeexec\application]
    @="vstudio"[HKEY_CLASSES_ROOT\txtfile\shell\EditWithVS\ddeexec\topic]
    @="system"[HKEY_CLASSES_ROOT\txtfile\shell\open][HKEY_CLASSES_ROOT\txtfile\shell\open\command]
    @=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
      00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,4e,00,4f,00,\
      54,00,45,00,50,00,41,00,44,00,2e,00,45,00,58,00,45,00,20,00,25,00,31,00,00,\
      00[HKEY_CLASSES_ROOT\txtfile\shell\print][HKEY_CLASSES_ROOT\txtfile\shell\print\command]
    @=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
      00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,4e,00,4f,00,\
      54,00,45,00,50,00,41,00,44,00,2e,00,45,00,58,00,45,00,20,00,2f,00,70,00,20,\
      00,25,00,31,00,00,00[HKEY_CLASSES_ROOT\txtfile\shell\printto][HKEY_CLASSES_ROOT\txtfile\shell\printto\command]
    @=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
      00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,6e,00,6f,00,\
      74,00,65,00,70,00,61,00,64,00,2e,00,65,00,78,00,65,00,20,00,2f,00,70,00,74,\
      00,20,00,22,00,25,00,31,00,22,00,20,00,22,00,25,00,32,00,22,00,20,00,22,00,\
      25,00,33,00,22,00,20,00,22,00,25,00,34,00,22,00,00,00一般信息应该都有了吧
      

  5.   

    我现在先取出ext, 再用SHGetFileInfo取注释,这样就跟“文件夹选项”里面的一样了:)