home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Snippets / FindIcon / Get_custom_folder_icon.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-07-20  |  933 b   |  30 lines  |  [TEXT/KAHL]

  1. #include "Get_custom_folder_icon.h"
  2. #include "Get_custom_file_icon.h"
  3.  
  4. /*    ------------------------------------------------------------------
  5.     Get_custom_folder_icon        Given a directory that is known to have
  6.                                 a custom icon, create an icon suite
  7.                                 for it.
  8.     
  9.     The icons are stored in an invisible file whose name, on a U.S.
  10.     system, is "\pIcon\r".  Unfortunately the name can vary in other
  11.     countries, and is stored in the Finder.
  12.     ------------------------------------------------------------------
  13. */
  14. OSErr    Get_custom_folder_icon(
  15. /* --> */    short                vRefNum,
  16. /* --> */    long                dirID,
  17. /* --> */    IconSelectorValue    icon_selector,
  18. /* --> */    ConstStr31Param        icon_file_name,
  19. /* <-- */    Handle                *the_suite
  20. )
  21. {
  22.     FSSpec    icon_file;
  23.     
  24.     icon_file.vRefNum = vRefNum;
  25.     icon_file.parID = dirID;
  26.     BlockMove( icon_file_name, icon_file.name, icon_file_name[0]+1 );
  27.     
  28.     return Get_custom_file_icon( &icon_file, icon_selector, the_suite );
  29. }
  30.