SHGetFileInfo可以取得"*.rm"类型文件的图标,只是需要设置函数的一个参数,你看一下MSDN,如果还有问题,给我Email:[email protected],我给你一个例子。

解决方案 »

  1.   

    用FileFind找到一个扩展名是你想要的文件类型,然后处理知。。
      

  2.   

    谢谢sungang(),使用SHGFI_USEFILEATTRIBUTES属性即可。给分。
      

  3.   

    to sungang(),注册密码错误,暂时不能给分。找到密码后一定给分,决不失言
      

  4.   

    HOWTO: Retrieve an Icon for a File Class Without a File 
    ID: Q179167 
    --------------------------------------------------------------------------------
    The information in this article applies to:Microsoft Win32 Application Programming Interface (API)--------------------------------------------------------------------------------
    SUMMARY
    This article explains how to use the SHGetFileInfo API to retrieve the icon for a file class without having a specific file of that class available. MORE INFORMATION
    To do this, select the SHGFI_USEFILEATTRIBUTES flag and FILE_ATTRIBUTE_NORMAL so that the API assumes that the file exists and it will not try to look for it on disk. For example, to find the icon associated with ".zip" files the call would look like: 
       SHFILEINFO sfi;
       HIMAGELIST hil;   ZeroMemory(&sfi,sizeof(sfi));
       hil = SHGetFileInfo(".zip",
                           FILE_ATTRIBUTE_NORMAL,
                           &sfi,
                           sizeof(sfi),
                           SHGFI_USEFILEATTRIBUTES|SHGFI_ICON);   // hil now contains the handle to the system image list
       // containing the large icon images.
       // sfi.hIcon contains the large icon for the file. REFERENCESAdditional query words: Keywords : kbLib kbNTOS400 kbWinOS2000 kbWinOS95 kbWinOS98 kbGrpShell 
    Version : winnt: 
    Platform : winnt 
    Issue type : kbhowto 
    Technology : kbvcSearch 
    Last Reviewed: August 17, 2000
    © 2000 Microsoft Corporation. All rights reserved. Terms of Use.
     --------------------------------------------------------------------------------
    Send feedback to MSDN.Look here for MSDN Online resources