[futurebasic] Dropped folders

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : January 2002 : Group Archive : Group : All Groups

From: Pete <furbies@...>
Date: Sat, 12 Jan 2002 23:35:22 +1100
I've been trying to add the ability to handle folders being dropped onto my
PG based app in the finder

So far I can respond to both folders & drives, but when a folder is dropped,
I'm getting the parent folder of the dropped folder instead of the folder
that was dropped.

Can anyone suggest where I'm going wrong
-- 
Pete...                     (the other one)
FB^3 Release 5


My code:
local fn getDroppedFolderDiskInfo(fName as str31, vRefNum as int)

dim volumeParamBlk as VolumeParam
dim osErr as int

DEF BLOCKFILL(@gSFcInfoPBRec, sizeof(CInfoPBRec), _nil)
gSFfname = fName
gSFcInfoPBRec.ioNamePtr = @gSFfname
gSFcInfoPBRec.ioVRefNum = vRefNum
gSFcInfoPBRec.ioFDirIndex =  -1

long if FN PBGetCatInfoSync(@gSFcInfoPBRec) = _noErr
long if fn bittst(gSFcInfoPBRec.ioFlAttrib, _kFolderBit)
'~'1
/* It's a folder */
gSFspec.dirSelected = _true/* Set the flag that show a starting folder is
selected */
'~'1
end if

xelse

def blockfill(@volumeParamBlk, sizeof(VolumeParam), _nil)
volumeParamBlk.ioVolIndex = -1/* Use fname & vRefNum */
volumeParamBlk.ioNamePtr  = @fName
volumeParamBlk.ioVRefNum  = vRefNum
long if fn PBGetVInfoSync(@volumeParamBlk) = _noErr
'~'1
/* It's a disk */
def blockfill(@gSFcInfoPBRec, sizeof(CInfoPBRec), _nil)
gSFfname = fName
gSFcInfoPBRec.ioNamePtr = @gSFfname
gSFcInfoPBRec.ioVRefNum = volumeParamBlk.ioVRefNum
gSFcInfoPBRec.ioFDirIndex =  -1

long if FN PBGetCatInfoSync(@gSFcInfoPBRec) = _noErr
gSFspec.dirSelected = _true/* Set the flag that show a starting folder is
selected */
end if
'~'1
end if
end if

long if gSFspec.dirSelected = _true
dialog = _SFfolderSelectedEvt
end if

end fn