• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Finder Color Label
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Finder Color Label


  • Subject: Re: Finder Color Label
  • From: Daniel Stødle <email@hidden>
  • Date: Wed, 24 Aug 2005 15:26:13 +0200

Hi Patrick,

You can get a file or folder's label as follows. Input to the function is a path, output is the label index. There may be more efficient ways, but this one works for me :) Code typed in mail, so beware of typos.

int    myGetLabel(char *path) {
    FSRef    ref;
    FSSpec   spec;
    IconRef  icon;
    SInt16   label;

if (FSPathMakeRef((UInt8*)path, &ref, 0) == noErr) {
if (FSGetCatalogInfo(&ref, kFSCatInfoNone, 0, 0, &spec, 0) == noErr) {
if (GetIconRefFromFile(&spec, &icon, &label) == noErr) {
ReleaseIconRef(icon);
return label;
}
}
}
return -1;
}


Best regards,
Daniel Stødle, Yellow Lemon Software
Check out FolderGlance:
http://home.online.no/~stoedle/YLS/YLS-products/FolderGlance.html

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Finder Color Label
      • From: Jim Correia <email@hidden>
  • Prev by Date: Re: Uniform type identifier support in Cocoa or lack thereof
  • Next by Date: Re: Finder Color Label
  • Previous by thread: Re: Finder Color Label
  • Next by thread: Re: Finder Color Label
  • Index(es):
    • Date
    • Thread