JON@wehi.dn.mu.oz (Jon Eaves) (07/20/90)
G'day People, I have been working on a DialogHookProc for SFGetFile. I want to do special things when a folder is clicked upon and opened. However I have a little problem, the item number passed into the DialogHookProc is 103 when a folder is opened. I want to get the name of the folder that has been clicked upon. According to the documentation reply.fName gets filled with the current file that is highlighted. That is only if the file ISN'T a folder. So the big question is.... How do I get the name of the folder? I wish to use GetFInfo() to examine it, but I cannot get the parameters Is there some way of examining the UserItem #7 (the scrolling list of files)? aTdHvAaNnKcSe -------------------------------------------------------------------------------- Jon Eaves Alcohol : A colourless, volatile liquid formed from the fermentation of sugars. ACSnet ( jon@wehi.dn.mu.oz ) UUCP ( uunet!munnari!wehi.dn.mu.oz!jon ) Internet ( jon%wehi.dn.mu.oz@uunet.uu.net ) --------------------------------------------------------------------------------
tim@efi.com (Tim Maroney) (07/24/90)
In article <10183@wehi.dn.mu.oz> JON@wehi.dn.mu.oz (Jon Eaves) writes: > I have been working on a DialogHookProc for SFGetFile. I want >to do special things when a folder is clicked upon and opened. >However I have a little problem, the item number passed into the >DialogHookProc is 103 when a folder is opened. I want to get the name >of the folder that has been clicked upon. According to the documentation >reply.fName gets filled with the current file that is highlighted. That >is only if the file ISN'T a folder. So the big question is.... > > How do I get the name of the folder? Use PBGetCatInfo. The directory selected has its dirID stuffed into the fType field of the SFReply record, as documented in inside Mac volume IV. I'm not sure whether the vRefNum is stored in the reply.vRefNum at that point or not; if not, it's in SFSaveDisk (or rather, vRefNum * -1 is there) in current systems, and probably on future systems.