Path: utzoo!attcan!uunet!lll-winken!ames!ucsd!rutgers!mailrus!caen.engin.umich.edu!mystone From: mystone@caen.engin.umich.edu (Dean Yu) Newsgroups: comp.sys.mac.programmer Subject: Problem getting disk icons with PBControl Message-ID: <42a89bde.bfbf@shank.engin.umich.edu> Date: 16 Apr 89 03:30:00 GMT Reply-To: mystone@caen.engin.umich.edu (Dean Yu) Organization: Univ. of Michigan College of Engineering, Ann Arbor, MI Lines: 57 I'm trying to get drive icons via a call to PBControl with csCode 21. This works fine for hard drive icons, but I get garbage for floppies. IM V says this has been extended to work with all drives, so I assume I'm doing something wrong. The relevant code: procedure GetDriveIcon(theVolume : infoPtr); var pBlock : ParmBlkPtr iconErr : OSErr; begin pBlock:=ParmBlkPtr(NewPtr(SizeOf(ParamBLockRec))); with pBlock^ do begin csCode:=21; ioCompletion:=nil; iovRefNum:=theVolume^.vInf.driveNum; { Logical drive number } ioRefNum:=theVolume^.vInf.drvRefNum; { Driver reference number } end; iconErr:=PBControl(pBlock, false); { Synchronous control call } if iconErr = noErr then begin theVolume^.icon.baseAddr:=pointer(pBlock^.csParam[0]*65536+ pBlock^.csParam[1]); theVolume^.icon.rowBytes:=4; SetRect(theVolume^.icon.bounds,0,0,32,64); end; DisposPtr(ptr(pBlock)); end; The code does the same thing with and without Facade. 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? Thanks in advance! ______________________________________________________________________________ Dean Yu | E-mail: mystone@caen.engin.umich.edu University of Michigan | Real-mail: Dean Yu Computer Aided Engineering Network | 2413 Kelsey House ===================================| 600 E Madison "These are MY opinions." (My | Ann Arbor, MI 48109 employer doesn't want them. |========================================== Actually, they don't really care | what I think. But President | This space intentionally left blank. Duderstadt does...) | ------------------------------------------------------------------------------