Path: utzoo!utgpu!watserv1!watmath!att!att!bu.edu!rpi!zaphod.mps.ohio-state.edu!van-bc!ubc-cs!alberta!cpsc.ucalgary.ca!news From: wieser@cs-sun-fsa.cpsc.ucalgary.ca (Bernhard Wieser) Newsgroups: comp.sys.mac.programmer Subject: SFPGetFile Keywords: A4 SFGetFile dlgHook Message-ID: <1990Nov3.032143.27001@cpsc.ucalgary.ca> Date: 3 Nov 90 03:21:43 GMT Organization: U. of Calgary Computer Science Lines: 32 Originator: wieser@cs-sun-fsd Nntp-Posting-Host: cs-sun-fsd Hi net-people! I think I've discovered a neat hack. Of course, hacking is bad, so I'd like people's comments on how safe this is. What I did, is add a button to the standard get file dialog which would exit out of SFPGetFile and return the active list item (if any). Why? I want to be able to select a folder without opening it. I didn't want to write tons of code to manage the stuff if theoretically its already lying around. pascal int dlgHook(item, theDialog) int item; DialogPtr theDialog; { SFReply *reply; if(item == myButton) { asm{ MOVE.L A4,reply ; assume A4 holds the reply record } reply->good = TRUE; item = getCancel; } return(item); } This seems to work perfectly, BUT, can I always rely on A4 pointing to SFReply? Please send me replies vie e-mail if you have comments/grumbles. Bernie Wieser, Student at U of C, Developer of Computer Things