Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!ucsd!swrinde!cs.utexas.edu!uunet!efi!tim From: tim@efi.com (Tim Maroney) Newsgroups: comp.sys.mac.programmer Subject: Re: DialogHooks and SFGetFile Message-ID: <1990Jul23.202557.2202@efi.com> Date: 23 Jul 90 20:25:57 GMT References: <10183@wehi.dn.mu.oz> Organization: Electronics For Imaging, Inc. Lines: 16 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.