[futurebasic] [FB3] Plottong Icons

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : September 2001 : Group Archive : Group : All Groups

From: Craig Hoyt <aztech4mac@...>
Date: Fri, 28 Sep 2001 10:43:21 -0700
Sorry to the list it was late and I was crossedeyed after tinkering with
this for so long. I forgot I modified the HFS+.ICCL file. Below is a my
code modified to work this time. Those with a single hard drive wont get
the full effect so drop in a CD first. Sorry for the bad post.

rem Plots All mounted Volume Icons
rem All Hard Drives, CD's, Floppies, Jaz, Zips, even mounted HD's from
networked computers!

include "HFS+.INCL"
include "Tlbx Icons.Incl"

Dim vName$
dim as rect theRect,theRect2
dim @IRef&, what, OSErr%, X,gVrefNum%,test

begin RECORD FSSpecRec
DIM fsVRefNum%
DIM fsParID&
DIM 63 fsName$
END RECORD

DIM spec as FSSpecRec

call setrect(theRect,100,20,131,51)
call setrect(theRect2,50,55,180,75)
what=0
window #1,"ANY KEY TO EXIT'
text 0,12,0,0:X=0
 do
inc(X)'Inc index
test=fn ValidVolume(X)'Check for valid Volume
if test=0 then X=1:test=fn ValidVolume(X%)'If no reset to 1
vName$=fn GetVolumeName$(X)'Get Volume Name
'gVrefNum%=fn GetVolumeRefNum(X)' Get Volume RefNum

spec.fsVRefNum%=-X'Setup fileSpec using Volume info
spec.fsParID&=1
spec.fsName=vName$

OSErr%=fn geticonreffromfile (@spec,@IRef&,@what)' Get the Icon

color 0:call paintrect(theRect):color 7'Clear old Icon
OSErr%=fn
ploticonref(@theRect,_kAlignNone,_kTransformNone,_kIconServicesNormalUsageFlag,I
Ref&)'Plot New Icon
DEF CBOX (theRect2, vName$)'Print Volume Name

handleevents:delay 200

if peek(388)>0 then end
until 1=0
======================================================================
Aztech Professional On-Site Service

* Craig Hoyt
* Phone: 818-773-0864   Fax: 818-773-0675
* E-mail: craig@...
* Web: http://www.aztech4mac.com

Macintosh Technology Solutions Since 1984
=======================================================================