Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!ames!oliveb!apple!darin From: darin@Apple.COM (Darin Adler) Newsgroups: comp.sys.mac.programmer Subject: Re: Problem getting disk icons with PBControl Message-ID: <1474@internal.Apple.COM> Date: 20 Apr 89 08:43:56 GMT References: <42a89bde.bfbf@shank.engin.umich.edu> Organization: Apple Lines: 26 In article <42a89bde.bfbf@shank.engin.umich.edu> mystone@caen.engin.umich.edu (Dean Yu) writes: > If it's just a case of PBControl not returning a pointer to the icon > for a floppy (which I doubt, since Facade works with floppies), how can > I tell when I'm trying to get an icon for a floppy? csParam isn't NIL > for a bad icon, so it's not that simple. And PBControl still returns > noErr. > As a side note, what's the difference between sending csCode 21 and 22 > besides the fact that 21 returns a string for the Get Info box? Code 21 returns an icon for the disk drive itself. Code 22 returns an icon representing the media that goes into the drive. This is the opposite of what Inside Macintosh Volume V says. Many disk drivers do not support code 22, so if you want the media icon, you should make call 22, then call 21 if nothing is returned from call 22. To detect a driver that does not handle the control call, you will need to nil out csParam *before* calling PBControl. Many drivers return noErr for control calls that they do not handle, but most (all) will leave csParam alone, and its value will still be nil. What makes this method even safer is that the Finder does it this way, and all disk drivers (never say all) have to work with the Finder. -- Darin Adler, System Software Scapegoat, Apple Computer Internet: darin@Apple.com UUCP: {nsc,sun}!apple!darin