Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!think.com!paperboy!hsdndev!husc6!sri-unix!mxmora From: mxmora@sri-unix.SRI.COM (Matt Mora) Newsgroups: comp.sys.mac.programmer Subject: Re: Chooser Name? Message-ID: <21014@sri-unix.SRI.COM> Date: 8 Feb 91 23:42:24 GMT References: <1991Feb8.134003.2622@vax5.cit.cornell.edu> Reply-To: mxmora@unix.sri.com (Matt Mora) Distribution: comp Organization: SRI International, Menlo Park, CA Lines: 40 In article <1991Feb8.134003.2622@vax5.cit.cornell.edu> yomy@vax5.cit.cornell.edu writes: >I thought that I remembered seeing this somewhere, so excuse me if this has >already been discussed. How do you find out what the chooser name is of the >computer your program is running on. I can't seem to find this anywhere in >inside Mac. For what it's worth I am programming in Pascal. >Thanks for any help, >Pat Young >yomy@vax5.cit.cornell.edu Try this: procedure GetUserName (var username: str255); var syshandle: Handle; templong: longint; begin syshandle := GetResource('STR ', -16096); if syshandle <> nil then begin templong := gethandleSize(syshandle); BlockMove(ptr(syshandle^), @username, templong); end else username := ''; end; Matt -- ___________________________________________________________ Matthew Mora | my Mac Matt_Mora@QM.SRI.COM SRI International | my SUN mxmora@unix.sri.com ___________________________________________________________